cos

function

Library: Trigonometry (OMTRIG)
Import : omtrig.xmd

Returns: The cosine of a floating point number.


Declaration
export external float function
     cos value float x


Purpose

Use cos to calculate the cosine of an angle in radians. The angle must be a floating point number. This trigonometric function works the same way as its equivalent in the C math library.

Example:


  import "omtrig.xmd" unprefixed
  import "omfloat.xmd" unprefixed
  process
     output "Cosine of x, where x = (pi * 2), is "
         || "d" % cos (pi * 2)
         || "%n"
  ; Output: "Cosine of x, where x = (pi * 2), is 1"

Other Library Functions