http://www.meridianworldda

From that page:

Great Circle Distance Formula using radians:

3963.0 * arccos[sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 - lon1)]

Great Circle Distance Formula using decimal degrees:

3963.0 * arccos[sin(lat1/57.2958) * sin(lat2/57.2958) + cos(lat1/57.2958) * cos(lat2/57.2958) * cos(lon2/57.2958 -lon1/57.2958)]

OR

r * acos[sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 - lon1)]

Where r is the radius of the earth in whatever units you desire.

r=3437.74677 (statute miles)

r=6378.7 (kilometers)

r=3963.0 (normal miles)

Since there's no arccos function in VB, you'll have to use the arctan (Atn, in VB) version, as described on the page.

Assume long/lat is in radians and the result GD is in normal miles. In VBScript, try this:

<SCRIPT LANGUAGE="VBScript">

<!--

Dim lon1, lat1, lon2, lat2, x, GD

x = sin(lat1) * sin(lat2) + cos(lat1) * cos(lat2) * cos(lon2 - lon1)

GD = 3963.0 * atn(sqrt(1-x^2))/x)

-->

</SCRIPT>

Hope that helps.