How to create a non-intersecting polygon in 3D containing n given points on a sphere?

82 Views Asked by At

I have the coordinates of n points on a sphere and I know they are all coplanar. How can I find the edges of the polygon which has the vertex the n given points?

1

There are 1 best solutions below

0
MBo On BEST ANSWER

OK, your problem is weird ordering.
Project all points onto any convenient plane - the simplest approach is using OXY, OXZ or OYZ plane (choose one that is not perpendicular to your plane) - in this case you just use (P[i].X. P[i].Y, 0) for P[i] point and sort projected 2D points by angle against the first point - it works because points on sphere arc form convex polygon. Then use this ordering as polygon vertex indexes.