ponpoly: Is the point inside or on the boundary of a polygon?

Description Usage Arguments Value Examples

View source: R/polygon.R

Description

Determines if a point is inside or on the boundary of a simple polygon. This function simply calls pnpoly and pnpolybnd.

Usage

1
  ponpoly(vx, vy, x, y, eps0 = 1e-08)

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
5
vx <- c(0, 2, 2, 0)
vy <- c(0, 0, 2, 2)
print(pnpoly(vx, vy, 1, 1))
print(pnpoly(vx, vy, 3, 1))
print(pnpoly(vx, vy, 2, 1))

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