Other#
Distance Calculation#
Any point on the Earth’s surface can be located by its latitude and longitude coordinates.
Latitude is the angle above or below the equator in degrees. The equator is zero degrees, the North pole is North 90 degrees latitude, and the South pole is South 90 degrees latitude. The continental United States falls between 25 and 50 degrees North.
Longitude is the angle East or West of the Greenwich meridian. The continental United States is between 70 and 125 degrees West.
Approximate Solutions#
One degree of latitude is equal to 69.1 miles. One degree of longitude is equal to 69.1 miles at the equator. North or South of the equator, 1 degree of longitude is a smaller distance. It’s reduced by the cosine of the latitude. Dividing the latitude number by 57.3 converts it to radians.
If you don’t want to use the COS function, then a good approximate solution is:
Exact Solution#
To calculate the exact distance between points requires spherical geometry.
The above formula has one major problem: most computer languages do not support the arccosine function. Therefore a different form is necessary, one that uses the arctangent function that most languages embrace.
where A is equal to:
Most computer languages compute the sine and cosine function with the angle given in radians. To convert degrees to radians, divide degrees by the constant:
In BASIC this would be programmed as follows:
Where:
D = distance in statue miles from the first to the second point.
C = degrees to radians constant 57.3.
Lat1 = latitude of the first point in degrees.
Long1 = longitude of the first point in degrees.
Lat2 = latitude of the second point in degrees.
Long2 = longitude of the second point in degrees.
NOTE: Dividing the latitude number by 57.3 converts it to radians.
Since all ZIP Code points in the United States are North latitude and West longitude, there is no need to check the sines (positive and negative) of the latitudes and longitudes.
Some programming languages, such as dBASE II/III, do not have the functions of the sine, cosine and arctangent. Also, the formulas given are time-consuming to calculate. A simpler but less accurate method is given here:
Although this formula is not as accurate as the first great circle method, it will give good results for most applications.
In basic, it is written as follows:
In dBASE III, it is written as follows:
To make using the database easier, the latitudes and longitudes are given in the decimal format instead of the degree, minute and second format. The latter would require the additional steps of converting seconds to fractions of a minute and then minutes to a fraction of a degree.
Bearing Formula#
The bearing is the direction from the first point to the second point. It is expressed as an angle from North in degrees. Due North is a bearing of zero degrees, East is a bearing of 90 degrees, South is 180, and west is 270.
The bearing from the first point to the second is calculated with:
Since the ARCTAN function gives the angle in radians, it is necessary to convert B to degrees by multiplying by
To use this equation requires some special considerations. This example assumes that Lat1, Lat2, Long1, Long2 have been converted to radians.
Use the following steps:
If (D > 0) then (B = 360 + B)
If (D < 0) then (B = 180 + B)
If (B < 0) then (B = 360 + B)
Where:
N is the Numerator.
D is the Denominator.
B is the Bearing.
Examples#
The following examples should give you a feel for the numbers. For these examples, we will use the points of Schenectady, NY and Los Angeles, CA.
First Point is in Schenectady, NY, 12345
Lat1 = 42.8145
Long1 = 73.9380
Second Point is in Los Angeles, CA, 90001
Lat1 = 34.0515
Long1 = 118.2420
Example 1: Approximate Formula (1)
Example 2: Approximate Formula (2)
Example 3: Exact Solution Formula
Example 4: Bearing Formula
Abbreviations and Codes#
Military#
Abbreviation |
Region |
---|---|
AA |
Atlantic |
AP |
Pacific |
AE |
Europe |
State#
Abbreviation |
Code |
State |
---|---|---|
AL |
01 |
Alabama |
AK |
02 |
Alaska |
AZ |
04 |
Arizona |
AR |
05 |
Arkansas |
CA |
06 |
California |
CO |
08 |
Colorado |
CT |
09 |
Connecticut |
DE |
10 |
Delaware |
DC |
11 |
District of Columbia |
FL |
12 |
Florida |
GA |
13 |
Georgia |
HI |
15 |
Hawaii |
ID |
16 |
Idaho |
IL |
17 |
Illinois |
IN |
18 |
Indiana |
IA |
19 |
Iowa |
KS |
20 |
Kansas |
KY |
21 |
Kentucky |
LA |
22 |
Louisiana |
ME |
23 |
Maine |
MD |
24 |
Maryland |
MA |
25 |
Massachusetts |
MI |
26 |
Michigan |
MN |
27 |
Minnesota |
MS |
28 |
Mississippi |
MO |
29 |
Missouri |
MT |
30 |
Montana |
NE |
31 |
Nebraska |
NV |
32 |
Nevada |
NH |
33 |
New Hampshire |
NJ |
34 |
New Jersey |
NM |
35 |
New Mexico |
NY |
36 |
New York |
NC |
37 |
North Carolina |
ND |
38 |
North Dakota |
OH |
39 |
Ohio |
OK |
40 |
Oklahoma |
OR |
41 |
Oregon |
PA |
42 |
Pennsylvania |
RI |
44 |
Rhode Island |
SC |
45 |
South Carolina |
SD |
46 |
South Dakota |
TN |
47 |
Tennessee |
TX |
48 |
Texas |
UT |
49 |
Utah |
VT |
50 |
Vermont |
VA |
51 |
Virginia |
WA |
53 |
Washington |
WV |
54 |
West Virginia |
WI |
55 |
Wisconsin |
WY |
56 |
Wyoming |
AS |
60 |
American Samoa |
FM |
64 |
Micronesia |
GU |
66 |
Guam |
MH |
68 |
Marshall Islands |
MP |
69 |
North Mariana Islands |
PW |
70 |
Palua |
PR |
72 |
Puerto Rico |
UM |
74 |
Minor Islands |
VI |
78 |
Virgin Islands |
Release Schedule#
Release Date Schedule |
|
---|---|
2024-12-09 |
|
2025-01-06 |
|
2025-02-10 |
|
2025-03-10 |
|
2025-04-07 |
|
2025-05-05 |
|
2025-06-09 |
|
2025-07-07 |
|
2025-08-04 |
|
2025-09-08 |
|
2025-10-06 |
|
2025-11-10 |
|
2025-12-08 |