redundantVertices {tigers} | R Documentation |
Redundant Vertices in a Polygon
Description
Tests and optionally correct for redundant vertices in a polygon.
The other functions test some features of a polygon.
revPolygon
reverses the order of the vertices (i.e., swiching
between clockwise and counterclockwise orders).
Usage
redundantVertices(x, tol = 1e-8, check.only = FALSE)
is.clockwise(x)
is.convex(x)
is.open(x)
revPolygon(x, copy = TRUE)
Arguments
x |
a two-column matrix. |
tol |
the tolerance to consider two vertices identical. |
check.only |
a logical value. |
copy |
by default, a new polygon is created; if |
Details
If check.only
is TRUE
, the first function prints the
diagnostics and nothing is returned. Otherwise, the possibly corrected
matrix is returned.
Value
redundantVertices
returns a two-column numeric matrix, or
nothing if check.only = TRUE
(the diagnostics are printed in
the console).
is.clockwise
, is.convex
, and is.open
return a
single logical value.
revPolygon
returns by default a two-column numeric matrix, or
nothing if copy = FALSE
(the first argument is modified).
Author(s)
Emmanuel Paradis
References
The method for is.clockwise
is from:
https://en.wikipedia.org/wiki/Curve_orientation