Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

deg2rad

Degrees to Radians


Description

Transforms between angles in degrees and radians.

Usage

deg2rad(deg)
rad2deg(rad)

Arguments

deg

(array of) angles in degrees.

rad

(array of) angles in radians.

Details

This is a simple calculation back and forth. Note that angles greater than 360 degrees are allowed and will be returned. This may appear incorrect but follows a corresponding discussion on Matlab Central.

Value

The angle in degrees or radians.

Examples

deg2rad(c(0, 10, 20, 30, 40, 50, 60, 70, 80, 90))
rad2deg(seq(-pi/2, pi/2, length = 19))

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.