Re: Motion 10v2 released
> Date: Tue, 03 Nov 2009 19:12:20 +0100
> From: "J. Wolff v. Gudenberg" <wolff@xxxxxxxxxxxxxxxxxxxxxxxxxxx>
> To: stds-1788 <stds-1788@xxxxxxxxxxxxxxxxx>
> Subject: Motion 10v2 released
>
>
> p1788
> please find attached version 2 of motion 10 : elementary functions.
> The website has also been updated.
>
> I changed my lists of functions a little.
>
> I added Dan's "all inclusive" powerful power function
>
> and I suggest to defer details
>
> hence, I expect 3 different votes (Is this ok with you, George ?)
>
> many thanks to all contributers
> in particular to Hossam, John and Dan
> best regards
> Juergen
Juergen,
I have a couple of minor nits with the notes for Table 1.
Actually, both are minor but one is more complicated to
explain than the other. :-)
You tag both pown & compound with note 2. In the case of
compound, I believe it was your intention to say that it
is not defined for x = -1.
That's the simple one. :-)
Then, 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.
But even this is not needed.
The only real application of atan2 is that is should be used
together with hypot to convert cartesian coordinates (x,y)
to polar coordinates (r,theta), or the moral equivalent.
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. In topological language, as any small
open set approaches the origin, the range of arguments
becomes wider (or more ambiguous) until that set contains
the orgin. In which case the range of arguments becomes
[-Pi,Pi].
This is no more complicated than the fact that your
longitude is ambiguous at the north or south pole.
For example, the longitude of the station at the south
pole is arbitrarily assigned to the prime meridian to
give them GMT for a time of day. :-)
Similarly, in floating-point one arbitrarily assigns the
value 0 to the argument of (0,0) but, once again, the
domain of intervals offers us the chance to correct this
'error'.
The atan2 function is already well defined as a point
function everywhere except (0,0). If we choose to define
the interval atan2 function for intervals containing (0,0)
as [-Pi,Pi], we will maintain the principle of containment
& have this function defined everywhere as it should be.
Further, in the case of non-singleton interval inputs,
one will see the range of arguments (the result of atan2)
widen until it encloses the origin & then encompass the
whole of this 2Pi width interval.
It seems like the best thing to do for either fixed point
iterations or divide & conquer searches.
It is really a minor change.
I hope this suggestion will not turn out to be as
controversial as my x^y suggestion. :-)
Yours,
Dan
P.S. - In reviewing what I have just written I realized
that one could use the interval signum function to do
the case analysis for the sign of the result together
with the choice of endpoints to be considered for calls
to the point function atan2. Let me illustrate with a
table.
If I label the 4 boundary points as follows:
point a: (xlo,ylo)
point b: (xlo,yhi)
point c: (xhi,ylo)
point d: (xhi,yhi)
b---d
| |
a---c
Then I can transform the input into
exemplar = (signum([xlo,xhi]),signum([ylo,yhi]))
This reduction divides the interval plane into 9 exemplar
pieces & the case analysis looks like:
([-1,-1],[1,1]) ([-1,1],[1,1]) ([1,1],[1,1])
rlo = d, rhi = a rlo = c, rhi = a rlo = c, rhi = b
([-1,-1],[-1,1]) ([-1,1],[-1,1]) ([1,1],[-1,1])
rlo = d, rhi = c result = [-Pi,Pi] rlo = a, rhi = b
([-1,-1],[-1,-1]) ([-1,1],[-1,-1]) ([1,1],[-1,-1])
rlo = b, rhi = c rlo = b, rhi = d rlo = a, rhi = d
In the middle case (the only one that includes the origin),
the result drops out as [-Pi,Pi].
In all the other cases the result is
[roundDown(atan2(rlox,rloy)),roundUp(atan2(rhix,rhiy))].
Always assuming I've done my table correctly, of course. :-)