@2d-game-grid/square
Version:
A simple square grid made for games
12 lines (11 loc) • 379 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.euclideanDistance = euclideanDistance;
/**
* @param start The start coordinate
* @param end The end coordinate
* @returns The distance between the given coordinates
*/
function euclideanDistance(start, end) {
return Math.sqrt((start.col - end.col) ** 2 + (start.row - end.row) ** 2);
}