poly_apex_base_angle {pliman} | R Documentation |
Calculate the apex and base angles of an object
Description
This function calculates the apex and base angles of an object. It takes as
input a matrix of coordinates and returns the apex angle, base angle, and the
coordinates of the apex and base as a list. The angles are computed after the
object is aligned in the vertical axis with poly_align()
.
Usage
poly_apex_base_angle(
x,
percentiles = c(0.25, 0.75),
invert = FALSE,
plot = TRUE
)
Arguments
x |
A matrix of coordinates representing the contour of the object,
often obtained with |
percentiles |
A numeric vector of two percentiles between 0 and 1 indicating the height of the points from the top to the bottom. The function calculates the apex angle between the two percentiles and the base angle between the lowest point and the highest point. |
invert |
If |
plot |
Plots the polygon with the points? Defaults to |
Value
A list containing the apex angle, base angle, apex coordinates, and base coordinates.
Examples
library(pliman)
# a matrix of coordinates
angls <- poly_apex_base_angle(contours[[2]])
angls
# or a list of coordinates
poly_apex_base_angle(contours)