The java.lang.StrictMath.toRadians() method of StrictMath class in Java is used to accept an angle measured in degrees as a parameter and returns its approximately equivalent angle measured in radians. So basically it converts degree to radians. This conversion is generally inexact.
public static double toRadians(double deg)
Parameters: This function accepts a single parameter deg which refers to an angle in degrees which is to be converted to its equivalent radians.
Return Values: This method returns the measurement of the angle passed as a parameter, in radians.
Input : 120 Output : 2.0943951023931953 Input : 0.00087104 Output : 1.5202515916571408E-5
Below programs illustrate the java.lang.StrictMath.toRadians() method in Java :
Value in radian of 108.478 degrees is 1.8932982659784086
Value in radian of 360.0 degrees is 6.283185307179586
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.