Deutsches LiveCode Wiki
Advertisement

Returns the cosine of an angle (in radians).Syntax:

cos(<angle>)

Examples:

cos(pi)
the cos of 0
put cos(the startAngle of graphic 3) into field "Cosine"

Use the cos function to find the cosine of an angle.

The cos function repeats every 2*pi radians: cos(x) = cos(x

+ 2 * pi), for any value of x.


The cos function requires its input to be in radians. To provide an angle in degrees, use the following [[custom function]]:

   function cosInDegrees angleInDegrees
   return cos(angleInDegrees * pi / 180)
   end cosInDegrees


Parameters:

  • angle: A positive or negative number, or an expression that evaluates to anumber.
  • Returns: The cos function returns a number between -1 and 1.
Advertisement