how-to

Math

How to convert degrees to radians and back

Example uses static methods of class java.lang.Math:

/* -- to radians */

double degrees = 350.0;

double radians = Math.toRadians( degrees );

System.out.println( radians );

/* -- back */

degrees = Math.toDegrees( radians );

System.out.println( degrees );

Output is:

6.1086523819801535
350.00000000000006