I have an array of integers from [0 .. 255].
I’d like to modify the array so that there are still 256 numbers, but the numbers start from 100 and move up to 255. This means that many integers will be repeating (i.e. [100,100,101,101,102 …])
Any ideas as to how I can do this? Sorry, I know this is probably a simple problem, but it’s really boggling my mind right now…
Thanks!
Note: a solution provided in python, pseudo-code, or javascript would be nice. =)
Python:
Sanity check:
This is linear interpolation. The multiply and divide essentially convert the index range into a linear ramp from 0.0 to 1.0. This is applied as a scale to the desired range width of values, and added to the minimum value.