Here you can find the source of angleDiff(double alpha, double beta)
public static double angleDiff(double alpha, double beta)
//package com.java2s; //License from project: LGPL public class Main { public static double angleDiff(double alpha, double beta) { double angleDiff = alpha - beta; return ((((angleDiff) % (2 * Math.PI)) + (3 * Math.PI)) % (2 * Math.PI)) - Math.PI; }/* ww w . j a v a 2s . com*/ }