[Math] How to computer two Euler Angles between two vectors

3danglematricesvectors

I have looked on here for an answer to my question however the answers I found were how to find the actual angle and not broken down into theida and phi so here is my question:

If I have two vectors a and b how can I calculate the two Euler angles between them?

I do know the total angle is found by:

=arccos(Re(a⋅b)∥a∥∥b∥)

What I am looking for is this scenario:

enter image description here

where the red line is vector a and the purple line is vector b. The angle between them can be broke up onto the two planes. Those two angles are what I am trying to find.

Best Answer

So given vector A = (2i,4j,5k) and vector B = (1i,3j,8k)

my theida (as shown in image above) would be:

cos(theida) = ((Ai,Ak) ⋅ (Bi,Bk)) / (||Ai,Ak|| * ||Bi,Bk||)

Therefore,

cos(theida) = (2*1) + (5*8) / (sqrt(2^2 + 5^2) * sqrt(1^2+8^2))

theida = acos(42/(sqrt(29)*sqrt(65)))

theida = 14.68 deg

and similarly:

cos(phi) = ((Ai,Aj) ⋅ (Bi,Bj)) / (||Ai,Aj|| * ||Bi,Bj||)

Therefore,

cos(phi) = (2*1) + (4*3) / (sqrt(2^2 + 4^2) * sqrt(1^2+3^2))

phi= acos(14/(sqrt(20)*sqrt(10)))

phi= 8.13 deg