Share this page

# cos

Mathematics Functions

Computes the cosine of an angle in radians.

    double cos( double x);

x | An angle expressed in radians. (180 degrees = PI radians)

## Return Values

The cosine of the specified angle.

## Example

The following example calculates the cosine of 45 degrees using cos.

Copy code

        #include <math.h>

        double cos(double x);
        double x = 45;
        lr_output_message ("Cosine of %lf deg = %lf", x, cos(x * PI/180));

    Example: Output:
    Action.c(9): Cosine of 45.000000 deg = 0.707107

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: