[Math] Error propagation of angle between vectors

error-propagationgeometrylinear algebravector analysis

Say $a$ and $b$ are vectors (say in $\mathbb{R}^2$) and $\alpha$ is the angle between $a$ and $b$, say defined as $\alpha:= arcos(\frac{ab}{|a||b|})$.

Question

If one shakes $a$ and $b$, then how much shakes alpha?
In other words, if $a$ and $b$ have additional error information, how are these errors propagated to $\alpha$?

Example

Say $a$ and $b$ are averages of independent, normally distributed point clouds $A$ and $B$ and errors are given by standard deviations for each dimension of $a$ and $b$.

Best Answer

If I may restate your problem, you have an angle formed by two vectors $\vec a$ and $\vec b$ constrained to $\mathbb R^2$, and whose components $a_x,a_y$ and $b_x,b_y$ are all normally distributed variables each with known means and standard deviations.

$$ \alpha=\cos^{-1}\Bigg(\frac{a_xb_x+a_yb_y}{\sqrt{(a_x^2+a_y^2)(b_x^2+b_y^2)}}\Bigg) $$

The standard deviation of the angle is then given by

$$ \sigma_\alpha = \sqrt{ \Big(\frac{\partial \alpha}{\partial a_x}\Big|_{\mu} \sigma_{a_x}\Big)^2 + \Big(\frac{\partial \alpha}{\partial a_y}\Big|_{\mu} \sigma_{a_y}\Big)^2 + \Big(\frac{\partial \alpha}{\partial b_x}\Big|_{\mu} \sigma_{b_x}\Big)^2 + \Big(\frac{\partial \alpha}{\partial b_y}\Big|_{\mu} \sigma_{b_y}\Big)^2 } $$

where the subscript $\mu$ implies that the partial derivatives must be evaluated at the (known) mean values of $a_x,a_y$, $b_x$, and $b_y$.