Spaces:
Paused
Paused
Download client/src/lib/mapRange.ts from PatternBreak/FacePoke: direct link, hf CLI and curl.
- Browser
- Download file 282 Bytes
-
https://huggingface.co/spaces/PatternBreak/FacePoke/resolve/main/client/src/lib/mapRange.ts
- Command line
-
hf download hf://spaces/PatternBreak/FacePoke/client/src/lib/mapRange.ts
-
curl -L -o mapRange.ts https://huggingface.co/spaces/PatternBreak/FacePoke/resolve/main/client/src/lib/mapRange.ts
282 Bytes
| // Function to map a value from one range to another | |
| export const mapRange = (value: number, inMin: number, inMax: number, outMin: number, outMax: number): number => { | |
| return Math.min(outMax, Math.max(outMin, ((value - inMin) * (outMax - outMin)) / (inMax - inMin) + outMin)); | |
| }; | |