acos
Inverse cosine of each element, with the result in radians.
Category: Mathematics > Elementary Math
Syntax
Y = acos(X)
Returns the result for each element of X.
Description
acos works element by element. For real input in [-1, 1] the result lies in [0, pi]. For real input outside that interval the result is complex. The result is the angle whose cosine is X, so cos(acos(X)) returns X (up to rounding).
Input arguments
X- Numeric array of any size. Complex values are allowed.
Output arguments
Y- Array of the same size as
X, in radians.
Example
Arc cosine
acos([1 0.5 0 -1])
acos(2)
Output
ans = 1×4
0 1.0472 1.5708 3.1416
ans = 0.0000 + 1.3170i