Skip to content
Vašek edited this page Jan 13, 2019 · 6 revisions

cos

Returns the cosine of value in radians

Syntax:

cos(x)
Argument Description
double x The angle in radians to cosine

Returns: double

Description:

In a right angled triangle cos(x) = Adjacent / Hypotenuse. If you want to use degrees instead of radians use function dcos().

Example:

double x;
double value;
if (cos(x) == 1){
    value = 1;
}

This code will set value to 1, if the angle x is equal to 0 or pi radians.

Back to number_functions

Clone this wiki locally