Mapping a biased value?

Hello! I just hooked up a new 4d joystick to an arduino, when reading the outputs, I get values from 0-1000.

I need to map this from -100 to 100, which is easy in of itself, however, dead centre of my joystick does not give me a value of 500 in each direction, but 360.

So E.G, going left is a value of 0-359, while going right goes from 361-1000.

How do I map this so that I get an output of 0 when the stick is centred?

Split it into two lines. If the value is less than 360 then so it from -100 to 0. If the value is greater than 360 then map from 0 to 100.

Ah, right! That would work, thanks!

You could use the MultiMap function (Arduino Playground - MultiMap) to map:

0 -> -100
360 -> 0
1000 -> +100

Thanks!