The spherical law of cosines is fundamental for computing great circle distances on Earth. It is used in GPS navigation, aviation route planning, and maritime navigation worldwide.
⚠Uses Earth radius of 6371 km. For very close points, numerical precision may be reduced. The haversine formula is more stable for small distances.
What Is the Spherical Law of Cosines?
The spherical law of cosines relates the angles and sides of a spherical triangle. It is the fundamental formula for computing great circle distances between points on a sphere, making it essential for global navigation.
Formula Structure
Similar to planar cosines but uses cos/sin of sides. For small triangles, approximates the planar law. Uses angular measures for sides.
Great Circle
The shortest path between two points on a sphere is a great circle arc. This is the spherical analog of a straight line on a plane.
Earth Radius
Mean Earth radius = 6371 km (3959 miles). The angular distance in radians times radius gives the linear distance.
Initial Bearing
The heading direction at the starting point. Essential for navigation. Bearing changes along the great circle route.
Teaching Example: New York (40.71,-74.01) to Los Angeles (34.05,-118.24). delta_lon = -44.23 deg. Convert to radians. cos(d) = sin(40.71)sin(34.05) + cos(40.71)cos(34.05)cos(-44.23). Angular distance = 35.6 deg. Linear distance = 35.6 x pi/180 x 6371 = 3953 km (2456 miles).
cos(a) = cos(b)cos(c) + sin(b)sin(c)cos(A). Relates sides and angles on a sphere. Used for great circle distance calculation.
How to compute distance between two coordinates?▼
Use haversine: d = 2R arcsin(sqrt(sin^2(dlat/2) + cos(lat1)cos(lat2)sin^2(dlon/2))). R = 6371 km for Earth.
What is Earth radius?▼
Mean radius = 6371 km (3959 miles). Earth is an oblate spheroid, so radius varies from 6357 km (polar) to 6378 km (equatorial).
Is this formula accurate for short distances?▼
The haversine formula is more numerically stable for small distances. The spherical law of cosines also works but may have rounding errors for very close points.
Free online calculators and tools covering mathematics, unit conversion, text processing, and daily life. Accurate, fast, mobile-friendly, and completely free to use.