diff options
Diffstat (limited to 'animism-align/frontend/app/utils/index.js')
| -rw-r--r-- | animism-align/frontend/app/utils/index.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/animism-align/frontend/app/utils/index.js b/animism-align/frontend/app/utils/index.js index 6777a5e..d6c1a16 100644 --- a/animism-align/frontend/app/utils/index.js +++ b/animism-align/frontend/app/utils/index.js @@ -95,10 +95,11 @@ export const dist = (x1, y1, x2, y2) => Math.sqrt(Math.pow(x1 - x2, 2) + Math.po export const mod = (n, m) => n - (m * Math.floor(n / m)) export const angle = (x1, y1, x2, y2) => Math.atan2(y2 - y1, x2 - x1) export const lerp = (n,a,b) => (b-a)*n+a +export const floatEQ = (a,b) => ((a*10|0) === (b*10|0)) export const floatLT = (a,b) => ((a*10|0) < (b*10|0)) -export const floatLTE = (a,b) => ((a*10|0) === (b*10|0) || floatLT(a,b)) +export const floatLTE = (a,b) => (floatEQ(a,b) || floatLT(a,b)) export const floatGT = (a,b) => ((a*10|0) > (b*10|0)) -export const floatGTE = (a,b) => ((a*10|0) === (b*10|0) || floatGT(a,b)) +export const floatGTE = (a,b) => (floatEQ(a,b) || floatGT(a,b)) export const floatInRange = (a,b,c) => floatLTE(a, b) && floatLT(b, c) export const simpleArraysEqual = (a, b) => JSON.stringify(a) === JSON.stringify(b) |
