$cos

Calculates the cosine of a number.

Syntax

$cos(number)

Parameters

number

a number, or an expression that evaluates to a number

Return Value

Number, with the same number of decimal places as number.

Comments

The value returned by this function has the same number of decimal places as number. Ensure that you specify enough decimal places in your equation to ensure a sufficiently granular result. Unusual results such as
-0 are an indication that the number of decimal places needs to be increased. For example, if you enter

$cos(2)

without any decimal points, you receive the result

-0

However, if you enter

$cos(2.0000)

you receive the result

-0.4161

Example

$cos(0)

Evaluates to 1.

let var1 = 3.14
let var2 = $cos(0.50*var1)

Var2 evaluates to 0.00.

 

Related Topics