This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Convert angle from degrees to radians


R = deg2rad(D)



R = deg2rad(D) converts angle units from degrees to radians for each element of D.


collapse all

Convert a 90 degree angle into radians.

R = deg2rad(90)
R = 1.5708

Specify the spherical distance between Munich and Bangalore in degrees and the mean radius of Earth in kilometers. Compute the distance (measured along the Earth's surface) between Munich and Bangalore, in kilometers.

D = 64.7;
radEarth = 6371;
R = deg2rad(D);
dist = radEarth*R
dist = 7.1943e+03

Input Arguments

collapse all

Angle in degrees, specified as a scalar, vector, matrix, or multidimensional array. If D contains complex elements, deg2rad converts the real and imaginary parts separately.

Data Types: single | double
Complex Number Support: Yes

Output Arguments

collapse all

Angle in radians, returned as a scalar, vector, matrix, or multidimensional array. R is the same size as D.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also

Introduced in R2015b