Class ScaleFactor

    • Constructor Detail

      • ScaleFactor

        public ScaleFactor()
    • Method Detail

      • concat

        public final IScalarAffineTransform concat​(IScalarAffineTransform innerTransform)
        Description copied from interface: IScalarAffineTransform
        Concatenate this transform with innerTransform, such that applying the resulting transform is equivalent to first applying innerTransform and then applying this transform on the resulting value. That is, R(v) = T(I(v)), where R(v) is the resulting transform, T(v) is this transform, and I(v) is innerTransform.

        In this snippet, v1 and v2 should be equal, apart from numerical precision, for any v.

         IScalarAffineTransform R, T = ..., I = ...;
         double v = ...;
        
         R = T.concat(I);
         double v1 = R.targetValue(v);
         double v2 = T.targetValue(I.targetValue(v));
         

        Specified by:
        concat in interface IScalarAffineTransform
        Parameters:
        innerTransform - the transform that should be applied before this transform
        Returns:
        the concatenated transform
      • invertAndConcat

        public final IScalarAffineTransform invertAndConcat​(IScalarAffineTransform innerTransform)
        Description copied from interface: IScalarAffineTransform
        Concatenate the inverse of this transform with innerTransform, such that applying the resulting transform is equivalent to first applying innerTransform and then applying this inverse of this transform on the resulting value. That is, R(v) = T-1(I(v)), where R(v) is the resulting transform, T-1(v) is the inverse of this transform, and I(v) is innerTransform.

        In this snippet, v1 and v2 should be equal, apart from numerical precision, for any v.

         IScalarAffineTransform R, T = ..., I = ...;
         double v = ...;
        
         R = T.invertAndConcat(I);
         double v1 = R.targetValue(v);
         double v2 = T.invert().targetValue(I.targetValue(v));
         

        Specified by:
        invertAndConcat in interface IScalarAffineTransform
        Parameters:
        innerTransform - the transform that should be applied before this transform
        Returns:
        the concatenated transform
      • targetFloor

        public double targetFloor​(double srcNumericalValue)
        Specified by:
        targetFloor in interface IScalarAffineTransform
        Parameters:
        srcNumericalValue - a numerical quantity value, expressed in the source unit
        Returns:
        the floor of the corresponding numerical quantity value, when expressed in the target unit
      • targetIntFloor

        public int targetIntFloor​(Number srcNumericalValue)
        Specified by:
        targetIntFloor in interface IScalarAffineTransform
        Parameters:
        srcNumericalValue - a numerical quantity value, expressed in the source unit
        Returns:
        the floor of the corresponding numerical quantity value, when expressed in the target unit, clamped to an int
      • targetNumber

        public Number targetNumber​(long srcNumericalValue)
        Specified by:
        targetNumber in interface IScalarAffineTransform
        Parameters:
        srcNumericalValue - an exact numerical quantity value, expressed in the source unit
        Returns:
        the corresponding numerical quantity value, when expressed in the target unit, as a Long if it can exactly be represented in one, otherwise as some other Number with at least the precision of double
      • targetNumber

        public Number targetNumber​(Number srcNumericalValue)
        Specified by:
        targetNumber in interface IScalarAffineTransform
        Parameters:
        srcNumericalValue - an exact or inexact numerical quantity value, expressed in the source unit
        Returns:
        the corresponding numerical quantity value, when expressed in the target unit, as a Long if it can exactly be represented in one, otherwise as some other Number with at least the precision of double
      • equals

        public abstract boolean equals​(Object obj)
        Overrides:
        equals in class Object
      • hashCode

        public abstract int hashCode()
        Overrides:
        hashCode in class Object