Find rotation angle between 2 vectors 3D

Hi,
how to calculate the rotation angle (yow, pith, roll) between tow vector 3D

I would suggest using Quaternion.FromUnitVectorsToRef(vecFrom, vecTo, result) to get the rotation quaternion between them that you could convert to a euler angle with toEulerAnglesToRef.

You can’t compute roll between 2 vectors. there is an infinite number of roll angles that will produce the same transformation.
But you can compute an axis and rotation angle. Axis is the cross product of vectors. Angle is the dot product.

1 Like

Have a look here - the cross product and dot product may be enough for your application:

1 Like