Essentially, for your problem:
- Calculate a bounding box that fits the given points.
- Generate a random point in the bounding box.
- If the random point is not in the convex hull of the given points, go to step 1.
For two-dimensional cases, if you know all the shapes you care about are convex, then this is relatively trivial: divide the shape into triangles, choose one of them at random based on their area, and generate a random point in that triangle. But for higher dimensions, this is far from trivial. In fact, the convex hull is likely to be much smaller than the bounding box with higher dimensions, so many points are likely to be rejected. And computing the convex hull itself may be complicated. This question's answers have some ideas on how to find if a point is inside a convex hull.
If you can accept approximations, you can also precalculate a number of points that are in the convex hull, then, each time you need a random point:
- Choose one of the precalculated points at random.
- Calculate a random point that's "close" to the chosen point (e.g., a point shifted by a normally-distributed distance in each dimension).
- Clamp the random point by the bounding box.
This has the disadvantage that the random points will be as dense as the precalculated points, and not necessarily uniformly distributed.