Having a list of points, how do I find if they are in clockwise
order? point = (5,0) point = (6,4) point = (4,5) point = (1,5)
point = (1,0) would say that it is anti-clockwise (counter-
clockwise for some people). Some of the suggested methods will
fail in the case of a non-convex polygon, such as a crescent.
Here's a simple one that will work with non-convex polygons
(it'll even work with a self-intersecting polygon like a figure-
eight, telling you whether it's mostly clockwise). Sum over the
edges, (x2-x1)(y2+y1). If the result is positive the curve is
clockwise, if it's negative the curve is counter-clockwise. (The
result is twice the enclosed area, with a +/- convention.) |show
8 more comments| Because the cross product measures the degree
of perpindicularness of two vectors... If you imagine that each
edge of your polygon is a vector in the x-y plane of a 3-d xyz
space, then the cross product of two successive edges would be a
vector in the z-direction (if the second segment is clockwise)
or in the minus