Search Tutorials
var dy = _ymouse-arrow._y; var dx = _xmouse-arrow._x; this takes y/x values and substracts them to make the legs of a triangle. var radians = Math.atan2(dy, dx); Arctanget is the opposite of tangent which is triganometry if you dont know it is not a big deal right now. buy it takes the ratio of the values and divides them i believe(not 100% sure) you can also use var radians = Math.atan(dy / dx); and it would be the same. but that make a radian value.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|