UNPKG

@2d-game-grid/square

Version:
9 lines (8 loc) 262 B
/** * @param start The start coordinate * @param end The end coordinate * @returns The distance between the given coordinates */ export function euclideanDistance(start, end) { return Math.sqrt((start.col - end.col) ** 2 + (start.row - end.row) ** 2); }