java.lang.Math toRadians(double angdeg)

Description :

This java tutorial shows an example on how to use the toDegrees(double angrad) method of Math class under java.lang package. This method returns the equivalent in degrees the value specified angle in degrees as method argument.

Method Syntax :

public static double toDegrees(double angrad)

Parameter Input :

DataType Parameter Description
double angrad the angle in radians to be converted in degrees

Method Returns :

The toDegrees(double angrad) method simply returns the equivalent in degreess the radians specified as method argument.

Compatibility Version :

Requires Java 1.0 and up

Exception :

N/A

Discussion :

The toDegrees(double angrad) method is static thus we should invoke it statically for example Math.toDegrees(double angrad). This method simply returns the equivalent in degrees the angle in radians as method argument. We would be using this widely since the trigonometric functions of Math class usually takes radians as an input which is very much different in real life applications since angles is usually represented in degrees.

Java Code Example :

This java example source code demonstrates the use of toDegrees method of Math class. Basically we just convert the angle in radians from user input into degrees.

Sample Output :

Running the toDegrees(double angrad) method example source code of Math class will give you the following output

Exception Scenario :

N/A

Similar Method :

  • N/A

Suggested Reading List :

References :