I am just quite braindead at the moment. So I need your help with some math magic
I have a counter counting up like this
for x in range(5):
do something at position x
Variable x will have values 0, 1, 2, 3, 4. My something will wander from left to right (ok just only 5 pixel, but this is only for the example)
Now I want a knob that makes this movement smaller and smaller and finally inverts the movement. If I assume five positions of the knob, then I will get the following matrix (please ignore, that in reality positions can not be expressed in fractions):
knob |resulting position at
value|x=1 x=2 x=3 x=4 x=5
-----+--------------------
0.0 |0.0 1.0 2.0 3.0 4.0
0.25 |1.0 1.5 2.0 2.5 3.0
0.5 |2.0 2.0 2.0 2.0 2.0
0.75 |3.0 2.5 2.0 1.5 1.0
1.0 |4.0 3.0 2.0 1.0 0.0
How do I come from the knob position to the increasing inversion of the values?
I am sorry, but somehow my brain is blocked completely at the moment.