[Math] 3D Equivalent of Clockwise and Counter-Clockwise

3deuclidean-geometrygeometry

As an example say I have some 2D points which are formed into a polygon:

enter image description here

The order of sequential points may be clockwise or counter-clockwise, but is there a 3-dimensional equivalent (even if there are more than two ways of doing it, as long as there are some finite number of ways of doing it for an infinite set of points and it is intrinsic to the geometry, that is nothing like "order by a vector then loop clockwise or counterclockwise around that vector" which might change with different values for the vector.)

Best Answer

You can define if a line (edge connecting two points) has a counterclockwise (positive) or clockwise (negative) moment with respect to a rotation axis. For the planar equivalent the rotation axis is coming out of the plane.

You do this with the triple product. Let's say the rotation axis is $\vec{z}$ and all points are defined wrt. this axis have position $\vec{r}_i$, then two points i and j forming an edge have direction $\vec{e} = \vec{r}_j - \vec{r}_i$

The edge is CCW to the rotation if

$$ \vec{z} \cdot \left( \vec{r}_i \times \vec{e} \right) > 0 $$

or

$$ \vec{z} \cdot \left( \vec{r}_i \times \vec{r}_j \right) > 0 $$

Related Question