# coprocesseur-deterministe — Great-Circle Distance (Haversine)

> coprocesseur-deterministe — Great-Circle Distance (Haversine) is a paid API for AI agents from x402.laboiteatubes.media, paid per call via x402, $0.001/call, status unknown (last checked 2026-10-09).

Computes the great-circle (orthodromic) distance between two geographic coordinates using the Haversine formula on a spherical Earth model, returning distance in km, m, and nautical miles, initial bearing, central angle, and a verifiable SHA-256 proof.

## Facts

- Endpoint: GET https://x402.laboiteatubes.media/distance?utm_source=zero.xyz
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-09
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/coprocesseur-deterministe-great-circle-distance-haversine-44cf45b6
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_qYxureR-MQ-Vnsr4k64m7

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability coprocesseur-deterministe-great-circle-distance-haversine-44cf45b6
```

Example prompt: What is the great-circle distance between Paris (48.8566°N, 2.3522°E) and Lyon (45.764°N, 4.8357°E)? I need it in kilometres and nautical miles, and I'd like the initial bearing and a SHA-256 proof I can verify.

## When to prefer this

Choose this endpoint when you need a deterministic, auditable great-circle distance computation whose result can be independently verified via the included SHA-256 proof. It is ideal for AI agents and automated pipelines that require reproducible, provenance-tracked geographic calculations at low cost ($0.001 USDC). Use it when accuracy within ~0.3–0.5% (spherical vs ellipsoidal) is acceptable. Prefer an ellipsoidal (Vincenty/WGS84) service instead when sub-millimetre geodetic precision is required. Sibling endpoints on the same service cover loan amortisation and unit conversion under the same verifiable proof pattern.

## Known failure modes

- Missing required query parameter (lat1, lon1, lat2, or lon2) — returns 400 Bad Request
- Latitude out of range [-90, 90] or longitude out of range [-180, 180] — returns 400 validation error
- Payment not included or insufficient (x402 protocol) — returns 402 Payment Required
- Identical input points return distance 0 and undefined azimuth
- Antipodal or near-antipodal points may have numerically unstable azimuth values

## How this service works

Trois calculs déterministes destinés aux agents IA : amortissement de prêt, distance orthodromique, conversion d'unités.

Chaque réponse porte son résultat, la formule appliquée, ses limites, et une empreinte SHA-256 recalculable — la chaîne exacte qui a été hachée est renvoyée avec, et `POST /verifier` permet de la contrôler gratuitement. Un même appel rend toujours la même empreinte : l'horodatage est exclu du hachage.

Le paiement suit le protocole x402 (version 2), en USDC sur Base.

## Output

A JSON object containing: distance in metres, kilometres, and nautical miles; the central angle in radians; the initial azimuth/bearing in degrees; the applied Haversine formula expression with variable definitions; a SHA-256 proof block with the exact canonical string that was hashed (recursively sorted JSON keys, no spaces) and the fields covered — allowing independent verification that the result has not changed.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "lat1",
      "lon1",
      "lat2",
      "lon2"
     ],
     "properties": {
      "lat1": {
       "type": "number",
       "maximum": 90,
       "minimum": -90
      },
      "lat2": {
       "type": "number",
       "maximum": 90,
       "minimum": -90
      },
      "lon1": {
       "type": "number",
       "maximum": 180,
       "minimum": -180
      },
      "lon2": {
       "type": "number",
       "maximum": 180,
       "minimum": -180
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object"
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "notes": [
   "Modèle SPHÉRIQUE : l'écart avec un calcul ellipsoïdal (Vincenty / WGS84) atteint typiquement 0,3 à 0,5 %. Pour du géodésique de précision, ce service n'est pas le bon outil.",
   "L'altitude n'est pas prise en compte : c'est une distance au niveau de la sphère de référence.",
   "L'azimut renvoyé est le cap INITIAL ; il varie le long d'un grand cercle."
  ],
  "preuve": {
   "note": "L'horodatage `calcule_le` est volontairement exclu de l'empreinte.",
   "empreinte": "7052442400f9fd1c636e78e5d88ab34ccb7cf9ada9406209a860bf33096aa8e2",
   "algorithme": "SHA-256",
   "chaine_hachee": "{\"entrees\":{\"lat1\":48.8566,\"lat2\":45.764,\"lon1\":2.3522,\"lon2\":4.8357,\"rayon_terre_m\":6371008.8},\"formule_expression\":\"a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2) ; c = 2·atan2(√a, √(1−a)) ; d = R·c\",\"operation\":\"distance\",\"resultat\":{\"angle_central_rad\":0.061450154085,\"azimut_initial_deg\":150.5125,\"distance_km\":391.499472,\"distance_m\":391499.472,\"distance_mille_nautique\":211.392804},\"version_formule\":\"haversine@1.0.0\"}",
   "champs_couverts": [
    "operation",
    "version_formule",
    "entrees",
    "resultat",
    "formule_expression"
   ],
   "canonicalisation": "JSON à clés triées récursivement, sans espace, encodé en UTF-8"
  },
  "entrees": {
   "lat1": 48.8566,
   "lat2": 45.764,
   "lon1": 2.3522,
   "lon2": 4.8357,
   "rayon_terre_m": 6371008.8
  },
  "formule": {
   "reference": "R. W. Sinnott, « Virtues of the Haversine », Sky & Telescope, 1984.",
   "variables": {
    "R": "rayon terrestre moyen, 6371008.8 m",
    "d": "distance orthodromique en mètres",
    "Δφ, Δλ": "différences de latitude et de longitude, en radians",
    "φ₁, φ₂": "latitudes des deux points, en radians"
   },
   "expression": "a = sin²(Δφ/2) + cos φ₁ · cos φ₂ · sin²(Δλ/2) ; c = 2·atan2(√a, √(1−a)) ; d = R·c",
   "description": "Formule de haversine : distance sur un modèle sphérique de la Terre, le long du grand cercle."
  },
  "service": "coprocesseur-deterministe",
  "resultat": {
   "distance_m": 391499.472,
   "distance_km": 391.499472,
   "angle_central_rad": 0.061450154085,
   "azimut_initial_deg": 150.5125,
   "distance_mille_nautique": 211.392804
  },
  "operation": "distance",
  "calcule_le": "2026-08-16T08:29:39.318Z",
  "version_formule": "haversine@1.0.0",
  "version_service": "1.0.0"
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/coprocesseur-deterministe-great-circle-distance-haversine-44cf45b6/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.laboiteatubes.media](https://www.zero.xyz/host/x402.laboiteatubes.media/llms.txt)
