#69 : Split fns

This commit is contained in:
Vadim
2021-09-10 12:03:56 +03:00
parent 2949683d1a
commit f911338c4b
7 changed files with 636 additions and 448 deletions

View File

@@ -4,3 +4,8 @@ export const getDistance = (p1, p2) => {
return Math.sqrt((xDist * xDist) + (yDist * yDist));
}
export function getValueInRange(min, value, max) {
// if (min > max) throw new Error(`min (${min}) should be more than or equal to max (${max})`)
return Math.max(min, Math.min(value, max))
}