# Computing Distances With the Pythagorean Theorem

You can compute distances in a projected coordinate system using the Pythagorean theorem, subject so some accuracy limitations.

Fact: There is always distortion in scale when a portion of the round Earth is projected on a flat surface. This distortion in scale increases with distance east and west of the center of the projection (the central meridian in UTM).

Projections like UTM commonly apply a scale factor to reduce the error at the outer extremes of the projected area. This also makes distances somewhat shorter than actual at the center of the projection. In the case of UTM, the scale factor is 0.9996.

Computing distances with the Pythagorean theorem is fast, but if an error of 1 meter in 2.5km is too much for your needs, you should use a more accurate computation.

# Ellipsoidal Distance

Ellipsoidal distance, or geodesic distance[1], uses an ellipsoid model of the Earth to achieve a more accurate measurement between two points. Since it uses geodetic latitude and longitude, however, it is necessary to transform projected coordinates to geodetic coordinates first.

Transforming coordinates is an additional step, of course, and the ellipsoidal distance computation is more involved than the simple Pythagorean theorem, but the result is more accurate.

# Great-Circle Distance Computation

Great-circle distance computation is somewhat simpler than ellipsoidal distance computation. It's also somewhat less accurate. It assumes a spherical Earth and, like ellipsoidal distance computation, uses latitude and longitude.

[1] Geodesic distance is the distance across any surface, whether flat or irregular. Ellipsoidal distance is an instance of geodesic distance where the surface is an ellipsoid.

Chuck Taylor -- (Copyright) -- (Contact)