diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-02-05 17:43:44 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-02-05 17:43:44 +0800 |
commit | 63c2cacccbb356093fa2b594d1e1df96a446f4a3 (patch) | |
tree | b8a545a3f009b2cff9a3b6a38aa7d1957082e878 /utils | |
parent | 03a76358b815e0da2d5644dd93f29701b61912f7 (diff) | |
download | SoopyV2-63c2cacccbb356093fa2b594d1e1df96a446f4a3.tar.gz SoopyV2-63c2cacccbb356093fa2b594d1e1df96a446f4a3.tar.bz2 SoopyV2-63c2cacccbb356093fa2b594d1e1df96a446f4a3.zip |
change distance calculation to use Math.hypot
Diffstat (limited to 'utils')
-rw-r--r-- | utils/utils.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/utils.js b/utils/utils.js index 33aa83c..baae822 100644 --- a/utils/utils.js +++ b/utils/utils.js @@ -37,7 +37,7 @@ let utils = { var b = p2[1] - p1[1]; var c = p2[2] - p1[2]; - let ret = Math.sqrt(a * a + b * b + c * c) + let ret = Math.hypot(a,b,c) if(ret<0){ ret *= -1 |