1001Ferramentas
🌍Calculators

Distância Haversine (lat/lon)

Calcula distância great-circle entre duas coordenadas usando fórmula de Haversine.

Distância

Haversine distance from raw coordinates

Given two points (φ₁, λ₁) and (φ₂, λ₂) in latitude and longitude, the Haversine formula returns the great-circle (shortest) distance over the Earth's surface: d = 2R·asin(√(sin²(Δφ/2) + cos φ₁·cos φ₂·sin²(Δλ/2))), with R = 6,371 km (Earth's mean radius) and angles in radians. Typical error stays under 0.5% because the Earth is an oblate spheroid, not a sphere. For sub-meter precision over thousands of kilometers, Vincenty's formula models the ellipsoid directly. Example: São Paulo (-23.5505, -46.6333) to Rio de Janeiro (-22.9068, -43.1729) → ~360 km straight line — actual driving distance is ~430 km.

Applications

Geofencing in ride-hailing (Uber) and delivery (iFood) to define service zones; "search by radius" on real-estate platforms (QuintoAndar); fleet tracking and dispatch; GPS proximity alerts; nearest-store lookups — anywhere two GPS coordinates need a fast, accurate distance.

FAQ

Why not Pythagoras on lat/lng? Latitude and longitude are angles, not Cartesian distances — one degree of longitude shrinks toward the poles. Pythagoras only works after a flat projection and over small areas.

Does it handle the date line? Yes — Haversine works for any pair of points on the globe, including antipodal pairs and crossings of the 180° meridian.

Straight-line vs driving distance? Haversine is "as the crow flies" — actual road distance is usually 20–40% longer due to road geometry.

Related Tools