acos()

Declaration

double acos(double dX);

Description:

This function returns the inverse cosine of the passed-in argument.

Overloads

float acos(float);
double acos(double);
long double acos(long double);

Related Functions

float acosf(float);
long double acosl(long double);

* Note: Since C does not allow function overloading, these other versions of this function exist.

Domain

[-1.0, 1.0]

Range

[0, Π]

Periodicity

None

Symmetry

None

Asymptotes

None





Example

#include <iostream>
#include <cmath>

int main() {
    using namespace std;

    double dX = -.4;
    cout << "x = " << dX << "  acos(x) = " << acos(dX) << endl;

    dX = 0.8;
    cout << "x = " << dX << "  acos(x) = " << acos(dX) << endl;

    return 0;
}

Output:

acos() Output