When working with Three.js, I encountered a challenge involving 2 3D vectors and the need to determine the angle between them along both the x-axis and y-axis.
To calculate the x-axis angle, I used the following formula:
toDegrees(atan2(A.z, A.y) - atan2(B.z, B.y))
I found this solution on Stack Overflow, and it worked perfectly. However, when attempting to find the y-axis angle using:
toDegrees(atan2(A.z, A.x) - atan2(B.z, B.x))
I encountered an issue where it provided incorrect results. Does anyone know how to rectify this problem?
Many thanks in advance!