1

Some fast algorithms for working with polygons require the vertices of the polygon to have a specific order (clockwise or counter clockwise with respect to the polygon's plane normal).

To use those algorithms in 3D planar polygons (where all the points lie in a particular plane) one can perform a change of basis to a basis spanned by two orthogonal vectors that lie in the plane and a plane normal vector.

Is there a way to always find a basis in which the polygon vertices are always in counter clockwise (or clockwise) order?

Community
  • 1
  • 1
gnzlbg
  • 7,135
  • 5
  • 53
  • 106

1 Answers1

1

Perhaps the best method is to compute the signed area of the polygon, and if it is negative, you know your vertices are clockwise; so reverse. If it is positive, your vertices are counterclockwise.

Search for "signed area of polygon." Here is one Mathematica link:


SignedArea
Joseph O'Rourke
  • 4,346
  • 16
  • 25