1. ## Understanding atan2 formula

So I'm learning computer programming and I've come across a formula:

atan2(y,x)

According to wikipedia this is calculated by:

2 arctan (square root(x^2 + y^2) - x) / y

Could someone please explain what this formula means.

2. ## Re: Understanding atan2 formula

Check the wiki. Basically, the range of the atan2 function is $(-\pi,\pi]$, whereas the atan function has a smaller range (approximately half that).

3. ## Re: Understanding atan2 formula

Originally Posted by Trik
So I'm learning computer programming and I've come across a formula:

atan2(y,x)

According to wikipedia this is calculated by:

2 arctan (square root(x^2 + y^2) - x) / y

Could someone please explain what this formula means.
You must give a wikipedia reference on that.
Something is just not right about that.

4. ## Re: Understanding atan2 formula

Originally Posted by Trik
So I'm learning computer programming and I've come across a formula:

atan2(y,x)

According to wikipedia this is calculated by:

2 arctan (square root(x^2 + y^2) - x) / y

Could someone please explain what this formula means.
Go back and put the brackets in the correct places (I know that the article has a missing set of brackets but that is less important in properly typeset mathematics, in linear mathematical notation you have to put in the brackets as otherwise what you type does not mean what you think it does).

The article explains what atan2 is/does.For that particular formula read what wikipedia says and follow the link where it points to the tangent half angle formula.