UNPKG

@2d-game-grid/square

Version:
12 lines (11 loc) 379 B
"use strict"; 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); }