当前位置:网站首页>Use of deg2rad and rad2deg functions in MATLAB

Use of deg2rad and rad2deg functions in MATLAB

2022-07-06 19:13:00 jk_ one hundred and one

Catalog

grammar

explain

Example

A right angle in radians

Surface distance

pi In degrees

Spherical distance


        deg2rad The function converts angles from degrees to radians .

        rad2deg The function converts the units of angles from radians to degrees .

grammar

R = deg2rad(D)
D = rad2deg(R)

explain

         about D Each element of ,R = deg2rad(D) Convert the units of angles from degrees to radians .

        D = rad2deg(R) take R The angular unit of each element in is converted from radians to degrees .

Example

A right angle in radians

take 90 Degrees are converted to radians .

R = deg2rad(90)
R = 1.5708

Surface distance

Specify the spherical distance between Munich and Bangalore and the average radius of the earth in degrees ( In kilometers ). Calculate the distance between Munich and Bangalore ( Measure along the surface of the earth , In kilometers ).

D = 64.7;
radEarth = 6371;
R = deg2rad(D);
dist = radEarth*R


dist = 7.1943e+03

pi In degrees

take pi Convert to degrees .

D = rad2deg(pi)
D = 180

Spherical distance

         Specify the average radius of the earth and the distance from Munich to Bangalore measured along the earth's surface ( In kilometers ). Calculate the spherical distance between Munich and Bangalore in degrees .

dist = 7194;
radEarth = 6371;
R = dist/radEarth;
D = rad2deg(R)


D = 64.6972

Input parameter description

D - Angle in degrees

         Angle in degrees , Specify as scalar 、 vector 、 Matrix or multidimensional array . If D Contains plural elements , be deg2rad The real part and the imaginary part will be converted respectively .

data type : single | double
Plural support : yes

R - Angle in radians

         Angle in radians , Specify as scalar 、 vector 、 Matrix or multidimensional array . If R Contains plural elements , be rad2deg The real part and the imaginary part will be converted respectively .

data type : single | double
Plural support : yes

Output parameter description

R - Angle in radians

         Angle in radians , In scalar 、 vector 、 Returns... As a matrix or multidimensional array .R The size and D identical .

D - Angle in degrees

         Angle in degrees , In scalar 、 vector 、 Returns... As a matrix or multidimensional array .D The size and R Same size for .

原网站

版权声明
本文为[jk_ one hundred and one]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207061120541391.html