# Trig help. At least i think its trig

**URL:** <https://forum.kirupa.com/t/trig-help-at-least-i-think-its-trig/153812>\
**Category:** Uncategorized\
**Created:** [July 4, 2005, 11:30pm UTC](https://forum.kirupa.com/t/trig-help-at-least-i-think-its-trig/153812 "2005-07-04T23:30:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![smack\_boom](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@smack\_boom](https://forum.kirupa.com/u/smack_boom)\
**Post date:** [July 4, 2005, 11:30pm UTC](https://forum.kirupa.com/t/trig-help-at-least-i-think-its-trig/153812/1 "2005-07-04T23:30:57Z")

</div>

I’m not really good at this math stuff. anyone know how to move your mc according to your rotation using this AS? thanks in advance

```auto
adjacent = _root._xmouse-this._x;
opposite = this._y-_root._ymouse;
hypotenuse = ((adjacent ^ 2)+(opposite ^ 2)) ^ 0.5;
if (adjacent>0 && opposite>0) {
this._rotation = 90-Math.atan2(opposite, adjacent)*(180/Math.PI);
}
if (adjacent>0 && opposite<0) {
this._rotation = 90-Math.atan2(opposite, adjacent)*(180/Math.PI);
}
if (adjacent<0 && opposite<0) {
this._rotation = 90-Math.atan2(opposite, adjacent)*(180/Math.PI);
}
if (adjacent<0 && opposite>0) {
this._rotation = 90+(360-Math.atan2(opposite, adjacent)*(180/Math.PI));
}

```
