Skip to contents

stm_rad_to_degrees() converts a value in radians to degrees. The result can be rounded to a specified number of decimal places.

Usage

stm_rad_to_degrees(radians, digits = NULL)

Arguments

radians

A numeric value representing the angle in radians.

digits

Optional. The number of decimal places to round the result. Default is NULL for no rounding.

Value

The value in degrees, rounded to the specified number of decimal places if digits is provided.

Details

The function converts the given angle in radians to degrees by multiplying by 180 / pi. If digits is specified, the result is rounded to that number of decimal places.

Examples

stm_rad_to_degrees(pi)
#> [1] 180
stm_rad_to_degrees(c(pi/2, pi, 2 * pi))
#> [1]  90 180 360
stm_rad_to_degrees(pi/180)
#> [1] 1