Talk:Atan2

message: This article isn't very clear about the order of the two arguments x and y in the atan2() function call.  Many people will incorrectly assume at first glance that it is atan2(x,y) -- the text should be more explicit (I missed the order in the "more specifically" text the first 3 times I read it).  I maintain a parser for an expression language where atan2(a,b) returns atan(b/a) rather than C's atan(a/b)...
:Fixed.  ~a (user • talk • contribs) 00:22, 31 March 2007 (UTC)
replies: text: I think it is not unnecessary to add a sentence to emphasize that the order of the arguments is (y, x), not (x, y). I remember when I first saw this function in Fortran documents, I took it as atan2(x, y) until I found my results did not make sense. Many people are inclined to make this mistake. --Roland (talk) 19:58, 31 October 2019 (UTC)
replies: text:  Of course, it is important to use the arguments as they are defined in the manual.But the “natural” (usual, normal, predefined etc.) order of the coordinates is (x,y) and not (y,x). Nobody will say z = y i + x. It is a standard convention that the x-axis comes first, increases to the right (is defined to be identical to the polar axis) and the y-axis (coming second) runs up. So it was kind of an error by the FORTRAN-people to define  the way they did. Maybe they thought of  (for 0<x,y) (simply replacing the slash by the comma and appending the letter “2”) and were unable to think of This mistake is — in my opinion — the cause of the kind of errors mentioned by Roland above. --Nomen4Omen (talk) 09:35, 1 November 2019 (UTC)
thread_title: Order of arguments

message: It is not the first time I see someone changing (-\pi,\pi] for [-\pi,\pi] in the first paragraph (Indeed, I think I did so sometime in the past). I think this issue should be discussed here and an invisible comment should be kept in the article, for editor's guidance. 
As a mathematical funcion, atan2 is defined as 
:\operatorname{atan2}(y, x) = \begin{cases}
\arctan(\frac y x) & \qquad x > 0 \\
\pi + \arctan(\frac y x) & \qquad y \ge 0 , x < 0 \\
-\pi + \arctan(\frac y x) & \qquad y < 0 , x < 0 \\
\frac{\pi}{2} & \qquad y > 0 , x = 0 \\
-\frac{\pi}{2} & \qquad y < 0 , x = 0 \\
\text{undefined} & \qquad y = 0, x = 0 \\
\end{cases}
It couldn't be -\pi because:
* y < 0 \implies \arctan(\frac y x)\neq 0 \implies atan2(y,x)>-pi
* y > 0 \implies atan2(y,x)>0
* y = 0 \land x>0 \implies atan2(y,x)=0 
* y = 0 \land x<0 \implies atan2(y,x)=pi 
* y = 0 \land x=0 \implies \implies atan2(y,x) undefined  
Therefore atan2's codomain is (-\pi,\pi], NOT [-\pi,\pi].
I think the confusion arises from computational implementation and how it deals with signed zero.
Since "zero" is now a limit instead of finite real value, we have
 atan2\left(\pm0,0\right)= atan2\left(\lim_{\;y\rightarrow 0^\pm} y,0\right) = \lim_{\;x\rightarrow 0^\pm} atan2(y,x)
and, particularly  \lim_{\;x\rightarrow 0^-} atan2(y,x)=-\pi
but this is only a limit; mathematical atan2 function does NEVER gives that result. Rjgodoy 19:27, 3 July 2007 (UTC)
thread_title:  Closed/semi-open interval 

message: In Maxima atan2(x,1)=atan(x) 
Adam majewski 21:02, 28 October 2007 (UTC)
thread_title:  atan2 and atan 

message: Hi, I'm not sure where this link shall point out so I may put it here if someone knows how to fix it. There's a broken link in reference [1] where it says:
include the C-style atan2 function. The Linux Programmer's Manual [1] says:
--Felipebm (talk) 19:08, 25 March 2008 (UTC)
thread_title:  broken link 

message: I don't understand why the 3D graph shows a slight curve in the profile visible along the negative x.  Shouldn't the graph be a constant value of pi along here?  —Preceding unsigned comment added by 198.99.123.63 (talk) 16:37, 10 April 2008 (UTC)
replies: text: Did you note the statement in the article that Excel has the two arguments reversed? — Carl (CBM · talk) 02:36, 3 February 2009 (UTC)
thread_title:  Graph Incorrect? 

message: The article states that the results are positive for y>0 and negative for y<0, but what about y=0? AFAICT, y<0 either gives 0 or π, so it should read that the results are positive for y>=0 and negative for y<0.--Subversive Sound (talk) 14:57, 9 July 2010 (UTC)
replies: text: The full definition is given later on, that's a very general idea of how angles are measured. You'd have people saying 0 isn't positive with the change you say. Dmcq (talk) 15:20, 9 July 2010 (UTC)
thread_title: Sign of output

message: In my opinion the section called "Derivative" uses needless complicated formulation, as if some finds such things interesting. As atan2 is a function of two variables, it suffices to just give both the partial derivatives. Nijdam (talk) 20:14, 12 November 2011 (UTC)
replies: text: Yes the derivation is totally unnecessary. Dmcq (talk) 20:59, 12 November 2011 (UTC)
thread_title:  Derivative 

message: I first noticed this article existed in 2007 and didn't find it noteworthy but still pointed traffic it's way, since then it has greatly improved! -- BlindWanderer (talk) 06:54, 28 October 2012 (UTC)
thread_title:  Quality 

message: Hello fellow Wikipedians,
I have just modified  on Atan2. Please take a moment to review my edit. If you have any questions, or need the bot to ignore the links, or the page altogether, please visit this simple FaQ for additional information. I made the following changes:
*Added  tag to https://support.apple.com/kb/PH927
*Added archive https://web.archive.org/web/20150820094929/http://www.info.teradata.com:80/HTMLPubs/DB_TTU_15_00/index.html to http://www.info.teradata.com/HTMLPubs/DB_TTU_15_00/index.html#page/SQL_Reference/B035_1145_015K/Arithmetic.062.225.html
When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at ).
Cheers.—InternetArchiveBot (Report bug) 12:43, 20 October 2016 (UTC)
thread_title:  External links modified 

message: I do not understand the following (at the end of the section):
"Computation gives
:\text{atan2}(y,x)=\left({-y\over x^2+y^2}, \ {x\over x^2+y^2}\right)\ ."
# I do not see a computation.
# In the foregoing definition and statements atan2(y,x) delivers a real (scalar). How can it deliver a 2-dim point ? and
# especially this one ?
Can somebody help me ? --Nomen4Omen (talk) 20:24, 26 January 2017 (UTC)
replies: text:  Thanks for spotting that. This seems to have gotten lost in translation somewhere. This older version (from almost a year ago) makes significantly more sense.  I'm going to see what I can do to fix this.  --♫CheChe♫ talk 19:34, 27 January 2017 (UTC)
replies: text: Fixed. --♫CheChe♫ talk 19:47, 27 January 2017 (UTC)
thread_title:  section: Definition and computation 

message: Up to my knowledge
:\nabla \text{atan2}(y,x)=\left({x\over x^2+y^2}, \ {-y\over x^2+y^2}\right)
is not the divergence, but is the gradient of atan2.
(Nabla is OK.) --Nomen4Omen (talk) 14:46, 30 January 2017 (UTC)
replies: text: Yikes! My mistake. Slip of the tongue there, divergence is a scalar, so it can't be that (though I'm glad the equation says the right thing).  --♫CheChe♫ talk 15:24, 30 January 2017 (UTC)

text: Ok, that should be fine now. Thanks for the help.  --♫CheChe♫ talk 15:29, 30 January 2017 (UTC)
thread_title:  Section: Derivative 

message: Since there are mainly two different principal branches in the -codomain in mathematical use (see also Argument), I mentioned both in defining the  function via these different branches, distinguishing them for notational consistency by writing  and , respectively, trying to be as terse as possible with this clerical detail. However, I think it is of encyclopedic value not to brush over this, saving a few (~ 5) lines.
Since there are reservations to mentioning both standards –this making the article obtuse–, I ask for further ideas. Purgy (talk) 07:48, 13 July 2018 (UTC)
thread_title:  Defining {{math|atan2}} via {{math|Arg}} 

message: While the order of arguments can be reversed by mistake, it can be reversed intentionally to achieve a different purpose. In engineering problems, especially in the area of solar energy application, the solar azimuth angle, which can be computed from the x- and y-component of the vector pointing to the Sun using the atan2 function, normally measures from due North (positive y-axis) or due South (negative y-axis), this can be achieved by using atan2(x, y) or atan2(-x, -y). Notice the order of x and y and negative signs. In both of these cases, clockwise angles are positive. Maybe this can be added in a new section. --Roland (talk) 22:22, 31 October 2019 (UTC)
thread_title:  Reverse the order of arguments and negate the arguments 

message: The article is extremely confusing, because it makes assertions about the relation between atan2(y,x) and arctan(y/x) without defining which conventions it is assuming for arctan. (At least not until much later in the article.)
If the article is to make sense, then it must be clear on this point.
Also: The atan2(y,x) function as implemented in computer systems is not multivalued. So this article should make that unambiguously clear. One of the illustrations shows it to be multivalued, and this is wrong.2601:200:C000:1A0:492D:B65:DB52:4EFE (talk) 20:46, 23 May 2021 (UTC)
replies: text: This criticism is overall bit vague and hard to turn into specific changes/improvements. The relation graphed in the figure, \bigl(y/x, \operatorname{atan2}(y, x)\bigr), is "multivalued" in the domain (first coordinate). The axes are clearly labeled, this figure doesn't seem like a problem to me. It’s hard to graph a function of 2 inputs in a 2-dimensional picture. –jacobolus (t) 22:42, 22 October 2022 (UTC)

text: I took a couple swings at cleaning up the first 2 sections, making them more concise and hopefully a bit more comprehensible. Does that help at all? –jacobolus (t) 07:02, 23 October 2022 (UTC)
thread_title:  Truly bad article 

message: http://nghiaho.com/?page_id=846  — Preceding unsigned comment added by 2A02:810A:1840:1ED4:C05C:C067:55B1:DE00 (talk) 13:35, 22 October 2022 (UTC)
replies: text: If you think this is an important application of atan2, feel free to add it (if others disagree, they can start a discussion explaining why). I don’t think it’s quite fair to say that any particular application of a general purpose tool is "missing" with the implication that it is essential to discuss. –jacobolus (t) 22:45, 22 October 2022 (UTC)
thread_title: '''Decomposing a rotation matrix missing'''