Contents
What is the angle between the two vectors?
“Angle between two vectors is the shortest angle at which any of the two vectors is rotated about the other vector such that both of the vectors have the same direction.” Furthermore, this discussion focuses on finding the angle between two standard vectors, which means their origin is at (0, 0) in the x-y plane.
How do you find the angle between two vectors A and B?
An easier way to find the angle between two vectors is the dot product formula(A.B=|A|x|B|xcos(X)) let vector A be 2i and vector be 3i+4j. As per your question, X is the angle between vectors so: A.B = |A|x|B|x cos(X) = 2i.
What is the identity quaternion?
Quaternion.identity” is the “default” or none value to the objects rotation. By setting the rotation of the new object to this value it ensures that the new object will be in it’s “natural” orientation.
How to find a quaternion representing the rotation from?
One solution is to compute a vector half-way between u and v, and use the dot and cross product of u and the half-way vector to construct a quaternion representing a rotation of twice the angle between u and the half-way vector, which takes us all the way to v!
How to represent the rotation from U to V?
One rotation from u to v would be a pi / 2 rotation around the z-axis. Another rotation from u to v would be a pi rotation around the vector <1, 1, 0>. Why not represent the vector using pure quaternions?
When to multiply the difference between the two quaternions?
This method above works only when the difference takes place in only one axis. When one portal will be on the floor, or on te ceiling, this will not work because the difference quaternion is build in more than one axis. As suggested I tried to multiply P1’s quaternion to P2’s quaternion, and inversely but this isn’t working.
How to find the inverse of a quaternion diff?
If you want to find a quaternion diff such that diff * q1 == q2, then you need to use the multiplicative inverse: If your quaternions are rotation quaternions, they should all be unit quaternions. This makes finding the inverse easy: since abs (q1) = 1, your inverse (q1) = conjugate (q1) can be found by just negating the i, j, and k components.