Re: Alternative atan2 (was Motion 52: final ...)
Vincent Lefèvre replied to me:
> > Basically, one would define atan2_sharp(Y,X) piecemeal, based on either
> > atan2() or atan2p(), possibly using the case() operator. Roughly, one
> > could have:
> > if (both X and Y contain 0) return [-pi,+pi]_trv
> > if (X < 0) return atan2p(Y,X)
> > else return atan2(Y,X)
>
> I now see what you mean. The atan2p and atan2m functions would just
> be helper functions for the specification of atan2_sharp and would
> not need to be exposed to the user. Perhaps the ranges (-pi,+pi],
> [0,+2pi) and (-2pi,0] might work. I don't think that the interval
> version (at Level 1) should contain anything outside [-2pi,+2pi],
> i.e. there's always a valid solution in [-2pi,+2pi].
Right -- but atan2p must be exposed in the standard in order to
define the interval function atan2_sharp piecemeal, based on interval
extensions of point functions. I think we don't need atan2m, though
the pair atan2, atan2m would be another possibility. The range of
atan2_sharp would then be (-pi,+2pi). There is no point function
with that range, which is why atan2_sharp cannot be the extension of
a single point function.
If the asymmetry of a (-pi,+2pi) range bothers people, we might be
able to define an atan2_sharp based on all three of atan2, atan2p and
atan2m (and a range of (-2pi,+2pi), symmetrical), but the piecemeal
definition would be more complicated.
Michel.
---Sent: 2013-12-03 10:09:32 UTC