# Circular Movement Help, Need the Math Explained Please?

**URL:** <https://forum.kirupa.com/t/circular-movement-help-need-the-math-explained-please/29643>\
**Category:** flash\
**Created:** [August 28, 2003, 11:53pm UTC](https://forum.kirupa.com/t/circular-movement-help-need-the-math-explained-please/29643 "2003-08-28T23:53:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![babywax](https://avatars.discourse-cdn.com/v4/letter/b/7993a0/32.png) [@babywax](https://forum.kirupa.com/u/babywax)\
**Post date:** [August 28, 2003, 11:53pm UTC](https://forum.kirupa.com/t/circular-movement-help-need-the-math-explained-please/29643/1 "2003-08-28T23:53:03Z")

</div>

[AS]  
onClipEvent (load) {  
var centerx = this.\_x;  
var centery = this.\_y;  
var speed = 20;  
var degree = 0;  
var radius = 30;  
var radian;  
}  
onClipEvent (enterFrame) {  
degree += speed;  
radian = (degree/180)\*Math.PI;  
this.\_x = centerx + Math.cos(radian)\*radius;  
this.\_y = centery + Math.sin(radian)\*radius;  
}  
[/AS]

This is something I wrote, with(quite obviously) a lot of help from the very nice [circular movement](http://www.kirupa.com/developer/mx/circular.htm) tutorial on this web page. There are however a few things I do not understand, after a lot of searching, and a little posting here I found out what a radian was, but now I need to understand how the enterFrame clipevent section of this script exactly works.  
[AS]degree += speed;[/AS]  
I believe I get that… Just constantly increasing the degrees by 20 so it moves at 20 degrees a frame.  
[AS]radian = (degree/180)\*Math.PI;[/AS]  
I think I get that too… Converting the degrees into radians.  
[AS]  
this.\_x = centerx + Math.cos(radian)\*radius;  
this.\_y = centery + Math.sin(radian)\*radius;  
[/AS]  
That I don’t get. I understand what it DOES, it changes where it is going… But what is the formula that Math.cos(and Math.sin) use to return whatever number they return? One more thing, why must it be multiplied by the radius? What exactly does it return?  
Thank you for any help possible, and replies will be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 2:28am UTC](https://forum.kirupa.com/t/circular-movement-help-need-the-math-explained-please/29643/2 "2003-08-29T02:28:37Z")

</div>

see [http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12181](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=12181)

might help

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 29, 2003, 4:41am UTC](https://forum.kirupa.com/t/circular-movement-help-need-the-math-explained-please/29643/3 "2003-08-29T04:41:23Z")

</div>

Thank you, that helped a lot, I think I am beginning to understand some of the geometry behind circles, and it only took me a day with almost no algebra experience, flash is just so cool!  
I love my new hat too…  
:p:
