CalcCos
CalcCos
CalcCos[ x ] calculates the cosine of a number as a decimal number.
CalcCos[ x ]
CalcCos[ x ] calculates the cosine of x radians as a decimal number. x must be a decimal number such as 0.5; whole numbers and exact values such as Pi are not calculated (see the warning below).
| Example | in | out |
|---|---|---|
| A decimal number of radians. | CalcCos[ 0.5 ] |
0.87758256189 |
| Each element of a list. | CalcCos[ {0.5, 1.5} ] |
{0.87758256189, 0.070737201668} |
CalcCos[ x, Variant=>'deg' ] or CalcCos[ Quantity[x, 'deg'] ]
With the option Variant=>'deg', or with an angle in degrees, x is in degrees. Whole numbers are calculated too.
| Example | in | out |
|---|---|---|
| An angle in degrees. | CalcCos[ 60, Variant=>'deg' ] |
0.5 |
| A quantity in degrees. | CalcCos[ Quantity[60, 'deg'] ] |
0.5 |
Variant
'deg' for an angle in degrees. Default: radians.
| Syntax | Example | out |
|---|---|---|
CalcCos[ x, Variant=>'deg' ] |
CalcCos[ 60, Variant=>'deg' ] |
0.5 |
- Rounding errors are removed:
CalcCos[ Quantity[90, 'deg'] ]is displayed as . - Variables:
CalcCos[ x ]with a variablexis left unevaluated.
In radians, CalcCos only calculates decimal numbers with a fractional part. CalcCos[ 1 ], CalcCos[ 1.0 ] (which counts as the whole number 1) and CalcCos[ Pi ] are left unevaluated. Use Numerical to calculate them: Numerical[ CalcCos[1] ]. For exact values, such as the cosine of Pi, use the function itself with Simplify.
See also: Numerical, Math functions, Quantity