# Finding degrees

**URL:** <https://forum.kirupa.com/t/finding-degrees/185902>\
**Category:** flash\
**Created:** [April 17, 2006, 4:22pm UTC](https://forum.kirupa.com/t/finding-degrees/185902 "2006-04-17T16:22:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![theHollow](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thehollow/32/106_2.png) [@theHollow](https://forum.kirupa.com/u/theHollow)\
**Post date:** [April 17, 2006, 4:22pm UTC](https://forum.kirupa.com/t/finding-degrees/185902/1 "2006-04-17T16:22:51Z")

</div>

I’m having real trouble with this. I have a central movieclip named circle1\_mc and a smaller movieclip above and a bit to the left of it named circle2\_mc. I want to find the degree circle2\_mc is at from the centre of circle1\_mc. For example, 0 degrees would be directly above circle1\_mc’s x and y coordinates. Any help would be appreciated.

Brendan.

---

<div class="post-metadata">

**Author:** ![B\_L\_U\_E](https://avatars.discourse-cdn.com/v4/letter/b/ba8739/32.png) [@B\_L\_U\_E](https://forum.kirupa.com/u/B_L_U_E)\
**Post date:** [April 17, 2006, 4:44pm UTC](https://forum.kirupa.com/t/finding-degrees/185902/2 "2006-04-17T16:44:31Z")

</div>

This may be way off, but just mess around with it.  
[AS]getDegree = function(mc1:MovieClip, mc2:MovieClip):Number {  
vy = Math.abs(mc1.\_y-mc2.\_y);  
vx = Math.abs(mc1.\_x-mc2.\_x);  
return Math.tan(vy/vx);  
}[/AS]That would return the degree in radians. Theres a command to convert to degrees but I cant produce itoff the top of my head. Back to the basics of Math! :lol:

---

<div class="post-metadata">

**Author:** ![creatify](https://avatars.discourse-cdn.com/v4/letter/c/d07c76/32.png) [@creatify](https://forum.kirupa.com/u/creatify)\
**Post date:** [April 17, 2006, 5:41pm UTC](https://forum.kirupa.com/t/finding-degrees/185902/3 "2006-04-17T17:41:32Z")

</div>

See attached flash 8 fla - you can drag the small dot, the angle is traced on release of the small dot. Flash figures +/- degress vs. 360 - but with a little math, you should can get the result to show from 1-360 degrees:

---

<div class="post-metadata">

**Author:** ![theHollow](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/thehollow/32/106_2.png) [@theHollow](https://forum.kirupa.com/u/theHollow)\
**Post date:** [April 18, 2006, 3:14am UTC](https://forum.kirupa.com/t/finding-degrees/185902/4 "2006-04-18T03:14:19Z")

</div>

Awesome, thanks both of you.
