arccos
Compute arccosine of a given argument
arccos(x);
will return the arccosine of an argument, returned in degress in radians. There is no custom return type, the function always returns an double.
arccos(1); //0°
arccos(0.866); //PI/6 or 30°
arccos(0.707); //PI/4 or 45°
arccos(0.5); //PI/3 or 60°
arccos(0); //PI/2 or 90°
arccos(-1); //PI or 180°
The argument domain is [-1, 1]. If x is outside the range, the compiler throws:
"Error: arccos is undefined for values outside the domain range [-1, 1]."
Last updated