Map range function


For mapping a value into the [0,1] range, I named a method normalizeToUnity, but I also have the same method somewhere else named sigmoid.


In some contexts, this would be called “normalizing a variable to the range [0,1]”.


convertLinear() or convertLinearRange()? convertRescaledRange()? convertSomething()?

Agree with Riccardo, “unInterpolate” doesn’t seem right. Seems jayfella had a good word to use right in the comment - “convert”.


“convert” is too generic. Could be converting from degrees to radians.

For “normalize” it would have to be normalizeRange()…

There are no really good names for “the opposite of interpolate”. But to me “uninterpolate” means the opposite of interpolate… which is exactly what this is. One if the reverse operation of the other.


Then it was WAY incorrectly named because sigmoid is something completely different… waaaay different.


A fire extinguisher is an unIgniting device :thinking:


:rofl: lol Finding a name harder than implementing the thing. reinterpolate also didn’t seem too bad either.

At some point, we do need to read the javadoc that goes along with it, so a little bit generic, with a good description in your auto-complete popup seems fine to me.

At least I hope we aren’t calling methods like that without checking the method’s javadoc… :sweat_smile:


Yes, but that was for the five argument version that uninterpolated it first.

But if someone has a good name for the “opposite of interpolate”. These are reciprocal operations.

…so even the fire unigniting device isn’t an accurate analogy because you can’t simply reignite it, most likely. There is something lost in each iteration at least.

We’re talking about a direct inverse here. interpolate(uninterpolate(interpolate(uninterpolate()))… barring floating point error you get the same out that you put in.


Geez. Need my head checked, I was thinking of the 5 param method, not the 2nd one. Nevermind, you’re right. :grimacing: