I’m trying to come up with a formular which converts one number spectrum into another.
For example:
0 - 800 to -1 - 1
Where 0 = -1, 200 = -0.5, 400 = 0, 600 = 0.5, 800 = 1, and so on.
The difficult part for me seems to be the negative range.
If your ranges are
a0, a1andb0, b1, then you wantxto go toBasically,
(x-a0)is how far over you are from the lower side of the first range, and(x-a0)/(a1-a0)divides by the width of the range so the number is now normalized to[0, 1]. After that, we multiply by(b1-b0)to expand the range to the new scale, and addb0to shift it over.For example: