C++: Mapping float values into a new value within a specified range : I am working with accelerometer data which I need to "map/convert" into a new range of values.

So, of the following example accelerometer data:

    X: [0.363209]
    Y: [0.723211]
    Z: [-9.806650]

I need to convert the **X** accelerometer data into a new value in the range of *-0.22 to 0.22* and the **Y** data into a value in the range of *-2.84 to 2.84*.

Can anyone advice on an approach to accomplish this, please?
