Java tutorial
//package com.java2s; public class Main { public static int absDirectionDiff(int a, int b) { // ABS(180 - ABS(180- ABS(A - B))) return Math.abs(180 - Math.abs(180 - Math.abs(a - b))); } }