 Open in App
Not now

# Program to Convert Radian to Degree

• Last Updated : 10 Aug, 2022

Before moving to the actual solution, let’s try to find out what is a degree, a radian, and their relations.

Radian : The radian is the standard unit of angular measure, used in many areas of mathematics. The length of an arc of a unit circle is numerically equal to the measurement in radians of the angle that it subtends. One radian is just under 57.3 degrees.

Degree : A degree (in full, a degree of arc, arc degree, or arcdegree), usually denoted by ° (the degree symbol), is a measurement of a plane angle, defined so that a full rotation is 360 degrees.
The relation 2pi*rad = 360° can be derived using the formula for arc length

An arc of a circle with the same length as the radius of that circle subtends an angle of 1 radian. The circumference subtends an angle of 2pi radians.

Therefore the formula is:

```degree = radian * (180/pi)
where, pi = 22/7```

Examples:

```Input : radian = 20
Output : degree = 1145.4545454545455
Explanation: degree = 20 * (180/pi)

Output : degree = 286.3636363636364
Explanation : degree = 20 * (180/pi)```

Note: In this programs, we have taken the value of pi as 3.14159 to get standard result in all three languages.

## C++

 `// C++ code to convert radian to degree``#include ``using` `namespace` `std;` `// Function for conversion``double` `Convert(``double` `radian)``{``    ``double` `pi = 3.14159;``    ``return``(radian * (180 / pi));``}` `// Driver code``int` `main()``{``    ``double` `radian = 5.0;``    ``double` `degree = Convert(radian);``    ` `    ``cout << degree;``    ``return` `0;``}` `// This code is contributed by Khushboogoyal499`

## C

 `// C code to convert radian to degree` `#include ` `// Function for conversion``double` `Convert(``double` `radian){``    ``double` `pi = 3.14159;``    ``return``(radian * (180/pi));``}` `// Driver Code``int` `main(){``    ``double` `radian = 5.0;``    ``double` `degree = Convert(radian);``    ``printf``(``"%.5lf"``, degree);``    ``return` `0;``}`

## Java

 `// Java code to convert radian to degree` `import` `java.io.*;``class` `GFG {``    ``// Function for conversion``    ``static` `double` `Convert(``double` `radian){``        ``double` `pi = ``3.14159``;``        ``return``(radian * (``180``/pi));``    ``}``    ``// Driver Code``    ``public` `static` `void` `main (String[] args) {``        ``double` `radian = ``5.0``;``        ``double` `degree = Convert(radian);``        ``System.out.println(``"degree = "``+ degree);``    ``}``}`

## Python3

 `# Python code to convert radian to degree` `# Function for conversion``def` `Convert(radian):``    ``pi ``=` `3.14159``    ``# Simply used the formula``    ``degree ``=` `radian ``*` `(``180``/``pi)``    ``return` `degree` `# Driver Code``radian ``=` `5``print``(``"degree ="``,(Convert(radian)))`

## C#

 `// C# code to convert radian to degree.``using` `System;` `class` `GFG {` `    ``// Function for conversion``    ``static` `double` `Convert(``double` `radian){``        ``double` `pi = 3.14159;``        ``return``(radian * (180 / pi));``    ``}` `    ``// Driver Code``    ``public` `static` `void` `Main () {``        ``double` `radian = 5.0;``        ``double` `degree = Convert(radian);``        ``Console.Write(``"degree = "` `+ degree);``    ``}``}` `// This code is contributed by Nitin Mittal.`

## PHP

 ``

## Javascript

 ``

Output

`286.479`

Time Complexity: O(1), as we are not using any loops.

Auxiliary Space: O(1), as we are not using any extra space.

Example :

The following program demonstrates toDegree() and toRadians() .

## Java

 `// Demonstrate toDegree and toRadians():` `class` `GFG{``public` `static` `void` `main(String args[]){``double` `theta = ``120.0``;``   ` `  ``// degree --> radians``  ``System.out.println(theta+ ``" degree is "``+ Math.toRadians(theta)+ ``" radians."``);``  ` `  ``theta =``1.312``;``  ``// radians --> degrees``   ``System.out.println(theta+ ``" radians is "``+ Math.toDegrees(theta)+ ``" degrees."``);``}``}`

## Python3

 `# Demonstrate toDegree and toRadians():` `import` `math` `theta ``=` `120.0``;``   ` `#degree --> radians``print``(theta, ``"degree is"``, math.radians(theta), ``"radians."``);``  ` `theta ``=``1.312``;``#radians --> degrees``print``(theta, ``"radians is "``,  math.degrees(theta), ``"degrees."``);`  `# This code is contributed by phasing17`

Output

```120.0 degree is 2.0943951023931953 radians.