Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

cos() function in C++ | What is cos() Function?

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



This post first appeared on Programming Explain, please read the originial post: here

Share the post

cos() function in C++ | What is cos() Function?

×

Subscribe to Programming Explain

Get updates delivered right to your inbox!

Thank you for your subscription

×