poly3dNorm: Normal of a 3D polygon.

Description Usage Arguments Value See Also Examples

View source: R/geometry.R

Description

Computes the normal of a simple polygon.

Usage

1
  poly3dNorm(p, eps = 1e-08)

Arguments

p

Polygon where each column are the coordinates of a vertex

eps

Relative error acceptable when determining if 3 vertices are colinear

Value

A vector containing the normal to the polygon when the vertices are assumed to be numbered in counterclockwise manner.

See Also

crossProduct, triNormal

Examples

1
2
poly <- matrix(c(0,0,0, 1,0,0, 1,1,0, 0,1,0), 3, 4)
print(poly3dNorm(poly))

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