Given a directed cycle in the plane I need to walk it and detect whether it is clockwise or counterclockwise.


My first idea is to gather the sum of the turn angles, where a "left" turn is a negative angle, and a "right" turn is a positive angle. If I go with this one, I need a good way to calculate the angle between two vectors, and also which sign this angle should have (+/-).


Even if I had the right tools to calculate the (+/-) angle I feel like this could be done simpler.c



Detecting whether directed cycle is clockwise or counterclockwise
The orientation of a triangle (clockwise/counterclockwise) is the sign of the determinant
$\begin{bmatrix}
1&x\_1&y\_1\\\\
1&x\_2&y\_2\\\\
1&x\_3&y\_3
\end{bmatrix}$, where $(x\_1,y\_1), (x\_2,y\_2), (x\_3,y\_3)$ are the Cartesian coordinates of the three vertices of the triangle.


