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
Fields Modifier and Type Field Description (package private) LinearTransformation
inverse
(package private) double
slope
(package private) double
yIntercept
-
Constructor Summary
Constructors Constructor Description RegularLinearTransformation(double slope, double yIntercept)
RegularLinearTransformation(double slope, double yIntercept, LinearTransformation inverse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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 they
corresponding to the givenx
.-
Methods inherited from class com.google.common.math.LinearTransformation
forNaN, horizontal, mapping, vertical
-
-
-
-
Field Detail
-
slope
final double slope
-
yIntercept
final double yIntercept
-
inverse
LinearTransformation inverse
-
-
Constructor Detail
-
RegularLinearTransformation
RegularLinearTransformation(double slope, double yIntercept)
-
RegularLinearTransformation
RegularLinearTransformation(double slope, double yIntercept, LinearTransformation inverse)
-
-
Method Detail
-
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
public LinearTransformation 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
createInverse
private LinearTransformation createInverse()
-
-