{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"haversine-distance"},"result":{"entity_type":"calculator","id":"haversine-distance","calculator_id":"haversine-distance","canonical_url":"https://tttkmbb.com/time/haversine-distance","name":"Haversine Distance Calculator","title":"Haversine Distance Calculator – Great-Circle Distance Between Two Latitude/Longitude Points","category":"time","category_name":"Time & Geography","tool_name":"calculate_haversine_distance","featured_mcp_tool":true,"description":"Computes the great-circle (as-the-crow-flies) distance between two points on a spherical Earth with the haversine formula, in kilometres, miles and nautical miles, together with the initial bearing, compass direction and the midpoint of the route.","use_when":"You need the straight-line distance between two GPS coordinates or cities, e.g. for flight distance, range checks or geofencing.","do_not_use_when":"You need road distance, or ellipsoidal accuracy better than about 0.5 % (use a geodesic method such as Vincenty or Karney on WGS-84); for bearings and compass points use compass-bearing.","inputs":[{"name":"lat1","label":"Latitude of point 1","type":"number","unit":"°","required":true,"min":-90,"max":90,"description":"Latitude of point 1 in decimal degrees (north positive, south negative).","example":-33.8688},{"name":"lon1","label":"Longitude of point 1","type":"number","unit":"°","required":true,"min":-180,"max":180,"description":"Longitude of point 1 in decimal degrees (east positive, west negative).","example":151.2093},{"name":"lat2","label":"Latitude of point 2","type":"number","unit":"°","required":true,"min":-90,"max":90,"description":"Latitude of point 2 in decimal degrees (north positive, south negative).","example":35.6762},{"name":"lon2","label":"Longitude of point 2","type":"number","unit":"°","required":true,"min":-180,"max":180,"description":"Longitude of point 2 in decimal degrees (east positive, west negative).","example":139.6503}],"outputs":[{"name":"distance_km","label":"Distance","type":"number","unit":"km","decimals":2,"description":"Great-circle distance on a sphere of radius 6,371.0088 km."},{"name":"distance_miles","label":"Distance","type":"number","unit":"mi","decimals":2,"description":"Same distance in statute miles (1 mi = 1.609344 km)."},{"name":"distance_nautical_miles","label":"Distance","type":"number","unit":"nmi","decimals":2,"description":"Same distance in nautical miles (1 nmi = 1.852 km)."},{"name":"central_angle_degrees","label":"Central angle","type":"number","unit":"°","decimals":4,"description":"Angle subtended at the Earth's centre."},{"name":"initial_bearing_degrees","label":"Initial bearing","type":"number","unit":"°","decimals":2,"description":"Forward azimuth at point 1, clockwise from true north (0–360)."},{"name":"compass_direction","label":"Compass direction","type":"string","decimals":4,"description":"16-point compass direction of the initial bearing."},{"name":"midpoint_lat","label":"Midpoint latitude","type":"number","unit":"°","decimals":4,"description":"Latitude of the great-circle midpoint."},{"name":"midpoint_lon","label":"Midpoint longitude","type":"number","unit":"°","decimals":4,"description":"Longitude of the great-circle midpoint."}],"input_schema":{"type":"object","properties":{"lat1":{"description":"Latitude of point 1 in decimal degrees (north positive, south negative). Unit: °.","type":"number","minimum":-90,"maximum":90,"examples":[-33.8688],"x-unit":"°"},"lon1":{"description":"Longitude of point 1 in decimal degrees (east positive, west negative). Unit: °.","type":"number","minimum":-180,"maximum":180,"examples":[151.2093],"x-unit":"°"},"lat2":{"description":"Latitude of point 2 in decimal degrees (north positive, south negative). Unit: °.","type":"number","minimum":-90,"maximum":90,"examples":[35.6762],"x-unit":"°"},"lon2":{"description":"Longitude of point 2 in decimal degrees (east positive, west negative). Unit: °.","type":"number","minimum":-180,"maximum":180,"examples":[139.6503],"x-unit":"°"}},"additionalProperties":false,"required":["lat1","lon1","lat2","lon2"]},"output_schema":{"type":"object","properties":{"distance_km":{"description":"Great-circle distance on a sphere of radius 6,371.0088 km. Unit: km.","type":"number","x-unit":"km"},"distance_miles":{"description":"Same distance in statute miles (1 mi = 1.609344 km). Unit: mi.","type":"number","x-unit":"mi"},"distance_nautical_miles":{"description":"Same distance in nautical miles (1 nmi = 1.852 km). Unit: nmi.","type":"number","x-unit":"nmi"},"central_angle_degrees":{"description":"Angle subtended at the Earth's centre. Unit: °.","type":"number","x-unit":"°"},"initial_bearing_degrees":{"description":"Forward azimuth at point 1, clockwise from true north (0–360). Unit: °.","type":"number","x-unit":"°"},"compass_direction":{"description":"16-point compass direction of the initial bearing.","type":"string"},"midpoint_lat":{"description":"Latitude of the great-circle midpoint. Unit: °.","type":"number","x-unit":"°"},"midpoint_lon":{"description":"Longitude of the great-circle midpoint. Unit: °.","type":"number","x-unit":"°"}}},"formula":"a = sin²(Δφ/2) + cos φ1 · cos φ2 · sin²(Δλ/2); c = 2 · atan2(√a, √(1−a)); d = R · c with R = 6371.0088 km; θ = atan2(sin Δλ · cos φ2, cos φ1 · sin φ2 − sin φ1 · cos φ2 · cos Δλ)","method":"Spherical model with the IUGG mean Earth radius; real distances on the WGS-84 ellipsoid differ by up to about 0.3–0.5 %. The bearing is the initial heading; on long routes it changes continuously along the great circle.","sources":[{"name":"Veness C – Calculate distance, bearing and more between latitude/longitude points (Movable Type Scripts)","url":"https://www.movable-type.co.uk/scripts/latlong.html","type":"reference","retrieved_at":"2026-09-24"},{"name":"Haversine formula (Wikipedia)","url":"https://en.wikipedia.org/wiki/Haversine_formula","type":"reference","retrieved_at":"2026-09-24"},{"name":"Earth radius – IUGG mean radius R1 = 6,371.0088 km (Wikipedia)","url":"https://en.wikipedia.org/wiki/Earth_radius","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"Sydney → Tokyo","inputs":{"lat1":-33.8688,"lon1":151.2093,"lat2":35.6762,"lon2":139.6503},"expected":{"distance_km":7825.83,"distance_miles":4862.74,"distance_nautical_miles":4225.61,"central_angle_degrees":70.3793,"initial_bearing_degrees":350.05,"compass_direction":"N (north)","midpoint_lat":0.9083,"midpoint_lon":145.4933},"url":"https://tttkmbb.com/api/v1/calculate/haversine-distance?lat1=-33.8688&lon1=151.2093&lat2=35.6762&lon2=139.6503"},{"name":"Movable Type example: 50°03′59″N 5°42′53″W → 58°38′38″N 3°04′12″W","inputs":{"lat1":50.06639,"lon1":-5.71472,"lat2":58.64389,"lon2":-3.07},"expected":{"distance_km":968.85,"distance_miles":602.02,"initial_bearing_degrees":9.12,"midpoint_lat":54.3623,"midpoint_lon":-4.5307},"url":"https://tttkmbb.com/api/v1/calculate/haversine-distance?lat1=50.06639&lon1=-5.71472&lat2=58.64389&lon2=-3.07"}],"faq":[{"q":"How accurate is the haversine formula?","a":"It is exact for a sphere and numerically stable for short distances. Because the Earth is an oblate ellipsoid, results differ from geodesic (Vincenty/Karney) distances by up to about 0.5 %, i.e. roughly 30 km on a 7,800 km flight."},{"q":"Which sign convention do the coordinates use?","a":"Decimal degrees: north and east positive, south and west negative. Use coordinate-converter to turn degrees-minutes-seconds into decimals first."}],"tags":["haversine","great circle distance","distance between coordinates","distance between cities","latitude longitude distance","flight distance"],"related":[{"calculator_id":"compass-bearing","reason":"Initial and final bearing with compass points for the same route."},{"calculator_id":"coordinate-converter","reason":"Convert DMS coordinates to the decimal degrees this calculator needs."},{"calculator_id":"length","reason":"Convert the distance to other length units."}],"links":{"html":"https://tttkmbb.com/time/haversine-distance","markdown":"https://tttkmbb.com/time/haversine-distance.md","json":"https://tttkmbb.com/time/haversine-distance.json","api":"https://tttkmbb.com/api/v1/calculate/haversine-distance","schema":"https://tttkmbb.com/api/v1/calculators/haversine-distance","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:46:38Z"}