Package com.google.common.math
Class LinearTransformation.RegularLinearTransformation
java.lang.Object
com.google.common.math.LinearTransformation
com.google.common.math.LinearTransformation.RegularLinearTransformation
- Enclosing class:
LinearTransformation
private static final class LinearTransformation.RegularLinearTransformation
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(package private) final double -
Constructor Summary
ConstructorsConstructorDescriptionRegularLinearTransformation(double slope, double yIntercept) RegularLinearTransformation(double slope, double yIntercept, LinearTransformation inverse) -
Method Summary
Modifier and TypeMethodDescriptionprivate LinearTransformationinverse()Returns the inverse linear transformation.booleanReturns whether this is a horizontal transformation.booleanReturns whether this is a vertical transformation.doubleslope()Returns the slope of the transformation, i.e.toString()doubletransform(double x) Returns theycorresponding to the givenx.Methods inherited from class com.google.common.math.LinearTransformation
forNaN, horizontal, mapping, vertical
-
Field Details
-
slope
final double slope -
yIntercept
final double yIntercept -
inverse
-
-
Constructor Details
-
RegularLinearTransformation
RegularLinearTransformation(double slope, double yIntercept) -
RegularLinearTransformation
RegularLinearTransformation(double slope, double yIntercept, LinearTransformation inverse)
-
-
Method Details
-
isVertical
public boolean isVertical()Description copied from class:LinearTransformationReturns whether this is a vertical transformation.- Specified by:
isVerticalin classLinearTransformation
-
isHorizontal
public boolean isHorizontal()Description copied from class:LinearTransformationReturns whether this is a horizontal transformation.- Specified by:
isHorizontalin classLinearTransformation
-
slope
public double slope()Description copied from class:LinearTransformationReturns the slope of the transformation, i.e. the rate of change ofywith respect tox. This must not be called on a vertical transformation (i.e. whenLinearTransformation.isVertical()is true).- Specified by:
slopein classLinearTransformation
-
transform
public double transform(double x) Description copied from class:LinearTransformationReturns theycorresponding to the givenx. This must not be called on a vertical transformation (i.e. whenLinearTransformation.isVertical()is true).- Specified by:
transformin classLinearTransformation
-
inverse
Description copied from class:LinearTransformationReturns 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:
inversein classLinearTransformation
-
toString
-
createInverse
-