Calculate port-to-port great-circle distance, bearings, midpoint, and ETA from coordinates, distance, vessel speed, and departure time.
Port Distance Formula
The following formula (the haversine / great-circle formula) is commonly used to calculate the shortest distance over the Earth’s surface between two ports given their latitude and longitude.
D = 2R \arcsin\left(\sqrt{\sin^2\left(\frac{\varphi_2-\varphi_1}{2}\right)+\cos(\varphi_1)\cos(\varphi_2)\sin^2\left(\frac{\lambda_2-\lambda_1}{2}\right)}\right)Variables:
- D is the great-circle distance between the two ports (in the same units as R; commonly nautical miles)
- R is the Earth’s radius (approximately 3440.065 nautical miles, 6371.0088 km, or 3958.7613 miles)
- φ1 and φ2 are the latitudes of the first and second port (in radians)
- λ1 and λ2 are the longitudes of the first and second port (in radians)
To calculate the distance between two ports, convert latitude/longitude from degrees to radians, compute Δφ = φ2 − φ1 and Δλ = λ2 − λ1, evaluate the haversine expression above, and multiply the resulting central angle by R. This gives the great-circle distance (the shortest path on a spherical Earth). Actual sailing routes may be longer due to routing, weather, traffic separation schemes, and other constraints.
What is a Port Distance?
A Port Distance refers to the measurement of the distance between two seaports. This measurement is typically used in the shipping and logistics industry to calculate the time and cost of transporting goods from one port to another. The distance is usually measured in nautical miles and can be influenced by factors such as the route chosen, weather conditions, and maritime regulations.
How to Calculate Port Distance?
The following steps outline how to calculate the Port Distance using the haversine (great-circle) formula:
- Gather the latitude and longitude of each port (in degrees).
- Convert each latitude/longitude value from degrees to radians.
- Compute Δφ = φ2 − φ1 and Δλ = λ2 − λ1.
- Compute a = sin²(Δφ/2) + cos(φ1)cos(φ2)sin²(Δλ/2).
- Compute the central angle c = 2·atan2(√a, √(1 − a)).
- Multiply to get distance: D = R·c, using an Earth radius R in your desired units (e.g., nautical miles).
Example Problem:
Use the following variables as an example problem to test your knowledge:
φ1 = 40° (latitude of the first port)
λ1 = −73° (longitude of the first port)
φ2 = 35° (latitude of the second port)
λ2 = −80° (longitude of the second port)
Using R = 3440.065 nautical miles, the great-circle distance is approximately D ≈ 448.6 nautical miles (≈ 830.7 km).
