C cos() function
C cos() function - arc cosine functions
Syntax:
double cos(double x)
The cos() function is used to calculate the cosine of x. The value x is expressed in radians. If x is too large, a partial loss of significance in the result might occur.
Parameters:
Name | Description | Required /Optional |
---|---|---|
x | Represent an angle expressed in radians. | Required |
Return value from cos()
- The function returns the cosine of x.
Example: cos() function
The following example shows the usage of cos() function.
Output:
cos( 0.000000 ) = 1.000000 cos( 1.000000 ) = 0.540302 cos( 45.000000 ) = 0.525322
C Programming Code Editor:
Previous C Programming: C atan2()
Next C Programming: C cosh()