# Rotation

**URL:** https://forum.kirupa.com/t/rotation/256911
**Category:** Uncategorized
**Created:** [April 8, 2008, 6:27pm UTC](https://forum.kirupa.com/t/rotation/256911 "2008-04-08T18:27:35Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![samuk](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@samuk](https://forum.kirupa.com/u/samuk)
#### Post date: [April 8, 2008, 6:27pm UTC](https://forum.kirupa.com/t/rotation/256911/1 "2008-04-08T18:27:35Z")

</div>

i have movieclips that i assign y positions for. But not x. They just repel eachother, so i dont tell them to go to a set x position.

I want to make the movieclip rotate to so it points in what ever direction it is going. How can i do this without setting an x ?

i know how to do i using this,

var dx:Number = \_xmouse - mc.\_x;  
var dy:Number = \_ymouse - mc.\_y;  
var angle:Number = Math.atan2(dy, dx);

mc.\_rotation = angle \* 180 / Math.PI;

but as i said, i dont know what its new x will be???
