Calculate the Euclidean distance been two points in 2D/3D/nD space.
between two vectors in n-dimensional space.
npm install euclidean-distance --save
var distance = require'euclidean-distance'distance00 10// 1distance00 32// 3.605551275463989distance-7-43 17 6 2.5// 26.004807247892distance513173252171 2026752832310// 34.17601498127012
For some purposes you may actually be looking for the square of the distance. For that, you can use:
var distanceSquared = require'euclidean-distance/squared'distanceSquared00 20// 4