1.0.10 • Published 9 years ago
get-euclidean-distance v1.0.10
get-euclidean-distance
Calculate euclidean distance in arbitrary dimensions
getEuclideanDistance(d) ⇒ Number
Find the euclidean distance between two points in arbitrary dimensions.
Kind: global function
Returns: Number - The euclidean distance between the points.
| Param | Type | Description |
|---|---|---|
| d | Array.<Number> | The distances between two points in each of the points' dimensions. |
Example
const a = {
x: 0.5,
y: 0.1,
};
const b = {
x: 0.25,
y: 0.2,
};
getEuclideanDistance([
b.x - a.x,
a.y - b.y,
]);
// → 0.26925824035672524Scripts
test – run the tests
npm run testcoverage – generate and view code coverage as HTML
npm run coveragelint – lint the codebase
npm run lintreadme – generate the README
npm run readmecompile – compile the code
npm run compileLicense
MIT @ Flip