Euclidean ruler distance between two cells.
The counterpart to roguelike's chebyshevDistance, which charges a diagonal the same as a step: use this one when the true straight-line distance matters (blast falloff, census radius) and that one for roguelike range and movement.
roguelike
chebyshevDistance
import { euclidean } from '@datamoc/mwg/core';euclidean({ x: 0, y: 0 }, { x: 3, y: 4 }); // 5 Copy
import { euclidean } from '@datamoc/mwg/core';euclidean({ x: 0, y: 0 }, { x: 3, y: 4 }); // 5
Euclidean ruler distance between two cells.
The counterpart to
roguelike'schebyshevDistance, which charges a diagonal the same as a step: use this one when the true straight-line distance matters (blast falloff, census radius) and that one for roguelike range and movement.