Thread Links Date Links
Thread Prev Thread Next Thread Index Date Prev Date Next Date Index

Re: Motion 10v2 released; and atan2



Juergen and P1788

A couple of points about M0010.02.

First, if I vote Yes for M0010.10 (in George's notation) "List of required functions" am I saying that I want the required functions to include EXACTLY those on your list, or to include AT LEAST those on the list and possibly some others?

Second, on atan2.
On 3 Nov 2009, at 23:16, Dan Zuras Intervals wrote:
...	in note 5, you say simply that atan2 is not defined
	for y = 0.

	As atan2(x,y) is defined as the argument of the point (x,y)
	in the range [-Pi,Pi] perhaps you meant to exclude x = 0
	on the grounds that the call to atan(y/x) would fail in the
	divide.
and later
	There is, therefore, no reason for atan2 to be undefined
	anywhere except possibly at (0,0).  And it is not so much
	that the argument theta is undefined at this one point as
	it is ambiguous.

Two minor errors here. It's atan2(y,x) is defined as the argument (=polar angle) of the point (x,y). (This is for historical reasons.) And the standard Principal Value of this multi-valued function is in the range (-Pi,Pi] not [-Pi,Pi], that is, excluding x = -Pi. Thus,
    atan2(0,-1) = Pi
and
    atan2(y,-1) ->  Pi (from below) as y -> 0 from above,
    atan2(y,-1) -> -Pi (from above) as y -> 0 from below.
Same if the -1 is replaced by any value x<0.

That is, the negative real axis is a branch cut for the Principal Value, so -- obviously -- (0,0) is the end point of the branch cut. Now, I am NOT sure of the wisdom of Dan's suggestion that
(*)	define
	the interval atan2 function for intervals containing (0,0)
	as [-Pi,Pi]
Though [-Pi,Pi] is the value cset theory gives to atan2(0,0) (so as cset-lover I should approve it), it has at least two nasty features in a non-cset interval system.

First, as a POINT function, atan2 has no "natural" real value at (0,0), so the only sensible thing is for atan2(0,0) to be undefined. The "natural interval extension" (NIE) of any function f returns the empty set when evaluated at a singleton interval where f is undefined. Therefore, the NIE of atan2 has
    atan2([0,0],[0,0]) = Empty.
Thus, (*) is incompatible with the NIE of atan2.

Second consider a box B = ([xlo,xhi] cross [ylo,yhi]) such that one of its corners is at the origin. That means B is contained in one of the four quadrants.
If we use an atan2 based on the NIE, then
atan2([ylo,yhi],[xlo,xhi]) = [0,Pi/2] if B is in the 1st quadrant; [Pi/2,Pi] if B is in the 2nd quadrant; [-Pi,-Pi/2] if B is in the 3rd quadrant; [-Pi/2,0] if B is in the 4th quadrant;
which I think is what we should prefer to happen.

But with Dan's suggestion, atan2([ylo,yhi],[xlo,xhi]) = [-Pi,Pi] in all four cases, thus being totally uninformative.

I have a related query here. For any box B that straddles the branch cut, peeking no matter how slightly into both the y<0 and y>=0 regions for some x<0, we get
    atan2([ylo,yhi],[xlo,xhi]) = [-Pi,Pi].
If what we REALLY want is "an interval extension of the point function that is the Principal Value atan2 as above" then that is fine. But for applications to do with "winding" (continuous change of angle on a path that loops round the origin) one would like an atan2 that is about the incremental, continuous, change in angle across box B -- and is not always limited to (-Pi,Pi].

Has anyone got a suitable definition? Arnold, it looks the sort of thing for you. I also believe Bill Walster has published something on this problem.

Best wishes

John