Map range function


#21

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.


#22

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


#23

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”.


#24

“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.


#25

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


#26

A fire extinguisher is an unIgniting device :thinking:


#27

: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:


#28

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.


#29

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