Algosim documentation: cos

cos

The trigonometric cosine function.

Syntax

Description

Image 1

If x is a real number, cos(x) is the x coordinate of the intersection of the unit circle x^2 + y^2 = 1 and the ray from the origin making an angle x (in radians) from the positive x axis in the anticlockwise direction.

If z is a complex number, cos(z) is defined as [e^(i⋅z) + e^(−i⋅z)]/2.

Notes

If you want to specify the argument in degrees, you can use the ° postfix operator, which amounts to multiplication by π/180.

Examples

cos(0)
1
cos(π/2)
0
cos(180°)
−1
cos(i)
1.54308063482

See also