cos

Typefunction
DictionaryLCS
LibraryLiveCode Script
Syntax
the cos of <angle>
cos(<angle>)
Summary

Returns the cosine of an angle (in radians).

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Parameters
NameTypeDescription
angle

A positive or negative number, or an expression that evaluates to a number.

Example
cos(pi)
the cos of 0
put cos(the startAngle of graphic 3) into field "Cosine"
Values
NameTypeDescription
return

The cos function returns a number between -1 and 1.

RelatedConstant: pi
Glossary: function, radian, custom function, return, degree
Description

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

Tagsmath