Euclidean Distance
euclidean-distance is a browserify-friendly npm module for calculating the Euclidean distance
between two vectors in n-dimensional space.
Installation
npm install euclidean-distance --save
Usage
var distance = // 1 // 3.605551275463989 // 26.004807247892 // 34.17601498127012
For some purposes you may actually be looking for the square of the distance. For that, you can use:
var distanceSquared = // 4
Test
npm test