The C# code snippet below is useful to determine whether the vertices of a polygon are in the clockwise direction or counter clockwise direction. Simply pass in the polygon vertices into the function as an array of PointF structures where the first and last member of the array are the same point. The function will return true if the vertices are in the clockwise direction and false if they are in the counter-clockwise direction.
private bool IsClockwisePolygon(PointF[] polygon)
{
bool isClockwise = false;
double sum = 0;
for ( int i = 0; i < polygon.Length-1; i++)
{
sum += (polygon[i + 1].X - polygon[i].X) * (polygon[i + 1].Y + polygon[i].Y);
}
isClockwise = (sum > 0) ? true : false;
return isClockwise;
}