[<<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()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson