Class LinearTransformation

    • Constructor Detail

      • LinearTransformation

        public LinearTransformation()
    • Method Detail

      • vertical

        public static LinearTransformation vertical​(double x)
        Builds an instance representing a vertical transformation with a constant value of x. (The inverse of this will be a horizontal transformation.)
      • horizontal

        public static LinearTransformation horizontal​(double y)
        Builds an instance representing a horizontal transformation with a constant value of y. (The inverse of this will be a vertical transformation.)
      • isVertical

        public abstract boolean isVertical()
        Returns whether this is a vertical transformation.
      • isHorizontal

        public abstract boolean isHorizontal()
        Returns whether this is a horizontal transformation.
      • slope

        public abstract double slope()
        Returns the slope of the transformation, i.e. the rate of change of y with respect to x. This must not be called on a vertical transformation (i.e. when isVertical() is true).
      • transform

        public abstract double transform​(double x)
        Returns the y corresponding to the given x. This must not be called on a vertical transformation (i.e. when isVertical() is true).
      • inverse

        public abstract LinearTransformation inverse()
        Returns the inverse linear transformation. The inverse of a horizontal transformation is a vertical transformation, and vice versa. The inverse of the forNaN() transformation is itself. In all other cases, the inverse is a transformation such that applying both the original transformation and its inverse to a value gives you the original value give-or-take numerical errors. Calling this method multiple times on the same instance will always return the same instance. Calling this method on the result of calling this method on an instance will always return that original instance.