euclideanDistance
Calculates the distance between two points in any number of dimensions.
- Use Object.keys()andArray.prototype.map()to map each coordinate to its difference between the two points.
- Use Math.hypot()to calculate the Euclidean distance between the two points.