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
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week