deg2rad: Degrees to Radians

Description Usage Arguments Details Value Examples

View source: R/deg2rad.R

Description

Transforms between angles in degrees and radians.

Usage

1
2
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

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

Example output

 [1] 0.0000000 0.1745329 0.3490659 0.5235988 0.6981317 0.8726646 1.0471976
 [8] 1.2217305 1.3962634 1.5707963
 [1] -90 -80 -70 -60 -50 -40 -30 -20 -10   0  10  20  30  40  50  60  70  80  90

pracma documentation built on Nov. 21, 2017, 3:01 p.m.