TITLE: How to compute the angle between two vectors expressed in the spherical coordinates?
QUESTION [13 upvotes]: Given two vectors $u, v \in \mathbb{R}^d$ represented the spherical coordinates is there a simple formula to compute the angle between the two vectors? Without loss of generality, we can assume that the vectors $u$ and $v$ have unit norm.
I am not sure that the following notation is standard, but I assume that the vector $u$ is defined with $\rho = 1$ and the angular components $\theta_1, \ldots, \theta_{d-1}$. We can obtain the Euclidean components as follows: $$u_{x_1} = \cos \theta_1$$ $$u_{x_2} = \sin \theta_1 \cos \theta_2$$ $$\ldots$$ $$u_{x_{d-1}} = \sin \theta_1 \ldots \sin \theta_{d-2} \cos \theta_{d-1}$$ $$u_{x_d} = \sin \theta_1 \ldots \sin \theta_{d-2} \sin \theta_{d-1}.$$
One way to find the angle is to represent the two vectors in the Euclidean coordinates and compute arccos of the dot product. Is there a simpler way?
As pointed out in comments, is there a generalization of the Haversine formula?

REPLY [3 votes]: Simple, alternative derivation of Ralf's formula, without the guesswork:
Angle between the vectors:
$$\alpha = \arccos\left({{u \cdot v}\over{|u|  |v|}}\right)$$
$$u \cdot v = \sum_i u_i v_i $$
in hyper-spherical coordinates (n+1 dimensions, hence n angles):
$$u_i(n) = |u| \cos(\theta_i) \prod_{j=1}^{i-1}{\sin(\theta_j)} $$
except when i=n:
$$u_n(n) = |u| \prod_{j=1}^{n}{\sin(\theta_j)} $$
and similar for v (I will use $\phi$ for the angles of v).
With unit vectors we combine the three formulae to: 
$$\cos(\alpha) = \sum_{i=1}^{n-1}{\cos(\theta_i)\cos(\phi_i) \prod_{j=1}^{i-1}{\sin(\theta_j)\sin(\phi_j)}} + \prod_{i=1}^{n}{\sin(\theta_j)\sin(\phi_j)} $$
which can be written as a recursive rule:
$$\cos(\alpha)_n = \cos(\theta_{n-1})\cos(\phi_{n-1}) \cos(\alpha)_{n-1} + \prod_{j=1}^{n}{\sin(\theta_j)\sin(\phi_j)} $$
Which is similar to what Ralf's answer contains (cos/sin switched).