Version 2 of atan2

Updated 2002-05-21 13:06:16

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.


atan2 is also available as a command in Tclx.


Category Mathematics