Skip to content

Commit

Permalink
Updated dist and version.
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiocaccamo committed Sep 22, 2021
1 parent 60fcee8 commit 8345c9d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
7 changes: 7 additions & 0 deletions dist/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1952,6 +1952,13 @@ MathUtil = {
return (Math.abs(a - b) <= tolerance);
},

euclideanDistance: function(a, b) {
// https://en.wikipedia.org/wiki/Euclidean_distance#Higher_dimensions
return Math.sqrt(MathUtil.summation(a.map(function(value, index) {
return Math.pow(Math.abs(value - b[index]), 2);
})));
},

factorial: function(n)
{
var f = 1;
Expand Down
Loading

0 comments on commit 8345c9d

Please sign in to comment.