Closed zepumph closed 4 years ago
@pixelzoom mentioned that it is a bit weird to have the term "normalize" in a function that doesn't strictly return a number between 0 and 1, since new phet.dot.Range( -10, 10 ).getNormalizedValue( -20 ) => -0.5
.
I'll make sure to add some doc for that.
@samreid also mentioned that he didn't love the term "normalize", and would rather something like “fraction”, “ratio” or “proportion”. No one seemed to second it.
@pixelzoom will you please review this new function and its tests. Anything else here?
Implementation and tests look good. The doc was sort of odd -- there was a typo, and the description of the return value was in 2 different places. So I fixed the typo and consolidated the description into one place, see above commits. Closing.
I asked on slack if this would be useful:
The answer was yes, and it will help with issues like https://github.com/phetsims/molarity/issues/183. I'll add it. People liked
getNormalizedValue
best.