I have a variable x in the interval [-30; 30]. I need to convert this interval so x would be in the interval [0; 1]. What I mean is like this:
original x: -30 .. -20 ... -10 .... 0 .... 10 .... 20 ... 30
new x: 0 .. 0.16 .. 0.32 .. 0.5 .. 0.66 .. 0.83 .. 1
New x values correspond to the original x values. I hope you get the idea.
What I would do is shift and then scale... take a value $x\in [-30, 30]$ and add 30 to it. Then $x+30\in [0, 60]$. Finally, divide by 60, $(x+30)/60\in [0, 1]$.