-
> Find how far you are into the first range, scale that distance by the ratio of sizes of the ranges, and that's how far you should be into the second range.
-
```plain text
low2 + (value - low1) * (high2 - low2) / (high1 - low1)
```
-
-
```typescript
export function remap(value: number, min1: number, max1: number, min2: number, max2: number) {
return min2 + ((value - min1) * (max2 - min2)) / (max1 - min1);
}```
-