# Finding an angle

**URL:** <https://forum.kirupa.com/t/finding-an-angle/289641>\
**Category:** flash\
**Created:** [June 2, 2009, 9:03pm UTC](https://forum.kirupa.com/t/finding-an-angle/289641 "2009-06-02T21:03:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![DashMasterful](https://avatars.discourse-cdn.com/v4/letter/d/59ef9b/32.png) [@DashMasterful](https://forum.kirupa.com/u/DashMasterful)\
**Post date:** [June 2, 2009, 9:03pm UTC](https://forum.kirupa.com/t/finding-an-angle/289641/1 "2009-06-02T21:03:31Z")

</div>

I have an object that moves to wherever the mouse is clicked, I need to be able to determine the angle at which it is moving like so

var dx:Number = mouseX- this.x;  
var dy:Number = mouseY- this.y;  
var angle:Number = Math.atan2(dy, dx);  
var angle2:Number = (angle \* 180 / Math.PI);

will trace a number between -179 and 180, I need it to trace between 0 and 359, how can I get rid of the negative numbers?
