ACOS()

Arcus cosine of the argument

Syntax

ACOS (nCosine) -> nRadiant

Arguments

<nCosine> the cosine of an angle

Returns

<nRadiant> the angle whose cosine is <nCosine>

Description

The function ACOS() is the inverse function of COS(). It takes a cosine value and returns the smallest(!) angle whose cosine equals to the argument. The return value is given in radiants (full angle equals 2*Pi - see DTOR() if you need to convert it into degress). Note, that <nCosine> must be between -1 and 1 and that <nRadiant> is always between 0 and PI().
Examples
      ? acos (0.0) --> PI()/2
      ? acos (0.5) --> 1.04719...
Tests
      acos (0.0) == PI()/2
      acos (sqrt(1/2)) == PI()/4
      acos (1.0) == 0.0
      acos (-1.0) == PI()
      acos (0.0) == PI()/2  // and not -PI()/2, although cos (-PI()/2) == 0.0 !
Status

Ready

Compliance

ACOS() is compatible with CT3's ACOS().

Platforms

All

Files

Source is trig.c, library is libct.

See Also