Rubi Reid

2022-03-15

When working with spherical coordinates I have come across
${\mathrm{cos}}^{-1}\left(\mathrm{cos}\left(a\right)×\mathrm{cos}\left(b\right)\right)$
and was wondering if there was some kind of identity for this that I could use instead of computing the inside of the acrccos function first.

### Answer & Explanation

The problem with $\mathrm{cos}\left(x\right)$ is that near . Thus ${\mathrm{cos}}^{-1}\left(x\right)$ loses accuracy near x=1. An equivalent formula without such accuracy loss is the following:
${\mathrm{cos}}^{-1}\left(\mathrm{cos}\left(a\right)\mathrm{cos}\left(b\right)\right)=2{\mathrm{sin}}^{-1}\left(\sqrt{\mathrm{sin}\left(a\right)\frac{\mathrm{sin}\left(b\right)}{2}+{\mathrm{sin}}^{2}\left(\frac{a+b}{2}\right)}\right)$
Notice that near .Thus for x small enough, $\mathrm{sin}\left(x\right)\approx x$ and we can use the simple approximation ${\mathrm{cos}}^{-1}\left(\mathrm{cos}\left(a\right)\mathrm{cos}\left(b\right)\right)\approx \sqrt{{a}^{2}+{b}^{2}}$. Notice that in a spherical right triangle with legs a,b and hypoteneuse c, the formula $\mathrm{cos}c=\mathrm{cos}a\mathrm{cos}b$ holds and if the triangle has small enough sides, the Pythagorean approximation ${c}^{2}\approx {a}^{2}+{b}^{2}$ holds.

Do you have a similar question?

Recalculate according to your conditions!