RE: [Re: calculating distance based on zip/postal codes]

by "Manewell, Brett" <BManewell(at)csr.com.au>

 Date:  Tue, 16 May 2000 11:07:30 +1000
 To:  "'Jan Theodore Galkowski'" <jtgalkowski(at)alum.mit.edu>
 Cc:  hwg-business <hwg-business(at)hwg.org>
  todo: View Thread, Original
OK, I'm impressed already.

I knew there was a good reason I subscr1bed to the hwg-business mail list ;)

It's been 10 years since I did any heavy duty engineering maths at Uni and
this is way beyond me getting my head around during my working day.  I think
I'll just archive this discussion thread for later consideration.

Thanks for the insight!

regards
Brett Manewell
CSR Timber Products ISD
BManewell(at)csr.com.au


-----Original Message-----
From: Jan Theodore Galkowski [mailto:jtgalkowski(at)alum.mit.edu]
Sent: Tuesday, 16 May 2000 10:09
Subject: Re: [Re: calculating distance based on zip/postal codes]

>D= 6,370,997*arcos(sin(LAT1)*sin(LAT2) +
cos(LAT1)*cos(LAT2)*cos(LONG1-LONG2))
[snip]

>Though I believe that this is the arc-cosine rule that Galkowski advised
>against.
Just to confirm Capt Ron's suspicion, yes, this is the problematic
arccosine rule.  All's fine except that nasty cosine of the
difference between two longitudes:  As the distance between the 
longitudes halves, you need more than double the amount of precision
to get the same accuracy out of the expression.

In general, folks who do a lot of 3-dimensional work on the sphere 
represent positions by unit vectors in 3-space and use their dot
products as a reciprocal measure of distance between the points.  
To change that into a length, one can use a number of gimmicks
which avoid having to push the quantity through a trig function.
Indeed, most real-time 3-or-greater-space work avoids trig functions
altogether, trying to reduce the calculation to +, -, *, /, and
SQRT operations only.  Vector analysis is good for this.  There
are also more numerically stable representations, such as 
quaternions (although, apart from religious considerations, it's
hard to make a case for them versus, say, spin matrices, or 
rotation matrices themselves) or Rodrigues parameters (a favorite
of mine).  

In serious work, error analysis on the sphere is an important 
consideration and, if the standard angular deviations are anything
but tiny, involves some non-standard stuff which is the subject
of spherical statistics and spherical regression, eg, paleomagnetic
calculations.
  --jtg
[snip]

HTML: hwg-business mailing list archives, maintained by Webmasters @ IWA

This page is part of a preserved archive of archives.hwg.org. The site is no longer active and its content is not maintained. For enquiries about this archive, write to archive(at)iwanet.org.