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

Polygon orientation

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.


Download Example   Follow me on Twitter   RSS feed




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

6 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. Pingback: Reverse the orientation of a polygon in C# |

  3. Pingback: Find a minimal bounding rectangle for a polygon in C# |

  4. Pingback: Perform geometric operations on polygons in C# |

  5. Pingback: Enlarge a polygon in C# - C# HelperC# Helper

Leave a Reply

Your email address will not be published. Required fields are marked *