newPolygon: Create a new simple 2D polygon.

Description Usage Arguments Value See Also Examples

View source: R/polygon.R

Description

Creates a new simple 2D polygon from the coordinates. The polygon is stored as a matrix where the first row are the x coordinates of the vertices and the second row are the y coordinates.

Usage

1
  newPolygon(x, y)

Arguments

x

Vector with x coordinates of the vertices

y

Vector with y coordinates of the vertices

Value

A matrix with class polygon where each column is a vertex of the polygon

See Also

newPolygon3d, polygonArea, polygonCentroid, polygonIntersect

Examples

1
2
p <- newPolygon(c(0,1,2,1,2,0), c(0,0,1,2,3,3))
print(p)

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