# Determine whether a polygon is oriented clockwise or counterclockwise in C#

The post Calculate the area of a polygon in C# explains how to calculate the “signed area” of a polygon. That Polygon class’s SignedPolygonArea method returns a positive area if the polygon is oriented clockwise and a negative area if it is oriented counterclockwise.

The following PolygonIsOrientedClockwise method uses SignedPolygonArea method to determine whether a polygon is oriented clockwise.

// Return true if the polygon is oriented clockwise.
public bool PolygonIsOrientedClockwise()
{
return (SignedPolygonArea() < 0);
}

See the previous post for information about how the SignedPolygonArea method works.

This entry was posted in algorithms, geometry, graphics, mathematics and tagged , , , , , , , , , , , , , . Bookmark the permalink.

### 7 Responses to Determine whether a polygon is oriented clockwise or counterclockwise in C#

1. kerUttermasit says:

Complex Post. This post helped me in my college assignment. Thnaks Alot

2. Kurt Tregre says:

I love it

3. Lee Glosser says:

Thank you very much.

This site uses Akismet to reduce spam. Learn how your comment data is processed.