angle2slope: Angle - Slope conversion and Principal Measure determination

View source: R/dendrometry.R

angle2slopeR Documentation

Angle - Slope conversion and Principal Measure determination

Description

Conversion of angle to slope values and reciprocally.
angle2slope converts angle to slope values.
slope2angle converts slope to angle values.
principal determines the principal measure of an angle value. Principal measure ranges from -pi to pi for radian unit while it ranges from -180 to 180 for degree unit.

Usage

angle2slope(angle, angleUnit = c("deg", "rad"))

slope2angle(slope, angleUnit = c("deg", "rad"))

principal(angle, angleUnit = c("deg", "rad"))

Arguments

angle

numeric, vector of angle to be converted to slope.

angleUnit

character, unit of angle.
For slope2angle, the desired unit for the returned angle value.
For principal, both the angle input and output unit.
Either deg or rad. Default is deg.

slope

numeric, vector of slope to be converted to angle.

Value

Object of class angle.
angle2slope returns vector of slope values while slope2angle and principal return vector of angle values in unit specified in angle argument.

Note

Use principal in position computations, not distance computations.

See Also

deg and rad.

Examples

angle2slope(10)
angle2slope(angle = 45)
angle2slope(angle = pi / 4, angleUnit = "rad")
angle2slope(1.047198, "rad")
angle2slope(seq(0.2, 1.5, .4), angleUnit = "rad") #'

slope2angle(100)
slope2angle(100, "rad")
round(pi / 4, 2)

slope2angle(17.6327)
slope2angle(angle2slope(30))

principal(303)
principal(23 * pi / 8, "rad")
principal(7 * pi / 4, angleUnit = "rad")
deg(principal(7 * pi / 4, angleUnit = "rad"))
principal(7 * 45)


dendrometry documentation built on June 8, 2025, 10:38 a.m.