Go to the source code of this file.
|
| long | map_value (long x, long in_min, long in_max, long out_min, long out_max) |
| | Maps a value of a range of values to another range of values.
|
- Authors
- MarioS271
- Copyright
- MIT License
◆ map_value()
| long map_value |
( |
long | x, |
|
|
long | in_min, |
|
|
long | in_max, |
|
|
long | out_min, |
|
|
long | out_max ) |
|
inline |
Maps a value of a range of values to another range of values.
- Returns
- The mapped value
- Parameters
-
| x | Value to map (from input range) |
| in_min | Lower bound of input range (inclusive) |
| in_max | Upper bound of input range (inclusive) |
| out_min | Lower bound of output range (inclusive) |
| out_max | Upper bound of output range (inclusive) |