public static int getHeadingDifference(int heading1, int heading2){
		int result = heading1 - heading2;

		if(result < -180)
			return 360 + result;
		if(result > 180)
			return 0 - (360 - result);
		return result;
	}