Jump to content

Talk:Atan2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Purgy Purgatorio (talk | contribs) at 07:45, 13 July 2018 (hay Purgy, would you like someone to explain the math to you?: I stop here). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

WikiProject iconMathematics C‑class Mid‑priority
WikiProject iconThis article is within the scope of WikiProject Mathematics, a collaborative effort to improve the coverage of mathematics on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
CThis article has been rated as C-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-priority on the project's priority scale.

Order of arguments

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 (usertalkcontribs) 00:22, 31 March 2007 (UTC)[reply]

The C-language atan2 is convenient to apply by remembering that tangent = opposite/adjacent. Since angle = atan2(opposite,adjacent), it's easy to remember. Hollimb 18:43, 25 March 2007 (UTC)[reply]

The first note under "Definition"

The first note under the section "Definition" read to the effect that adding 2π to a result in the range (-π,π] resulted in the range (0,2π], which doesn't seem correct. I've changed it to read that adding π has this effect, and have further clarified the line to reduce potential ambiguity regarding to which value the additional π is added.198.54.202.94 (talk) 17:52, 28 May 2008 (UTC)[reply]


But
--Bob K (talk) 23:24, 28 May 2008 (UTC)[reply]

Closed/semi-open interval

It is not the first time I see someone changing for 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

It couldn't be because:

Therefore atan2's codomain is , NOT . 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

and, particularly

but this is only a limit; mathematical atan2 function does NEVER gives that result. Rjgodoy 19:27, 3 July 2007 (UTC)[reply]

atan2 and atan

In Maxima atan2(x,1)=atan(x)

Adam majewski 21:02, 28 October 2007 (UTC)[reply]

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)[reply]

Neither I do, but IA-32 Intel® Architecture Software Developer’s Manual. Volume 2A: Instruction Set Reference, A-M, 2004 should include a definition too. We could use it instead of The Linux Programmer's Manual. Rjgodoy (talk) 01:33, 26 March 2008 (UTC)[reply]

Graph Incorrect?

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)[reply]

Actually it should be -pi/2. However there is no such a slight curve! After your comment I became very suspicious about the graph and plotted the surface by myself (thus I could verify that the values alongside x axis were correct and constant either -pi/2 or pi/2, but for x=0 y=0 of course). It seems to be a slight curve because of an optical illusion due to the perspective and the slight pendient wrt. y axis. Rjgodoy (talk) 21:35, 10 April 2008 (UTC)[reply]

The graph is nice but this graph has no axis labels. I don't suppose it means much to you as you know what the graph is saying but anyone like me who is not 100% sure would appreciate people sticking to the good old rule of labeling each and every axis in every graph ever. —Preceding unsigned comment added by 132.181.15.75 (talk) 22:16, 28 May 2008 (UTC)[reply]

The chart showing atan2 is completely wrong. I just plotted it in Excel. —Preceding unsigned comment added by 142.23.221.132 (talk) 01:36, 3 February 2009 (UTC)[reply]

Did you note the statement in the article that Excel has the two arguments reversed? — Carl (CBM · talk) 02:36, 3 February 2009 (UTC)[reply]

Sign of output

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)[reply]

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)[reply]

More stable/consistent 'non-condition' formula?

Is there maybe a more convoluted formula that doesn't require any conditions, but is also computationally stable and isn't often undefined when y=0 (or at least the latter) ? I think this would merit inclusion into the article. --Skytopia (talk) 22:32, 5 September 2010 (UTC)[reply]

Derivative

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)[reply]

Yes the derivation is totally unnecessary. Dmcq (talk) 20:59, 12 November 2011 (UTC)[reply]

Quality

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)[reply]

Hello fellow Wikipedians,

I have just modified one external link 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:

When you have finished reviewing my changes, please set the checked parameter below to true or failed to let others know (documentation at {{Sourcecheck}}).

This message was posted before February 2018. After February 2018, "External links modified" talk page sections are no longer generated or monitored by InternetArchiveBot. No special action is required regarding these talk page notices, other than regular verification using the archive tool instructions below. Editors have permission to delete these "External links modified" talk page sections if they want to de-clutter talk pages, but see the RfC before doing mass systematic removals. This message is updated dynamically through the template {{source check}} (last update: 5 June 2024).

  • If you have discovered URLs which were erroneously considered dead by the bot, you can report them with this tool.
  • If you found an error with any archives or the URLs themselves, you can fix them with this tool.

Cheers.—InternetArchiveBot (Report bug) 12:43, 20 October 2016 (UTC)[reply]

section: Definition and computation

I do not understand the following (at the end of the section):
"Computation gives

"
  1. I do not see a computation.
  2. In the foregoing definition and statements atan2(y,x) delivers a real (scalar). How can it deliver a 2-dim point ? and
  3. especially this one ?

Can somebody help me ? --Nomen4Omen (talk) 20:24, 26 January 2017 (UTC)[reply]

@Nomen4Omen: 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)[reply]
Fixed. --♫CheChe♫ talk 19:47, 27 January 2017 (UTC)[reply]

Section: Derivative

Up to my knowledge

is not the divergence, but is the gradient of atan2.

(Nabla is OK.) --Nomen4Omen (talk) 14:46, 30 January 2017 (UTC)[reply]

@Nomen4Omen: 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)[reply]
Ok, that should be fine now. Thanks for the help. --♫CheChe♫ talk 15:29, 30 January 2017 (UTC)[reply]

hay Purgy, would you like someone to explain the math to you?

This useful and compact expression of atan2() is completely correct:

50.47.104.180 (talk) 18:20, 10 July 2018 (UTC)[reply]

I apologize for my precipitous edit summary, in which, for missing the important subtlety (x/y), I wrongly called two alternatives of your edit "blatantly wrong". I would have edited this, if it were possible. In an effort to remediate this at least a bit I wrote "looking closer" in my next summary.
In my penultimate edit I tried to justify the epitethon "compact" of your variant by
  • removing the first alternative since it is included in
  • the second and third, compacted to the new first.
  • I did the necessary expansion of the "±" of the originally third, ambiguous alternative, and
  • tried to give a line of thought to explain how to get to this variant, which I perceived as not immediately obvious.
  • BTW, because of discontinuity the atan2 cannot be fully described by referring to just 2 half planes.
  • I see my last edit as superior to to the now current version.
I consider the heading of this thread as caused by my flawed summary, but nevertheless, in the light of my edits here, as offensive. Purgy (talk) 07:10, 11 July 2018 (UTC)[reply]
It was "[my] edit" that restored this expression that appears to have been on this page for some number of years and is also on the Argument (complex analysis) page. The reason this compact expression is useful is because each case is valid for a continuous half plane. There is only one condition to apply, not two, to determine which case you use. In digital signal processing, we make use of the quite often to get phase response for an LTI filter, or for the instantaneous phase of an analytic signal. In the case of group delay for the former or for instantaneous frequency for the latter, we end up differentiating phase with respect to angular frequency (former) or time (latter). This differentiation requires phase unwrapping to deal with discontinuities. But in both cases we know that there will not be negative group delay (which means the derivative is negative) nor negative instantaneous frequency (which means the derivative is positive). In both those cases, the appropriate half-plane is exactly what is needed, eliminating the need to deal with an ostensible discontinuity. The compact expression is more useful and more informative as it is.
You're sorta new around here (apparently 2014) but not so new that it appears you get into a few scrapes with other editors. My only advise is: Don't think that every edit you do makes the article better. Personally, I think the section on Definition and computation was better and cleaner before you changed it. Especially that . It's now wordy, far less concise, and just ickier since July 1 for people who want to get to the facts quickly. The article is important. More important to non-mathematicians because they (the non-mathematicians) need guidance about how to deal with the 4 quadrant argument, but they don't need to worry about an obscure range of for [0, 2π) and alternative definitions with alternative symbols. It just makes it obtuse. Your first edit of July 1 was okay, but I think you took more liberty with the article than was good for it. Despite wp:BOLD. It was cleaner and clearer before. 50.47.104.180 (talk) 09:13, 11 July 2018 (UTC)[reply]
@50.47.104.180: Maybe you should not forget to mention that this version of atan2 differs from the first one in the half-plane x<0. --Nomen4Omen (talk) 13:20, 11 July 2018 (UTC)[reply]
No, it does not differ. It is ambiguous because of the "±" to an additive term of 2π. But the symbol "±" does not force the reader to choose either particular option. 50.47.104.180 (talk) 19:45, 11 July 2018 (UTC)[reply]
If it's ambiguous, then it's NOT a function. Whereas the first atan2 is, as well as Arctan etc. If you let the reader to choose either particular option, you need not say anything. --Nomen4Omen (talk) 20:11, 11 July 2018 (UTC)[reply]
That's right. Because there are alternative choices with the overlapping half-planes, it's not a function. But it's still an expression. Say we're in quadrant I. We can use either the Case x>0 or Case y>0. Which one is not explicitly determined in this expression. The purpose of this expression was apparently to offer flexibility it choice, not to strictly define a function. 50.47.104.180 (talk) 23:58, 11 July 2018 (UTC)[reply]

I stop in this offensive thread with batting around membership, scrapes, bragging on elementary DSP-terms, whether WP is primarily for quick and dirty access, and other off topics. Purgy (talk) 07:45, 13 July 2018 (UTC)[reply]