Direction formula?
I was wondering if anyone has any information on how to calculate the angle at which to rotate an object based on an x,y set of information?
Ie:
A circle has a point on it that I want to face the mouse. I have the x,y of the circle, and the x,y of the mouse. How can I figure the angle at which to rotate the circle?
Ie:
A circle has a point on it that I want to face the mouse. I have the x,y of the circle, and the x,y of the mouse. How can I figure the angle at which to rotate the circle?
Code:
atan2(mousey  circley, mousex  circlex)
Scott Lembcke  Howling Moon Software
Author of Chipmunk Physics  A fast and simple rigid body physics library in C.
Thank you very much!
Possibly Related Threads...
Thread:  Author  Replies:  Views:  Last Post  
Formula for converting angle to vector?  komirad  2  13,325 
Jul 29, 2011 07:29 AM Last Post: ThemsAllTook 

Direction of normal  Miglu  3  4,755 
Oct 4, 2010 05:08 PM Last Post: Skorche 

Fast Distance formula?  mikey  11  10,984 
Nov 23, 2009 10:43 AM Last Post: mikey 

Mathmatical formula for integer checking  Jones  12  8,768 
Jan 24, 2006 01:58 AM Last Post: zKing 