Class ScaleRange


  • public class ScaleRange
    extends Object
    • Constructor Detail

      • ScaleRange

        public ScaleRange​(Float scaleMin,
                          Float scaleMax,
                          Boolean logarithmic)
    • Method Detail

      • getScaleMin

        public Float getScaleMin()
      • getScaleMax

        public Float getScaleMax()
      • isLogarithmic

        public Boolean isLogarithmic()
      • scaleZeroToOne

        public Float scaleZeroToOne​(Number input)
        Scales an input number to the range 0-1. Will return a number outside this range if necessary, but the result can ONLY be interpreted as "out-of-range" (i.e. the amount by which it is out-of-range should not be used)
        Parameters:
        input - The input number
        Returns:
        A number from 0-1 if in range, a number outside 0-1 if out-of-range, and null if null/NaN