Version 1 of atan2

Updated 2001-12-15 11:31:01

Purpose: Help on the math function 'atan2'.


The call

    [expr { atan2( $x, $y ) }]

returns the inverse tangent (expressed in radians) of the quantity,

    ( $x / $y )

It never divides by zero, and is careful about the quadrant of the result (which conventional atan() can't be, since the division prior to feeding the quotient into atan() would lose information about which, if any, of $x and $y are negative. In practise, this doubles the range of the result.)


The commonest use of [atan2] is in Converting between rectangular and polar co-ordinates.


Category Mathematics