javascript find smallest difference between angles

Solutions on MaxInterview for javascript find smallest difference between angles by the best coders in the world

showing results for - "javascript find smallest difference between angles"
Alex
03 Mar 2016
1var x = Math.PI * 1.9;
2var y = Math.PI * 0.1;
3Math.atan2(Math.sin(x-y), Math.cos(x-y)); // -Math.PI * 0.2