WebPlanner Programmer's Guide

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 (
    PointF[] poly,
    PointF ptTest
)

Visual Basic  Copy Code

Public Shared Function PointInPolygon ( _
    poly() As PointF, _
    ptTest As PointF _
) 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