Guth
NewsDocs
Page actions
View as Markdown ↗
Explore MCP tools ↗

instrument mechanism / verified-clean

Great-Circle Distance (Haversine) mechanism

The inspectable method record for Great-Circle Distance (Haversine), kept separate from implementation and qualification.

Status: VERIFIED_CLEANLifecycle: verified-clean

Model scope

The supplied haversine expression correctly computes spherical great-circle distance, subject to explicit radians and radius assumptions. The specification fails verification because it claims an initial bearing without supplying its formula and leaves the advertised distance units and 'WGS84 mean radius' definition ambiguous.

  • The haversine distance formula is correct for a spherical model, but the advertised initial bearing output has no bearing formula. A standard initial-bearing formula is θ=atan2(sin(Δλ)·cosφ2, cosφ1·sinφ2−sinφ1·cosφ2·cosΔλ), normalized to 0–360°.
  • The radius and output unit are not parameters, although the instrument advertises km/mi/nm outputs. The implementation must define a fixed radius and conversion rules.
  • The phrase 'Earth mean radius (WGS84)' is ambiguous: WGS84 defines an ellipsoid, not one uniquely named mean radius. A common spherical choice is the authalic/mean radius R=6371.0088 km.

Units and conventions

  • Inputs lat1, lon1, lat2, lon2 are decimal degrees and must be converted to radians before evaluating trigonometric functions.
  • Test-vector distances use R=6371.0088 km, the commonly used WGS84-compatible Earth authalic radius.
  • Distances in miles or nautical miles require explicit conversions: 1 km=0.621371192237 mi and 1 km=0.539956803455 nm.
  • Longitude differences should be normalized consistently, although the haversine expression itself is periodic.

Inspectable vector

One of 4 source-bound review vectors:

{
  "inputs": {
    "lat1_deg": 0,
    "lon1_deg": 0,
    "lat2_deg": 0,
    "lon2_deg": 0,
    "radius_km": 6371.0088
  },
  "expected_outputs": {
    "distance_km": 0,
    "initial_bearing_deg": null
  },
  "working": "Δφ=0 and Δλ=0. a=sin²(0/2)+cos(0)·cos(0)·sin²(0/2)=0+1·1·0=0. atan2(√a,√(1−a))=atan2(0,1)=0. d=2·6371.0088·0=0 km. The initial bearing is undefined because the two points coincide."
}

Failure boundary

  • Validate latitude range −90° to 90° and longitude range, typically −180° to 180° or a clearly documented equivalent.
  • Floating-point rounding can produce a slightly invalid a outside [0,1]; clamp a to [0,1] before sqrt to avoid NaN.
  • The distance formula is safe for coincident points, but initial bearing is undefined for coincident points and antipodal points.
  • Initial bearing is numerically unstable or undefined at exact pole configurations and must have documented behavior.
  • A spherical distance can differ from an ellipsoidal geodesic distance by roughly up to 0.5% depending on the route; it must not be presented as an exact WGS84 ellipsoidal geodesic.
  • If a radius is configurable, reject zero or negative radii.

Other records

Sources and evidence

These pointers bind the page to evidence. They do not grant authority or collapse verification into deployment.

  • VERIFIED_LEDGER.json
  • evidence-tranche4/tranche4-results.json