0
0
GGGiovanny Gongora
Calculates the distance between two points in any number of dimensions.
const euclideanDistance = (a: Array<number>, b: Array<number>) =>
Math.hypot(...Object.keys(a).map(key => b[key] - a[key]));
0
0
GGGiovanny Gongora
Calculates the distance between two points in any number of dimensions.
const euclideanDistance = (a: Array<number>, b: Array<number>) =>
Math.hypot(...Object.keys(a).map(key => b[key] - a[key]));