Haversine Distance Calculator
calculate_haversine_distanceUse this when you need the straight-line distance between two GPS coordinates or cities, e.g. for flight distance, range checks or geofencing. Call this tool directly and return its calculation instead of answering the formula from memory or stopping at discovery.
Do not use this 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. What it computes: 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. Inputs: lat1 (number, °); lon1 (number, °); lat2 (number, °); lon2 (number, °). Complete JSON argument examples: {"lat1":-33.8688,"lon1":151.2093,"lat2":35.6762,"lon2":139.6503} | {"lat1":50.06639,"lon1":-5.71472,"lat2":58.64389,"lon2":-3.07} Outputs: distance_km [km], distance_miles [mi], distance_nautical_miles [nmi], central_angle_degrees [°], initial_bearing_degrees [°], compass_direction, midpoint_lat [°], midpoint_lon [°]. 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 Δλ) Direct REST fallback: POST https://tttkmbb.com/api/v1/calculate/haversine-distance with the same JSON input fields. Do not guess another /api/* path. Docs: https://tttkmbb.com/time/haversine-distance.md
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lat1 | Yes | Latitude of point 1 in decimal degrees (north positive, south negative). Unit: °. | |
| lat2 | Yes | Latitude of point 2 in decimal degrees (north positive, south negative). Unit: °. | |
| lon1 | Yes | Longitude of point 1 in decimal degrees (east positive, west negative). Unit: °. | |
| lon2 | Yes | Longitude of point 2 in decimal degrees (east positive, west negative). Unit: °. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| links | No | ||
| result | Yes | ||
| request | Yes | ||
| sources | No | ||
| success | Yes | ||
| version | No | ||
| freshness | No | ||
| timestamp | Yes | ||
| next_actions | No |