let distance = hypotenuseLength(reIndexedX, reIndexedY); function hypotenuseLength(x, y) { return Math.sqrt(Math.pow(x, 2) + Math.pow(y, 2)); }
let distance = Math.hypot(reIndexedX, reIndexedY);