Search
Utilities.PointInPolygon Method
See Also
 






Determines if the specified point is within the specified polygon.

Namespace: MindFusion
Assembly: MindFusion.Common

 Syntax

C#  Copy Code

public static bool PointInPolygon (
    IList<Point> poly,
    Point ptTest
)

Visual Basic  Copy Code

Public Shared Function PointInPolygon( _
    poly As IList(Of Point), _
    ptTest As Point _
) As Boolean

 Parameters

poly

ptTest

 Return Value

true if the point is inside the polygon, false if not.

 Remarks

It uses the classical polygon hit-testing algorithm: a horizontal ray starting at the point is extended infinitely rightwards and the number of polygon edges that intersect the ray are counted. If the number is odd, the point is inside the polygon.

 See Also