dot-point_in_polygon: Raycasting Algorithm to find out whether a point is in a...

.point_in_polygonR Documentation

Raycasting Algorithm to find out whether a point is in a given polygon. Performs the even-odd-rule Algorithm to find out whether a point is in a given polygon. This runs in O(n) where n is the number of edges of the polygon.

Description

Raycasting Algorithm to find out whether a point is in a given polygon. Performs the even-odd-rule Algorithm to find out whether a point is in a given polygon. This runs in O(n) where n is the number of edges of the polygon.

Usage

.point_in_polygon(polygon, point)

Arguments

polygon

an array representation of the polygon where polygon[i,1] is the x Value of the i-th point and polygon[i,2] is the y Value.

point

an array representation of the point where point[1] is its x Value and point[2] is its y Value

Value

whether the point is in the polygon (not on the edge, just turn < into <= and > into >= for that)

Author(s)

Javier Porobic


Atlantis-Ecosystem-Model/ReactiveAtlantis documentation built on April 16, 2024, 6:27 a.m.