Table of Contents

Method Contains

Namespace
Pinwheel.Vista.Geometric
Assembly
Pinwheel.Vista.Runtime.dll

Contains(Vector2)

Tests whether a point lies inside the polygon or on one of its vertices or edges.

public bool Contains(Vector2 p)

Parameters

p Vector2

The point to test.

Returns

bool

true when the point is inside or on the polygon boundary; otherwise, false.

Remarks

The method uses a horizontal ray cast from just left of the polygon's minimum X bound and counts segment intersections. Exact vertex matches are treated as contained immediately.