102
Java Math.toDegrees() method
The java.lang.Math.toDegrees() is a built-in math function in java which is used to convert an angle measured in radians to an approximately equivalent angle measured in degrees.
Syntax
Parameter
Return
- If the argument is NaN, this method will return NaN.
- If the argument is zero, this method will return zero with the same sign as the argument.
- If the argument is infinity, this method will return infinity with the same sign as the argument.
Example 1
Output:
180.0
Example 2
Output:
90.0
Example 3
Output:
-Infinity
Example 4
Output:
0.0
Next TopicJava Math