A Better ATan2

by Matt Wolffe

ATan2 is simply an arctangent function modified to return an angle in any quadrant. Most ATan2 calculators return angles from ( π , π ] , which, in my opinion, is not as useful as returning an angle between [ 0,2 π ) .

Most calculators are also restricted to radians, and while the conversion to another unit is not difficult, why not just provide the option to choose from a list of 16 units? Some standard, some 'obscure'!

Definition

aTan2 ( x , y ) = { arctan ( y x ) x > 0  and  y 0 arctan ( y x ) + 2 π x > 0  and  y < 0 arctan ( y x ) + π x < 0 π 2 x = 0  and  y > 0 3 π 2 x = 0  and  y < 0 undefined x = 0  and  y = 0

Instructions

  1. Enter x-coordinate value
  2. Enter y-coordinate value
  3. Select a unit from the drop-down
  4. Click "Calculate!"
  5. Revel in the fact you saved however long it would have taken to find the angle manually!





Retain Previous Outputs?