Java Math toDegrees() Method
Example
Convert radians to degrees for different angles:
System.out.println(Math.toDegrees(1));
System.out.println(Math.toDegrees(Math.PI));
System.out.println(Math.toDegrees(Math.PI / 4));
System.out.println(Math.toDegrees(-0.5236));
System.out.println(Math.toDegrees(6));
Definition and Usage
The toDegrees()
method converts an angle from radians to degrees.
Tip: To convert from degrees to radians, look at the toRadians() method.
Syntax
public static double toDegrees(double angle)
Parameter Values
Parameter | Description |
---|---|
angle | Required. An angle in radians. |
Technical Details
Returns: | A double value representing an angle in degrees. |
---|---|
Java version: | 1.2+ |
❮ Math Methods