What is cos() Function?
The cos() function is used to find the trigonometric cosine of a given angle. The angle is given in radian as a real number. The declaration of cos() function is as follows:double cos (double);
The declaration of cos() function indicates that a single parameter of "double" type is passed to this function. The output returned by cos() function is also of "double" type.The general syntax to call the cos() function is as follows:
var = cos(x);
In the above syntax:-x
It indicates the angle in radian. It may be a variable, a constant or an expression.y
It indicates the variable into which the returned value is to be assigned.For example, if x = 0.0, then cos(x) will return 1.0