Math.atan2 and zeros



2 Comments

Share




Keep in mind that


trace(0 === -0);			// true
trace(Math.atan2(0, 0));	// 0
trace(Math.atan2(0, -0));	// 3.141592653589793
trace(Math.atan2(-0, -0));	// -3.141592653589793

function posZero(n:Number) { if(n === 0) return Math.abs(n); }