I have been battling a problem of needing to know the derivative of the angle between two vectors, the vectors possibly being parallel at some points in time. I started off with:
$$\bf A \dot \bf B = \|A\|\|B\|\cos\theta \Rightarrow \theta=\arccos \left( \frac{\bf A \dot \bf B}{\|A\|\|B\|} \right)$$
Let's say that $\bf A$ and $\bf B$ are unit vectors for simplicity so:
$$ \theta=\arccos \left( \bf \hat A \dot \bf \hat B \right) $$
To find the derivative of the angle $\theta$:
$$ \dot \theta = \frac{-1}{\sqrt{1-\left(\bf \hat A \dot \bf \hat B\right)^2}} \left[\bf \dot{\hat A}\dot \bf \hat B+\bf {\hat A}\dot \bf \dot{\hat B}\right] $$
But, $\bf{\hat A} \dot \bf{\hat B}=$$1$ when $\bf \hat A \,\,\|\,\, \bf \hat B$ and the denominator of the expression for $\dot \theta$ becomes $0$. We hence get a division by $0$. Now I have tried other ways - by projecting $\bf{\hat B}$ onto $\bf{\hat A}$ and taking $\arctan$, by projecting $\bf{\hat B}$ onto a plane and forming a right-angle triangle and again taking $\arctan$. Every method I tried leads to the same singularity when $\bf \hat A \,\,\|\,\, \bf \hat B$.
Question: what method can I use such that I don't get a singularity for $\dot\theta$ when $\bf{\hat A}$ becomes parallel to $\bf{\hat B}$? Thank you!