MapsExtensionsIsPointInPolygon Method

Checks if point is inside polygon, using the Ray-Casting Algorithm (also known as even-odd rule). This algorithm works for both convex and concave polygons.

Definition

Namespace: MobileTrack.Web.Components.Extensions
Assembly: MobileTrack.Web.Components (in MobileTrack.Web.Components.dll) Version: 0.7+45c8d9adb5970d727cceec44a5ed61aea0016e50
public static bool IsPointInPolygon(
	this List<LatLngLiteral> polygon,
	LatLngLiteral point
)

Parameters

polygon  ListLatLngLiteral
Polygon to test against
point  LatLngLiteral
Point to test against

Return Value

Boolean
if point is inside polygon.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ListLatLngLiteral. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Remarks

The floating-point precision (Epsilon) is added to avoid DivideByZeroExceptions.

See Also