|
|
Title | Find the orientation of a polygon (clockwise or counterclockwise) in Visual Basic .NET |
Description | This example shows how to find the orientation of a polygon (clockwise or counterclockwise) in Visual Basic .NET. |
Keywords | polygon, orientation, clockwise, counterclockwise, graphics, VB.NET |
Categories | Graphics, VB.NET |
|
|
This program calculate the polygon's signed area. The result is negative if the polygon is oriented clockwise. See the HowTo Calculate a polygon's area in Visual Basic .NET for information on finding a polygon's signed area.
|
|
' Return True if the polygon is oriented clockwise.
Public Function PolygonIsOrientedClockwise(ByVal points() _
As PointF) As Boolean
Return SignedPolygonArea(points) < 0
End Function
|
|
For more information on graphics programming in Visual Basic, see my book Visual Basic Graphics Programming.
|
|
|
|
|
|