Shapes & spaces

Eikonal travel time calculator on a grid with variable propagation speed

Approximate first-arrival times on a positive-speed grid with an upwind fast-marching update.

Your numbers

Valid JSON. Seed rows [row,column]. Positive node speeds; no obstacle support.
Valid JSON; preserve the shown array or object structure.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

The Eikonal equation describes the first-arrival time of a front whose local speed is supplied across a domain. Faster regions can make a longer geometric route arrive earlier. The result is therefore different from measuring straight-line distance between two points.

THE FORMULAIsotropicnode-speedEikonal|gradT|F=1, F>0,multipleT0seeds. Firstorderfastmarchingbinaryheap accepted/trial/far; localupdatefromminimumacceptedxneighbor a andyneighborb. s=h/F (equalsquaregrid); ifoneaxisfinite usea+s; both ifabs(a-b)>=s usemin+s else(a+b+sqrt(2s²-(a-b)²))/2. Useonlyacceptedneighbors,heapstaleentrieschecked. Obstaclesmaskneverupdate; unreachableInfinity notfinite0. Residualupwinddiagnostics, gridapproxnotexactEuclidean. Nonuniformgridneedsdifferentquadratic nothformula.

A worked example

With the prefilled inputs, maximumArrival = 3.1185648369114483. Seed rows [row,column]. Positive node speeds; no obstacle support.

Good to know

First-order isotropic upwind fast marching with linear minimum selection (not a heap); approximate node travel times, one common grid spacing and no obstacles.

Travel time through a speed field

The Eikonal equation describes the first-arrival time of a front whose local speed is supplied across a domain. Faster regions can make a longer geometric route arrive earlier. The result is therefore different from measuring straight-line distance between two points.

This page uses an isotropic speed at grid nodes and one or more starting seeds. The front expands under a first-order upwind discretization. It does not model direction-dependent speed, wave interference or a fully resolved physical wave equation.

Eikonal travel time calculator on a grid with variable propagation speedEikonal: a first-order two-axis updateseed: T = 0T = 1T = 1T = 1 + 1/√2F = h = 1; diagonal time ≈ 1.707107, not √2
Scroll across to see the full diagram.
The diagonal node combines two accepted neighbor times equal to1. The upwind quadratic gives1+1/√2, explicitly distinguishing this finite-grid result from exact continuous Euclidean distance.

Compare with the Geodesic distance calculator on triangular surface mesh. Compute firstarrivalTwith|gradT|=1/Fonagridwithvariablepositive speed; surfacegeodesiclengthonatriangularmesh assumesanothermetric/datatype.

Positive grids and zero-time seeds

Seed rows [row,column]. Positive node speeds; no obstacle support.Enter a rectangular grid with two through eighty rows and columns, a positive common spacing and a strictly positive speed at every node. Seeds are row-column integer pairs, with one through one hundred entries accepted. Their initial arrival time is zero; an arbitrary nonzero start-time field is not part of this input format.

This release has no obstacle mask and does not accept zero-speed walls. Every node in the connected rectangular positive-speed grid is expected to become reachable. Obstacles require a different supported domain input rather than overloading an invalid speed, and the plotted row-column orientation must remain consistent with the entered matrix.

Fast marching accepts times in order

Fast marching maintains a set of accepted nodes and tentative arrival values. The smallest tentative arrival is accepted next, and neighboring candidates are updated from already accepted information. The present implementation finds that minimum by a direct linear scan rather than a binary heap. This changes performance, not the upwind local equation; the selected node is then accepted permanently and its unsettled neighbors are updated.

This causality order distinguishes the method from an arbitrary repeated matrix sweep. Using unaccepted neighboring values in a nominal fast-marching update can break its guarantee that accepted times will not later decrease under the selected discretization.

The local upwind quadratic

At a node, take the smallest accepted neighbor time on each coordinate axis. If only one axis contributes, advance by the spacing divided by local speed. When both contribute closely enough, solve the two-axis upwind quadratic instead.

If the two neighbor times differ too much, the larger one cannot participate in the causal root and the one-axis formula is used. Choosing the wrong quadratic root or always averaging both neighbors can create an arrival earlier than its supporting data.

A diagonal-node worked check

On a two-by-two unit-spaced grid with speed one, start at the lower-left node. Its horizontal and vertical neighbors both have arrival time one. The remaining diagonal node combines those equal accepted values.

The first-order update gives one plus one over square root of two, approximately 1.707106781. This is neither the exact Euclidean distance square root of two nor the Manhattan graph distance two. The example makes the particular grid approximation explicit.

Reading times and contour lines

A static contour figure shows equal-arrival curves and the seed locations. The full positive grid is the domain; there is no obstacle overlay in this release. A gradient-descent trace through the computed time field can illustrate a route, but it needs separate interpolation and tie handling if offered.

A speed change bends the arrival contours because neighboring routes compete. Dense contours indicate rapidly changing time, not automatically low physical density or high uncertainty. The color scale should use time units and retain readable labels in both site themes.

Accuracy and unreachable regions

Refining the grid changes the directional discretization error even for uniform speed. Comparing coarse and fine arrival fields helps separate that approximation from errors in node acceptance or local root selection. The result reports the arrival grid, its maximum time and whether accepted times were nondecreasing.

The page reports approximate first-arrival times for its stated first-order scheme. It should not claim exact shortest continuous paths or exact Euclidean distances. Zero or nonfinite speeds are invalid, and this implementation does not claim to compute disconnected or masked unreachable regions. First-order isotropic upwind fast marching with linear minimum selection (not a heap); approximate node travel times, one common grid spacing and no obstacles.

A few questions, answered

Why is the diagonal example not square root of two?

The first-order upwind grid equation has a discretization error; its value is not the exact continuous distance.

Can zero speed represent a wall?

No; every grid speed must be positive and this release has no obstacle-mask input.

Does the method allow several starting points?

Yes; the earliest front from the seed set determines each reachable arrival.

Is this the same as shortest paths on grid edges?

No; the two-axis upwind update differs from adding edge lengths in a graph.

Find your calculator

Start typing to explore the library.