Package com.google.common.math
Class LinearTransformation.VerticalLinearTransformation
java.lang.Object
com.google.common.math.LinearTransformation
com.google.common.math.LinearTransformation.VerticalLinearTransformation
- Enclosing class:
LinearTransformation
private static final class LinearTransformation.VerticalLinearTransformation
extends LinearTransformation
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.common.math.LinearTransformation
LinearTransformation.LinearTransformationBuilder
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) LinearTransformation
(package private) final double
-
Constructor Summary
ConstructorsConstructorDescriptionVerticalLinearTransformation
(double x) VerticalLinearTransformation
(double x, LinearTransformation inverse) -
Method Summary
Modifier and TypeMethodDescriptionprivate LinearTransformation
inverse()
Returns the inverse linear transformation.boolean
Returns whether this is a horizontal transformation.boolean
Returns whether this is a vertical transformation.double
slope()
Returns the slope of the transformation, i.e.toString()
double
transform
(double x) Returns they
corresponding to the givenx
.Methods inherited from class com.google.common.math.LinearTransformation
forNaN, horizontal, mapping, vertical
-
Field Details
-
x
final double x -
inverse
-
-
Constructor Details
-
VerticalLinearTransformation
VerticalLinearTransformation(double x) -
VerticalLinearTransformation
VerticalLinearTransformation(double x, LinearTransformation inverse)
-
-
Method Details
-
isVertical
public boolean isVertical()Description copied from class:LinearTransformation
Returns whether this is a vertical transformation.- Specified by:
isVertical
in classLinearTransformation
-
isHorizontal
public boolean isHorizontal()Description copied from class:LinearTransformation
Returns whether this is a horizontal transformation.- Specified by:
isHorizontal
in classLinearTransformation
-
slope
public double slope()Description copied from class:LinearTransformation
Returns the slope of the transformation, i.e. the rate of change ofy
with respect tox
. This must not be called on a vertical transformation (i.e. whenLinearTransformation.isVertical()
is true).- Specified by:
slope
in classLinearTransformation
-
transform
public double transform(double x) Description copied from class:LinearTransformation
Returns they
corresponding to the givenx
. This must not be called on a vertical transformation (i.e. whenLinearTransformation.isVertical()
is true).- Specified by:
transform
in classLinearTransformation
-
inverse
Description copied from class:LinearTransformation
Returns the inverse linear transformation. The inverse of a horizontal transformation is a vertical transformation, and vice versa. The inverse of theLinearTransformation.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.- Specified by:
inverse
in classLinearTransformation
-
toString
-
createInverse
-