private static final class LinearTransformation.RegularLinearTransformation extends LinearTransformation
LinearTransformation.LinearTransformationBuilder| Modifier and Type | Field and Description |
|---|---|
(package private) LinearTransformation |
inverse |
(package private) double |
slope |
(package private) double |
yIntercept |
| Constructor and Description |
|---|
RegularLinearTransformation(double slope,
double yIntercept) |
RegularLinearTransformation(double slope,
double yIntercept,
LinearTransformation inverse) |
| Modifier and Type | Method and Description |
|---|---|
private LinearTransformation |
createInverse() |
LinearTransformation |
inverse()
Returns the inverse linear transformation.
|
boolean |
isHorizontal()
Returns whether this is a horizontal transformation.
|
boolean |
isVertical()
Returns whether this is a vertical transformation.
|
double |
slope()
Returns the slope of the transformation, i.e.
|
java.lang.String |
toString() |
double |
transform(double x)
Returns the
y corresponding to the given x. |
forNaN, horizontal, mapping, verticalfinal double slope
final double yIntercept
@CheckForNull LinearTransformation inverse
RegularLinearTransformation(double slope,
double yIntercept)
RegularLinearTransformation(double slope,
double yIntercept,
LinearTransformation inverse)
public boolean isVertical()
LinearTransformationisVertical in class LinearTransformationpublic boolean isHorizontal()
LinearTransformationisHorizontal in class LinearTransformationpublic double slope()
LinearTransformationy with respect to
x. This must not be called on a vertical transformation (i.e. when LinearTransformation.isVertical() is true).slope in class LinearTransformationpublic double transform(double x)
LinearTransformationy corresponding to the given x. This must not be called on a
vertical transformation (i.e. when LinearTransformation.isVertical() is true).transform in class LinearTransformationpublic LinearTransformation inverse()
LinearTransformationLinearTransformation.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.inverse in class LinearTransformationpublic java.lang.String toString()
toString in class java.lang.Objectprivate LinearTransformation createInverse()