-
Notifications
You must be signed in to change notification settings - Fork 0
magnitude
Subhajit Sahu edited this page Aug 8, 2022
·
2 revisions
Calculate the magnitude (length) of a vector.
function magnitude(xs)
// xs: vector ([x, y, z, ...])
const xmath = require('extra-math');
xmath.magnitude([5, 9]);
// → 10.295630140987
xmath.magnitude([10, 2, -1]);
// → 10.246950765959598