Package skyview.geometry
Class Scaler
- java.lang.Object
-
- skyview.geometry.Transformer
-
- skyview.geometry.Scaler
-
- All Implemented Interfaces:
java.io.Serializable,Component
public class Scaler extends Transformer implements Component
This class does 2-D scalings, rotations and linear transformations.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description Scaler(double x0, double y0, double a00, double a01, double a10, double a11)Create a scaler where y0 = x0 + a00*x0 + a01*x1, y1 = x0+a10*x0+a11*x1.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Scaleradd(Scaler trans)Add a second affine transformation to this one and return the composite transformation.voiddump(java.io.PrintStream out)Show the scaler.java.lang.StringgetDescription()What is a descrition for this component?protected intgetInputDimension()What is the dimensionality of the input to a Scalerjava.lang.StringgetName()What is a name for this component?protected intgetOutputDimension()What is the dimensionality of the output of a Scalerdouble[]getParams()voidinterchangeAxes()Interchange the X and Y axesScalerinverse()Return the inverse transformation.booleanisInverse(Transformer trans)Is this an inverse of the current scaler?doublescale()What is the scale of this transformation? This is defined as the ratio of the lengths between a unit transformation on input.voidtransform(double[] x, double[] y)Scale a single point where the user supplies the output.-
Methods inherited from class skyview.geometry.Transformer
transform, transform
-
-
-
-
Constructor Detail
-
Scaler
public Scaler(double x0, double y0, double a00, double a01, double a10, double a11)Create a scaler where y0 = x0 + a00*x0 + a01*x1, y1 = x0+a10*x0+a11*x1.- Parameters:
x0- The X offsety0- The Y offseta00- Coefficient of the transformation matrix.a01- Coefficient of the transformation matrix.a10- Coefficient of the transformation matrix.a11- Coefficient of the transformation matrix.
-
-
Method Detail
-
getParams
public double[] getParams()
-
getOutputDimension
protected int getOutputDimension()
What is the dimensionality of the output of a Scaler- Specified by:
getOutputDimensionin classTransformer
-
getInputDimension
protected int getInputDimension()
What is the dimensionality of the input to a Scaler- Specified by:
getInputDimensionin classTransformer
-
getName
public java.lang.String getName()
What is a name for this component?
-
getDescription
public java.lang.String getDescription()
What is a descrition for this component?- Specified by:
getDescriptionin interfaceComponent
-
transform
public void transform(double[] x, double[] y)Scale a single point where the user supplies the output.- Specified by:
transformin classTransformer- Parameters:
x- The input point (should be double[2])y- The output point (should be double[2])
-
inverse
public Scaler inverse() throws TransformationException
Return the inverse transformation.- Specified by:
inversein classTransformer- Returns:
- A transformation object that scales in the opposite direction.
- Throws:
TransformationException- if the forward transformation matrix is singular.
-
add
public Scaler add(Scaler trans)
Add a second affine transformation to this one and return the composite transformation.- Parameters:
trans- A second transformation which is applied after the transformation described in 'this'.- Returns:
- The combined transformation.
-
isInverse
public boolean isInverse(Transformer trans)
Is this an inverse of the current scaler?- Specified by:
isInversein classTransformer
-
scale
public double scale()
What is the scale of this transformation? This is defined as the ratio of the lengths between a unit transformation on input. and the output.
-
interchangeAxes
public void interchangeAxes()
Interchange the X and Y axes
-
dump
public void dump(java.io.PrintStream out)
Show the scaler.
-
-