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