Difference Between Two Angles AS3 Function

16 Useful AS3 Mathematical Formulas be listed in previous articles. Belew is an Actionscript 3.0 function difference between two angles:


protected function getAnglesDiff(alfa : Number, gamma : Number) : Number {
var dif : Number = (alfa – gamma) % 360;

if (dif != dif % 180) {
dif = (dif < 0) ? dif + 360 : dif - 360; } return dif; }

Leave a Reply

Your email address will not be published. Required fields are marked *