octile Distance To
Octile3D distance: the exact minimum cost from this voxel to other on a uniform-cost Moore-26 movement grid with orthogonal step cost 1, face-diagonal cost √2, and body- diagonal cost √3. The natural admissible heuristic for A* on such a grid.
Given sorted absolute deltas dMin ≤ dMid ≤ dMax, the optimal path uses:
dMinbody-diagonal steps (all three axes change),dMid - dMinface-diagonal steps (two axes change),dMax - dMidorthogonal steps (one axis changes).
octile3D = dMin * √3 + (dMid - dMin) * √2 + (dMax - dMid) * 1Content copied to clipboard