Skip to main content
Participant
October 9, 2008
Question

about calculate angle question thanks

  • October 9, 2008
  • 1 reply
  • 232 views
Hi
x = _xmouse;
y = _ymouse*-1;
angle = Math.atan(y/x)/(Math.PI/180);

any other method to calculate?
my math concept is poor......

thanks....
This topic has been closed for replies.

1 reply

Inspiring
October 9, 2008
I think you want the atan2 method:

var angle = Math.atan2(y, x) * (180 / Math.PI);

--
Dave -
www.offroadfire.com
Head Developer
http://www.blurredistinction.com
Adobe Community Expert
http://www.adobe.com/communities/experts/