Main Content

acosd

Inverse cosine in degrees

Description

Y = acosd(X) returns the inverse cosine (cos-1) of the elements of X in degrees. The function accepts both real and complex inputs.

  • For real values of X in the interval [-1, 1], acosd(X) returns values in the interval [0, 180].

  • For values of X outside the interval [-1, 1] and for complex values of X, acosd(X) returns complex values.

example

Examples

collapse all

Verify that inverse cosine of 0 is exactly 90.

acosd(0)
ans = 
90

Show that the inverse cosine, followed by cosine, returns the original values of X.

cosd(acosd([2 3]))
ans = 1×2

     2     3

acosd([2 3]) returns two complex angles, which are then passed to the cosd function. cosd returns the original values, 2 and 3.

Input Arguments

collapse all

Cosine of angle, specified as a real-valued or complex-valued scalar, vector, matrix, multidimensional array, table, or timetable. The acosd operation is element-wise when X is non-scalar.

Data Types: single | double | table | timetable
Complex Number Support: Yes

Output Arguments

collapse all

Angle in degrees, returned as a real-valued or complex-valued scalar, vector, matrix, multidimensional array, table, or timetable of the same size as X.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

GPU Code Generation
Generate CUDA® code for NVIDIA® GPUs using GPU Coder™.

Version History

Introduced before R2006a

expand all

See Also

| |