C++ Math acos()This function computes the inverse cosine of a number in radian. acos(x) = cos -1x SyntaxSuppose a number is x. Syntax would be: Note: If the value passed is an integer type, then it is cast to double.Parameterx: The value whose arc cosine is to be calculated. It should be in the range[-1,1]. Return value
Example 1Let's see the simple example when the value of x is greater than 1. Output: Value of cosine is :0.000796274 Inverse of cosine is :nan In this example, acos() function calculates the inverse cosine of a number when the value of x is greater than 1. Example 2Let's see the simple example when the value of x is equal to zero. Output: Value of cosine is :1 Inverse of cosine is :1.5708 In this example, acos() function calculates the inverse cosine of a number when the value of x is equal to zero. Example 3Let's see the simple example when the value x is less than -1. Output: Value of cosine is :0.50046 Inverse of cosine is :nan In this example, acos() function calculates the inverse cosine of a number when the value of x is less than -1. Next TopicC++ Math Functions |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India