angle | R Documentation |
angle()
creates angle vectors with user specified angular unit.
around as_angle()
for those angular units.
angle(x = numeric(), unit = getOption("affiner_angular_unit", "degrees"))
degrees(x)
gradians(x)
pi_radians(x)
radians(x)
turns(x)
x |
An angle vector or an object to convert to it (such as a numeric vector) |
unit |
A string of the desired angular unit. Supports the following strings
(note we ignore any punctuation and space characters as well as any trailing
|
A numeric vector of class "angle". Its "unit" attribute is a standardized string of the specified angular unit.
as_angle()
, angular_unit()
, and angle-methods.
https://en.wikipedia.org/wiki/Angle#Units for more information about angular units.
# Different representations of the "same" angle
angle(180, "degrees")
angle(pi, "radians")
angle(0.5, "turns")
angle(200, "gradians")
pi_radians(1)
a1 <- angle(180, "degrees")
angular_unit(a1)
is_angle(a1)
as.numeric(a1, "radians")
cos(a1)
a2 <- as_angle(a1, "radians")
angular_unit(a2)
is_congruent(a1, a2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.