# Limits of rotation

**URL:** <https://forum.kirupa.com/t/limits-of-rotation/322749>\
**Category:** Uncategorized\
**Created:** [June 1, 2011, 5:27pm UTC](https://forum.kirupa.com/t/limits-of-rotation/322749 "2011-06-01T17:27:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![radi](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@radi](https://forum.kirupa.com/u/radi)\
**Post date:** [June 1, 2011, 5:27pm UTC](https://forum.kirupa.com/t/limits-of-rotation/322749/1 "2011-06-01T17:27:03Z")

</div>

is there a type of variable that understands that 360 is less than 0

```auto

var spin:int
        var a1 = desy - y ;
        var b1 = desx - x ;
        var radians1 = Math.atan2(a1,b1);
        var andleInDegrees = radians1 / (Math.PI / 180);
            //andleInDegrees += 180
             andleInDegrees = int(andleInDegrees)
             trace(andleInDegrees)
            if(facing.rotation < andleInDegrees){spin = 1}
            if(facing.rotation > andleInDegrees){spin = -1}
            if(facing.rotation == andleInDegrees){spin = 0}
            facing.rotation += spin 

```

this works as long as i dont cross the 360/0 threshold (it may be -180/180 since i removed the +180)
