Learn R Programming

Momocs (version 1.1.6)

coo_theta3: Calculate the angle formed by three (x; y) coordinates

Description

Returns the angle (in radians) defined by a triplet of points either signed ('atan2') or not ('acos').

Usage

coo_theta3(m, method = c("atan2", "acos")[1])

Arguments

m
a 3x2 matrix of 3 points (rows) and (x; y) coordinates
method
one of 'atan2' or 'acos' for a signed or not angle.

Value

numeric the angle in radians.

See Also

Other coo_ descriptors: coo_area, coo_boundingbox, coo_chull, coo_circularityharalick, coo_circularitynorm, coo_circularity, coo_convexity, coo_eccentricityboundingbox, coo_eccentricityeigen, coo_elongation, coo_length, coo_lw, coo_rectangularity, coo_rectilinearity, coo_solidity, coo_tangle, coo_thetapts, coo_width

Examples

Run this code
data(bot)
b <- coo_sample(bot[1], 64)
b <- b[c(1, 14, 24), ]
coo_plot(b)
coo_theta3(b)
coo_theta3(b, method='acos')

Run the code above in your browser using DataLab