Function reference · Trigonometry

cos

Returns the cosine of an angle in radians.

Exact values come out at multiples of π/6, π/4 and π/3; other angles stay as they are until you evaluate them.

cos(-x) simplifies to cos(x), and cos(acos(x)) to x.

Notation

cos(x)

Write it in an expression: nerdamer('cos(pi/3)'), or in the Playground.

nerdamer.cos

nerdamer.cos(x: ExpressionInput): Expression

A method on the default import. Arguments can be strings, as in Notation.

Examples

A special angle.

cos(pi/3)
// → 1/2
Open in Playground

cos(π) is -1.

cos(pi)
// → -1
Open in Playground

Cosine is even.

cos(-x)
// → cos(x)
Open in Playground

Cosine undoes arccosine.

cos(acos(x))
// → x
Open in Playground

Not a special angle: stays exact.

cos(pi/12)
// → cos((1/12)*pi)
Open in Playground

← Back to Function reference