# Math.atan2 woes

**URL:** <https://forum.kirupa.com/t/math-atan2-woes/105948>\
**Category:** Uncategorized\
**Created:** [March 31, 2004, 11:26am UTC](https://forum.kirupa.com/t/math-atan2-woes/105948 "2004-03-31T11:26:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![selphie72](https://avatars.discourse-cdn.com/v4/letter/s/c57346/32.png) [@selphie72](https://forum.kirupa.com/u/selphie72)\
**Post date:** [March 31, 2004, 11:26am UTC](https://forum.kirupa.com/t/math-atan2-woes/105948/1 "2004-03-31T11:26:47Z")

</div>

```auto

function rtd (rad) {
return rad*(180/Math.PI)
}

trace(rtd(Math.atan2(0,10))) //supposed to be 90 degrees but it return 0
trace(rtd(Math.atan2(-10,0))) // supposed to be 180 but it also return 0

```

what to do?:sigh:
