问题
I have some points in 3D which are in a single plane. I want to arrange them in clock wise or counter clockwise order.
The points can create a concave or convex polygon in a single plane.
Can any body give any suggestions?
回答1:
Find the center of all the points, then calculate all the angles from the center to each point. Then sort by angle.
回答2:
Ok, I nearly solve the problem. I got line segment instead of having points in 3d. So, Now I have to arrange line segment in sequence. Which becomes somehow easier for me. I am now able to arrange them in sequence.
来源:https://stackoverflow.com/questions/2778805/arrange-points-in-sequence