>I need to be able to provide a proximity search by zip code. I have a
>table of job opportunities with the zip code where they exist. So I need
[quoted text clipped - 3 lines]
> Thanks,
> Tina
Here are a few methods that calculate distance between 2 points of Latitude
and Longitude. Calculations of distance between points of Latitude and
Longitude are always approximate, as the surface of the earth is curved, and
the earth is an oblate spheroid, rather than a sphere, and therefore,
distance is distance along a curve that varies from one point on the surface
to another. There are methods of calculating distance that are more or less
accurate, and they become increasingly complex as they become increasingly
accurate. The following methods treat the earth as a sphere, and use a mean
earth radius (average of the radius based upon the radius at the poles and
equator). They should be accurate enough for this purpose.
Note that there is a reference to a struct called "LatLong," which is simply
a struct containing 2 doubles:
public const double MeanEarthRadiusFeet = 20903215.2;
public static double DistanceRadians(LatLong PointA, LatLong PointB)
{
double aLat, aLong, bLat, bLong;
aLat = PointA.Lat * (Math.PI / 180);
aLong = PointA.Long * (Math.PI / 180);
bLat = PointB.Lat * (Math.PI / 180);
bLong = PointB.Long * (Math.PI / 180);
return Math.Acos(Math.Cos(aLat) * Math.Cos(bLat) *
Math.Cos(aLong - bLong)
+ Math.Sin(aLat) * Math.Sin(bLat));
}
public static double Distance(LatLong PointA, LatLong PointB)
{
double radians = DistanceRadians(PointA, PointB);
return radians * MeanEarthRadiusFeet; // Distance in feet
(convert to whatever)
}

Signature
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
> Tina,
>
[quoted text clipped - 24 lines]
>> Thanks,
>> Tina
Lit - 25 Jul 2007 19:27 GMT
Tina:
In addition remember the formula given is only a line-off-sight, or lack
off, Air-Distance you are getting.
If the 50 radius takes you over a mountain range, or a body of water, then
your driving distance can vary a great deal.
If this is an application that can cost you $$ for driving etc.. then you
need to study the area you are dealing with and look for some
costly-exceptions to avoid.
Some formulas are available for the USA for more accuracy + your exceptions
to avoid bad and costly decisions.
Lit.
> Here are a few methods that calculate distance between 2 points of
> Latitude and Longitude. Calculations of distance between points of
[quoted text clipped - 62 lines]
>>> Thanks,
>>> Tina