March 11th, 2015, 11:52 pm
QuoteOriginally posted by: outrunMonte Carlo on a (hyper)sphere is also easy, draw D numbers {c1, c2, ..., cd} from the standard normal distribution and then rescale them by dividing them by the length sqrt(c1^2 + c2^2 + ... + cd^2)... but the "inside test"! The center must be inside the convex hull made up of all D-1 planes that come together at each point. That would be the correct orientstion of inside/outside I think.It looks like the inside test is not too hard. The volume of a tetrahedron is pretty easy to compute from the vertex coordinatesIf V(C,P1,P2,P3) + V(C,P1,P2,P4) + V(C,P1,P3,P4) + V(C,P2,P3,P4) == V(P1,P2,P3,P4), then the center is inside (the numerical version will need to be careful of round-off errors). If the center is outside, the LHS sum of the volumes will be much greater than the RHS volume.
Last edited by
Traden4Alpha on March 11th, 2015, 11:00 pm, edited 1 time in total.