Convert degree to radian and radian to degree in Julia – deg2rad() and rad2deg() Methods
Last Updated :
21 Apr, 2020
The deg2rad()
is an inbuilt function in julia which is used to convert the specified degree values to radian values.
Syntax: deg2rad(x)
Parameters:
- x: Specified value in degree.
Returns: It returns the values in radian.
Example:
println(deg2rad( 0 ))
println(deg2rad( 30 ))
println(deg2rad( 50 ))
println(deg2rad( 60 ))
|
Output:
0.0
0.5235987755982988
0.8726646259971648
1.0471975511965976
rad2deg()
The rad2deg()
is an inbuilt function in julia which is used to convert the specified radian values to degree values.
Syntax: rad2deg(x)
Parameters:
- x: Specified values in radian.
Returns: It returns the values in degree.
Example:
println(rad2deg(pi))
println(rad2deg( 3.14 ))
println(rad2deg( 22 / 7 ))
|
Output:
180.0
179.9087476710785
180.07244989825872
Share your thoughts in the comments
Please Login to comment...