Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- CA-Clipper Tools . Books 1-3 - <b>atn2()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 ATN2()
 Computes the angle size from the sine and cosine
------------------------------------------------------------------------------
 Syntax

     ATN2(<nSine>,<nCosine>) --> nArc

 Arguments

     <nSine>  Designates the sine value for an angle.

     <nCosine>  Designates the cosine value for an angle.

 Returns

     ATN2() returns the angle sine in radians.

 Description

     ATN2() returns the angle sine in radians, where the sine and the cosine
     of a given point have been specified.  The function returns results for
     all four quadrants and corresponds to a call of ATAN(x/y).  One
     advantage of the ATN2() function is that no "divide by zero" error can
     occur.  The returned value is in the range of -pi to +pi.

 Note

     .  The SETPREC() function can influence the precision of the
        result.

 Examples

     .  Compute the sine and cosine of 30 degrees.  DTOR() is then
        used to convert these into the radian value:

        SET DECIMALS TO 4
        X  :=  SIN(DTOR(30))
        Y  :=  COS(DTOR(30))

     .  Use RTOD() to compute the result in degrees:

        ? RTOD(ATN2(x, y))         // 30.0000


See Also: ASIN() ACOS() ATAN() DTOR() RTOD() SETPREC() SIN() TAN()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson