David,
> The longitude at the pole is indeterminate, but whatever
> random numerical value is returned by atan2 is no less useful
> (and no more useful) than a fixed value of zero.
Tread carefully: atan2(0.0,0.0) is undefined. You don't get a
"random" answer, more likely an exception.
In my code I test x and y for exactly zero, as opposed to merely
tiny, and only then force longitude to zero. You're quite safe
doing atan2(epsilon,zero) or atan2(zero,epsilon), and if that
generates erratic results it just means the application needs to
be seen to.
Patrick Wallace
-----------------------------------------------------------------
TPOINT SOFTWARE tel/fax +44-1235-531198
19 Sutton Wick Lane, Drayton
Abingdon
Oxfordshire OX14 4HH
United Kingdom www.tpsoft.demon.co.uk
_________________________________________________________________
Except where indicated, the contents of this email
are for the named recipient(s) only and must not be
made public or otherwise disclosed to third parties.
-----------------------------------------------------------------
|