Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

Grid Movement Distance

Compare Manhattan and diagonal-enabled path costs on an obstacle-free grid.

Game Design workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulaOrthogonal-only cost = (dx+dy)*straight; Diagonal-enabled cost = min(dx,dy)*min(diagonal,2*straight)+abs(dx-dy)*straight

Worked example

Inputs

Horizontal displacement
3 cells
Vertical displacement
4 cells
Orthogonal movement cost
1 cost
Diagonal movement cost
1.5 cost

Expected results

Orthogonal-only cost
7 cost
Diagonal-enabled cost
5.5 cost

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Compare Manhattan and diagonal-enabled path costs on an obstacle-free grid.
  2. Set horizontal displacement, vertical displacement, orthogonal movement cost, diagonal movement cost in the indicated units.
  3. Calculate and compare orthogonal-only cost, diagonal-enabled cost.

Try this example

{
  "dx": 3,
  "dy": 4,
  "straight": 1,
  "diagonal": 1.5
}

Accuracy and scope

Idealized educational model. Enter measured values in the displayed units; real systems may require additional corrections. User-defined game-rule arithmetic; no current game mechanics or search-volume claims.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.