SyntaxFix
Write A Post
Hire A Developer
Questions
You don't have to use atan2 to calculate the angle between two vectors. If you just want the quickest way, you can use dot(v1, v2)=|v1|*|v2|*cos A to get
dot(v1, v2)=|v1|*|v2|*cos A
A = Math.acos( dot(v1, v2)/(v1.length()*v2.length()) );