static double angleShortestDistance(double from, double to) { return ((to - from) + 180) % 360 - 180; }