ForHosting KIT · Travel & geography

Great-circle interpolation

Halfway along the great circle from 40.7128, -74.006 to 51.5074, -0.1278 lies 52.3684395875, -41.2903073562, further north than either end. Choose any fraction from 0 to 1 to place a point on the route and see its distance from the start. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Lat1
40.7128
Lon1
-74.006
Lat2
51.5074
Lon2
-0.1278
Fraction
0.5
You get
Earth radius m
6,371,000
Angular distance deg
50.0942115601
Total distance m
5,570,222.17974
Distance from start m
2,785,111.08987

Fraction zero returns the start, fraction one returns the end, and one half returns the geodesic midpoint.

How great-circle intermediate points are computed

The central angle δ between them follows from the spherical law of cosines: cos δ equals sin φ1 sin φ2 plus cos φ1 cos φ2 cos(λ2 − λ1), with a clamp into negative one through positive one before arccosine so floating-point noise never leaves the domain. When sin δ is effectively zero and the points are the same, every fraction returns the start coordinate.

Otherwise compute the classic slerp weights A equals sin of one minus f times δ over sin δ, and B equals sin of f times δ over sin δ. The intermediate unit vector is A times n1 plus B times n2; latitude is the arctangent of z over the horizontal hypotenuse, and longitude is the two-argument arctangent of y over x, then folded into the open–closed range around the antimeridian.

Where great-circle interpolation shows up in real work

Aviation and maritime training constantly assign intermediate-position problems along great-circle tracks, and students need a trusted oracle that returns lat/lon at fraction f without chart dividers. GIS and logistics teams densify long flight or shipping legs into evenly spaced samples for heatmaps, fuel estimates, and geofence corridors before committing to full ellipsoid libraries. Search-and-rescue planning, hiking guides, and orienteering curricula place checkpoints by fraction along a planned arc between two known fixes.

Game and simulation engines animate entities along spherical routes using the same closed form so client and server stay aligned without shipping a heavy geodesic package. Cartographers building animated arcs on web maps sample intermediate points at regular fractions to draw smooth geodesic polylines that do not cut through the Earth on a flat projection.

If you later need the direct destination problem from a bearing and distance, rhumb-line sailing, antipode coordinates, or full WGS84 Vincenty geodesics on the ellipsoid, treat those as separate search intents and landings rather than overloading this great-circle interpolation page.

Navigation training and mid-track fixes

Compute intermediate lat/lon at fraction f along a great-circle leg so instructors and auto-graders share one ground truth for mid-ocean and mid-air drills.

Densify flight and shipping routes

Sample evenly spaced waypoints between origin and destination for maps, fuel models, and corridor geofences without a full ellipsoid stack.

What formula does this great-circle interpolation use?

Spherical linear interpolation (slerp): central angle δ from the spherical law of cosines, weights A = sin((1−f)δ)/sin δ and B = sin(fδ)/sin δ, intermediate unit vector A·n1 + B·n2, then φ and λ via atan2.

What happens if fraction is outside 0 to 1?

Fraction must be in the closed range [0, 1]. Values outside that range are not wrapped or clamped.

Is linear averaging of lat and lon correct?

No. Averaging latitudes and longitudes independently ignores spherical geometry and longitude wrap. This tool interpolates on the unit sphere so every sample lies on the great-circle arc.

What does it cost?

The browser tool is free and runs locally.

What happens if the two points are exactly opposite each other?

The calculation is refused. For two antipodal points the great circle through them is not unique, so there is no single route to follow and no intermediate point to return.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/geo/geodesic-interpolate

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/geo/geodesic-interpolate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"lat1":40.7128,"lon1":-74.006,"lat2":51.5074,"lon2":-0.1278,"fraction":0.5}'
{
  "lat1": 40.7128,
  "lon1": -74.006,
  "lat2": 51.5074,
  "lon2": -0.1278,
  "fraction": 0.5
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "geo.geodesic_interpolate",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

Great-circle interpolation answers a simple navigation question: given two fixed latitude and longitude endpoints and a fraction from zero to one, where is the intermediate point that sits that fraction of the way along the shorter spherical arc connecting them? Linearly blending latitude and longitude independently is wrong because meridians converge and longitudes wrap; the correct construction treats the Earth as a sphere, converts each endpoint into a unit vector, and performs spherical linear interpolation (slerp) so every intermediate sample lies on the unique great circle through the two points. Values outside the closed unit interval are rejected with a clear invalid_input error instead of wrapping or inventing a point beyond the segment.

How great-circle intermediate points are computed

Convert both endpoints from decimal degrees into radians and form the unit vectors n1 and n2 on the sphere. When the points are antipodal, sin δ is also zero but the plane of the great circle is not unique, so the request fails with invalid_input rather than silently picking an arbitrary path. The entire pipeline is deterministic floating-point arithmetic: no random seeds, no wall-clock timestamps, no network calls, and no model drift, so identical inputs always produce identical JSON suitable for automated tests and answer keys.

What you send and what you get back

Send five required finite numbers under the fields lat1, lon1, lat2, lon2, and fraction. Latitudes must lie in the closed interval from negative ninety to positive ninety degrees with north positive. Longitudes must lie in the closed interval from negative one hundred eighty to positive one hundred eighty degrees with east positive. Fraction must lie in the closed interval from zero to one inclusive; any value strictly outside that range fails with invalid_input and is not charged. Optional aliases latitude1, longitude1, latitude2, longitude2, and f are accepted for convenience. You may also pass earth_radius_m as a finite positive sphere radius when reporting arc lengths—the intermediate latitude and longitude on the unit sphere do not depend on radius, but total_distance_m and distance_from_start_m scale with it; the default is the conventional mean Earth radius of six million three hundred seventy-one thousand meters. On success the response echoes cleaned endpoints and fraction, the angular separation of the endpoints in degrees, total arc length and distance from the start in meters, an intermediate object with latitude and longitude, flat intermediate_latitude and intermediate_longitude fields for simple clients, the method tag great_circle_slerp, and a compact formula string for documentation. Classic checks include New York to London at fraction one half for a mid-Atlantic sample, equator quarter points, and fraction zero or one returning the exact endpoints. Pricing for successful API calls is the published base of $0.002 per item; validation failures do not consume prepaid balance.

Where great-circle interpolation shows up in real work

Because this capability is a pure parse engine, API pricing is the published base of $0.002 per successful item and failed validation does not consume balance.

Animated geodesic arcs and simulations

Drive map animations and game entities along spherical paths by stepping fraction from 0 to 1 with identical browser and API results.

What about antipodal endpoints?

When the two points are opposite (or nearly opposite) on the sphere, infinitely many great circles connect them. The request fails with invalid_input so callers choose a defined path instead.

Read the full KIT documentation →