Home >>Java Math Methods >Java Math.toRadians() method
Java Math.toRadians() in Java Math is used to an integrated math function in java that is used to convert an angle measured in degrees to an approximately equivalent angle measured in radians.
public static double toRadians(double x)
x = This parameter is used for an angle, in degrees
It is used to returns the measurement of the angle x in radians.
public class MyClass
{
public static void main(String[] args)
{
double a = 45.0;
System.out.println(Math.toRadians(a));
}
}
public class MyClass
{
public static void main(String[] args)
{
double a = Double.MAX_VALUE;
System.out.println(Math.toRadians(a));
}
}