Convert range into a power curve or exponential proportional curve?

Hello! I am trying to convert a range of number into a simple curve on a different scale.
But my programming, and particularly the maths portions of it, is quite rusty.

So I have a range from 0 to 500.
I wish to convert it to a range from 0 to 10000 in a curve.

In effect, my goal is to have the result be as close to 1:1 as possible when dealing with lower numbers, and proportionally curve up towards 10000 where towards the end we are having a rate of 20:1.

What is the simplest way of going about doing this?

Use a function: output = f(input).

What the function does is totally up to you. If you can curve fit your data to a power function or exponential function, then you can simply use those fitted values to calculate your new value. If you can't you do do some sort of lookup table or break it up into different functions depending if the input is small, medium or large.

  NewValue = OldValue * (OldValue * 19.0 / 500.0 + 1.0);

Thank you so much!
What is the 19 in this formula?

20 - 1 = 19

The scaling is from 1 on the low end to 20 on the high end. In order to be a simple ratio (as you had requested) that has to be from zero to something (19 in this case) then offset (add one) to get the ratio into the desired range.

  Ratio = (OldValue * (20.0 - 1.0) / 500.0 + 1.0);

Subtract one so a simple scaling can be applied. Apply the scaling. Add one (put the one back). That value is the ratio.

  NewValue = OldValue * Ratio;

Apply the ratio to the OldValue.

Would modifying the 500 adjust the strength of the curve?

Sorry if that is basically what you said and I use the wrong terminologies, I am completely self-taught.

Probably.

The intended purpose of the 500 is to scale your original range from 0-500 to 0-1 (essentially a percent).

Changing the 20 (19) is a better choice.

I did a bit of a combination through trial and error, seems to have worked perfectly. Thank you!

You could also draw a set of points, by just looking at them, something like:


Then save the points in your code and do piecewise linear interpolation for any input.
(ie if you have an input of 225, you'd calculate a value half-way between the saved values for 200 and 250.)
You can do non-linear interpolation as well, but that gets more complicated.

This way you can easily adjust the curve any way you want, without having to figure out the exact mathematical equation that fits the points...