euclidean-distance

Calculate the Euclidean distance been two points in 2D/3D/nD space.

npm install euclidean-distance
1 downloads in the last day
5 downloads in the last week
12 downloads in the last month

Euclidean Distance

euclidean-distance is a browserify-friendly npm module for calculating the Euclidean distance been two points in 2D or 3D space.

Installation

npm install euclidean-distance --save

Usage

var d = require('euclidean-distance');

d([0,0], [1,0]);
// 1

d([0,0], [3,2]);
// 3.605551275463989

d([-7,-4,3], [17, 6, 2.5]);
// 26.004807247892

Test

npm test

License

WTFPL

npm loves you