Calculating pitch angle from roll angles.

anglerotationstrigonometry

Good day, I am currently busy with a project on the general Gay-Berne potential. In this equation we make use of the rotation transformation matrix $R_\text{roll}R_\text{pitch}R_\text{yaw}$, where $R_i$ is a rotation around the $i^\text{th}$ axis. The script that one of my supervisor's students gave me uses yaw, pitch and roll angles, where it defines each angle as:

yaw$_A$=0.0

yaw$_B$=0.0

roll$_A$ = cos($\theta_A$)-$\frac{\pi}{2}$

roll$_B$ = cos($\theta_B$)-$\frac{\pi}{2}$

pitch$_A$ = 0.0

pitch$_B$ = arccos$\left(\frac{cos(\phi)}{cos(\theta_A)cos(\theta_B)} – 1\right)$

Here, A and B are two homogeneous objects, $\theta_A$ is the angle between the unit vector of A and the distance vector between A and B, $\theta_B$ is the angle between the unit vector of B and the distance vector between A and B, and finally $\phi$ is the angle between unit vectors A and B. I have attached an image to make these angles make more sense.

$\theta$ and $\phi$ angle image

What does not make sense to me is how pitch$_B$ is calculated. Obviously there's the case that what if both $\theta$ angles are $\pi/2$, then the pitch will be arccos$\left(\frac{cos(\phi)}{0\times{0}}-1\right)$. The script then makes the pitch in such a case 0.0, which ends up being highly problematic later on.

I have asked the student why the angle is calculated in such a way, but she does not know. She said she got it from another student, but I cannot get into contact with him.

Do any of you perhaps have a suggestion on how I can calculate the second pitch angle? You could just refer me to a paper as well.

Kind regards.

Best Answer

I managed to fix the problem, but I'm not allowed yet to post anything about it. It is possible.