Math.Acos() is an inbuilt Math class method which returns the angle whose cosine is given as a double value argument. If the argument is
NaN, then the result will be
NaN.
Syntax:
public static double Acos(double num)
Parameter:
num: It is the number that represents cosine and type of this parameter is System.Double. It must be greater than or equal to -1, but less than or equal to 1.
Return Type: Returns an angle Θ, measured in radians and its type is
System.Double. Here the angle is always measured in radians, such that 0 ≤ Θ ≤ π.
Note: If the value of the num is greater than 1 or less than -1 or equals to
NaN, then this method always returns
NaN as result. To convert the radians(return value) to degrees
multiply it by 180 / Math.PI.
Examples:
Input : Math.Acos(2)
Output : NaN
Input : Math.Acos(0.3584)
Output : 1.20424285296577
Input : Math.Acos(0.0)
Output : 1.5707963267949
Input : Math.Acos(-0.0)
Output : 1.5707963267949
Input : Math.Acos(Double.PositiveInfinity)
Output : NaN
Input : Math.Acos(Double.NegativeInfinity)
Output : NaN
Program: To illustrate the Math.Acos() method
Output:
NaN
NaN
1.20424285296577
90
1.5707963267949
NaN
NaN
NaN
Reference: https://learn.microsoft.com/en-us/dotnet/api/system.math.acos?redirectedfrom=MSDN#System_Math_Acos_System_Double_