# MX: Trig question, atan & atan2

**URL:** <https://forum.kirupa.com/t/mx-trig-question-atan-atan2/97711>\
**Category:** Uncategorized\
**Created:** [December 28, 2003, 3:08am UTC](https://forum.kirupa.com/t/mx-trig-question-atan-atan2/97711 "2003-12-28T03:08:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![RoboLlama](https://avatars.discourse-cdn.com/v4/letter/r/bc79bd/32.png) [@RoboLlama](https://forum.kirupa.com/u/RoboLlama)\
**Post date:** [December 28, 2003, 3:08am UTC](https://forum.kirupa.com/t/mx-trig-question-atan-atan2/97711/1 "2003-12-28T03:08:30Z")

</div>

I thought that Math.atan2(y, x) computes the arc tan of y/x in radians, and that Math.atan(x) computes the arctan of x in radians. How come then are these two following lines different?

[AS]Math.atan((y1-y2) / (x1-x2));[/AS] and…  
[AS]Math.atan2((y1-y2) , (x1-x2));[/AS]  
They look to me like they should be the same, but they give very different results.

[fixed typo]

RoboLlama
