Skip to contents

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

Usage

stm_deg_to_radians(degrees, digits = NULL)

Arguments

degrees

A numeric value representing the angle in degrees.

digits

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

Value

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

Details

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

Examples

stm_deg_to_radians(90)
#> [1] 1.570796
stm_deg_to_radians(c(0, 45, 90))
#> [1] 0.0000000 0.7853982 1.5707963
stm_deg_to_radians(180, digits = 2)
#> [1] 3.14