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

atan2

 
 

Library: Trigonometry (OMTRIG) legacy
Include: omtrig.xin
Return type: OMX

Returns: Rectangular co-ordinates.


Declaration

define 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:

  include "omtrig.xin"
  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 ] [ LEGACY LIBRARIES ] [ ERRORS ]

OmniMark 8.2.0 Documentation Generated: March 13, 2008 at 3:27:39 pm
If you have any comments about this section of the documentation, please use this form.

Copyright © Stilo International plc, 1988-2008.