Here you can find the source of toRadians(double degrees)
public static double toRadians(double degrees)
//package com.java2s; //License from project: Open Source License public class Main { public static double toRadians(double degrees) { return Math.toRadians(wind(degrees, 360)); }//from w w w. j ava2 s. co m /** * Wind the given number into the interval [0, intervalEndExclusive) * @param d * @param intervalEndExclusive * @return */ public static double wind(double d, double intervalEndExclusive) { return d - intervalEndExclusive * (Math.floor(d / intervalEndExclusive)); } }