# Object rotating around another

**URL:** <https://forum.kirupa.com/t/object-rotating-around-another/190420>\
**Category:** Uncategorized\
**Created:** [June 11, 2006, 4:47pm UTC](https://forum.kirupa.com/t/object-rotating-around-another/190420 "2006-06-11T16:47:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErikHK](https://avatars.discourse-cdn.com/v4/letter/e/3d9bf3/32.png) [@ErikHK](https://forum.kirupa.com/u/ErikHK)\
**Post date:** [June 11, 2006, 4:47pm UTC](https://forum.kirupa.com/t/object-rotating-around-another/190420/1 "2006-06-11T16:47:23Z")

</div>

I have made a little flash script where an object is “rotating” around another, so that it is always pointing towards the object in the middle, you can try it here: [http://dump.erikhk.net/files/golftest2.swf , and the src: [URL=“http://dump.erikhk.net/files/golftest2.fla”]http://dump.erikhk.net/files/golftest2.fla](http://dump.erikhk.net/files/golftest2.swf) , but the object is lagging when moved through the -90 and 90 zone, how can I avoid that?

EDIT: It seems that I have invert two of the quadrants in a better way that I am doing, how can I do that in a good way?

EDIT2: Math.atan2(dx,dy) \* (180/Math.PI) did the job, problem solved 🙂
