# Detecting clock wise and anti clock wise rotation

**URL:** <https://forum.kirupa.com/t/detecting-clock-wise-and-anti-clock-wise-rotation/85290>\
**Category:** flash\
**Created:** [April 3, 2005, 4:31pm UTC](https://forum.kirupa.com/t/detecting-clock-wise-and-anti-clock-wise-rotation/85290 "2005-04-03T16:31:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![poomoo](https://avatars.discourse-cdn.com/v4/letter/p/ebca7d/32.png) [@poomoo](https://forum.kirupa.com/u/poomoo)\
**Post date:** [April 3, 2005, 4:31pm UTC](https://forum.kirupa.com/t/detecting-clock-wise-and-anti-clock-wise-rotation/85290/1 "2005-04-03T16:31:04Z")

</div>

hey troops!

nube’s first post.

can you tell me if it is possible to detect if an object is rotating anti clockwise or not?

at present i get x,y co-ords and use the code below to rotate it which is fine. now i could write an if statement to check if rotation is negative or positive but because rotation can be negative and positive when rotating clockwise and anti clockwise this wouldnt work.

any ideas?

```auto

 theAngle = Math.atan2(diffy , diffx);
 
 this._rotation = theAngle*360/(2*Math.PI);

 updateAfterEvent();

```

cheers in advance
