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

hypot

 
 

Library: Trigonometry (OMTRIG)
Import: omtrig.xmd
Return type: OMX

Returns: The hypotenuse.


Declaration

define external float function
  hypot (value float x, value float y)


Purpose

Use hypot to calculate the hypotenuse of a right triangle. This trigonometric function works the same way as its equivalent in the C math library.

Example:

The following example shows how to use the hypot function to make the calculation. The result is 7.07.

  import "omtrig.xmd" unprefixed
  import "omfloat.xmd" unprefixed
  process
     local float x
     local float y
     local float result
     set x to "5"
     set y to "5"
     set result to hypot(x,y)
     output "When the opposite side is "
        || "d" % x
        || " and the adjacent side is "
        || "d" % y
        || ",%n"
        || "the hypotenuse is "
        || "d" % result
        || "%n"
  ; Output: "When the opposite side is 5 and the adjacent side is 5,
  ;           the hypotenuse is 7.071067811865476"

        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.