pnpoly: Is the point inside the the polygon?

Description Usage Arguments Value Examples

View source: R/polygon.R

Description

Determines if a point is inside a simple polygon.

Usage

1
  pnpoly(vx, vy, x, y)

Arguments

vx

x coordinates of the vertices of the polygon.

vy

y coordinates of the vertices of the polygon.

x

x coordinate of the point to be tested.

y

y coordinate of the point to be tested.

Value

TRUE if the point is inside the polygon.

Examples

1
2
3
4
vx <- c(0, 2, 2, 0)
vy <- c(0, 0, 2, 2)
print(pnpoly(vx, vy, 1, 1))
print(pnpoly(vx, vy, 3, 1))

tunelipt/model3d documentation built on Nov. 5, 2019, 10:59 a.m.