function degrees_to_radians(degrees) { var pi = Math.PI; return degrees * (pi/180); } console.log(degrees_to_radians(45));