swirl
Guide to OmniMark 7   OmniMark home
docs home 
IndexConceptsTasksSyntaxLibrariesLegacy LibrariesErrors
 
      Other Library Functions  
function  

atan2

 
 

Library: Math, trigonometry (OMTRIG)
Import: omtrig.xmd
Return type: OMX
Returns: 

Rectangular co-ordinates.


Declaration

  export external float function
       atan2 (value float x, value float y)


Purpose

Use atan2 with two rectangular co-ordinates, x and y, as arguments to calculate the arc tangent (y/x). atan2 gives you the degree in radians. This trigonometric function works in conjunction with hypot.

In mathematics, the arc tangent is also called the inverse tangent.

Out-of-range values, such as acos() and asin() for |x| > 1, return "not a number" (NaN).

Example:

  import "omtrig.xmd" unprefixed
  import "omfloat.xmd" unprefixed
  process
     local float x initial {1.1}
     local float y initial {0.7}
     local float atan2-value
     set atan2-value to atan2 (x, y)
     output "Take the rectangular co-ordinates x ( = "
         || "d" % x
         || " ) and y ( = "
         || "d" % y
         || " ) %n"
         || "Their arc tangent = "
         || "d" % atan2-value
         || "%n"
  ; Output: "Take the rectangular co-ordinates x ( = 1.1 ) and y ( = 0.7 )"
  ;          "Their arc tangent = 1.00406710927139"

        Other Library Functions
   acos
   asin
   atan
   atan2
   cos
   cosh
   hypot
   sin
   sinh
   tan
   tanh
 
 

Top [ INDEX ] [ CONCEPTS ] [ TASKS ] [ SYNTAX ] [ LIBRARIES ] [ LEGACYLIBRARIES ] [ ERRORS ]

OmniMark 7.1.2 Documentation Generated: June 28, 2005 at 5:44:58 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © Stilo Corporation, 1988-2005.