<?php function diff($this, $that){ $diff = $this-$that; while($diff < -180) $diff += 360; while($diff > 180) $diff -= 360; echo rad2deg($diff).PHP_EOL; } diff(359,1);//2 diff(-90,90); //180
You have javascript disabled. You will not be able to edit any code.