I understand that:
atan2(vector.y, vector.x)
= the angle between the vector and the X axis.
But I wanted to know how to get the angle between two vectors using atan2. So I came across this solution:
atan2(vector1.y - vector2.y, vector1.x - vector2.x)
My question is very simple:
Will the two following formulas produce the same number?
atan2(vector1.y - vector2.y, vector1.x - vector2.x)
atan2(vector2.y - vector1.y, vector2.x - vector1.x)
If not: How do I know what vector comes first in the subtractions?
Thanks
End - Start = Vector
so thatStart + Vector = End
\$\endgroup\$atan2(fromAtoB.y, fromAtoB.x) - atan2(velocityA.y, velocityA.x)
\$\endgroup\$