Package com.irurueta.geometry
Class Transformation2D
java.lang.Object
com.irurueta.geometry.Transformation2D
- Direct Known Subclasses:
AffineTransformation2D,EuclideanTransformation2D,ProjectiveTransformation2D
This class performs transformations on 2D space.
Transformations can be applied to any 2D geometric figure.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract com.irurueta.algebra.MatrixasMatrix()Represents this transformation as a 3x3 matrix.abstract voidasMatrix(com.irurueta.algebra.Matrix m) Represents this transformation as a 3x3 matrix and stores the result in provided instance.voidTransforms and updates provided conic.abstract voidTransforms a conic using this transformation and stores the result into provided output conic.voidTransforms and updates a dual conic using this transformation.abstract voidTransforms a dual conic using this transformation and stores the result into provided output dual conic.voidTransforms and updates provided line using this transformation.abstract voidTransforms provided input line using this transformation and stores the result into provided output line instance.voidTransforms and updates provided point.abstract voidTransforms input point using this transformation and stores the result in provided output points.voidTransforms and updates provided polygon using this transformation.voidTransforms provided input polygon using this transformation and stores the result into provided output polygon instance.voidtransform(Triangle2D triangle) Transforms and updates provided input triangle using this transformation.voidtransform(Triangle2D inputTriangle, Triangle2D outputTriangle) Transforms provided input triangle using this transformation and stores the result into provided output triangle instance.voidtransformAndOverwriteLines(List<Line2D> lines) Transforms provided list of lines using this transformation and overwriting their previous values.voidtransformAndOverwritePoints(List<Point2D> points) Transforms provided list of points using this transformation and overwriting their previous values.transformAndReturnNew(Conic inputConic) Transforms a conic using this transformation and returns a new one.transformAndReturnNew(DualConic inputDualConic) Transforms a dual conic using this transformation and returns a new one.transformAndReturnNew(Line2D inputLine) Transforms provided line using this transformation and returns a new one.transformAndReturnNew(Point2D inputPoint) Transforms provided point using this transformation.transformAndReturnNew(Polygon2D inputPolygon) Transforms provided polygon using this transformation and returns a new one.transformAndReturnNew(Triangle2D inputTriangle) Transforms provided triangle using this transformation and returns a new one.voidtransformLines(List<Line2D> inputLines, List<Line2D> outputLines) Transforms provided list of lines using this transformation and stores the result in provided output list of lines.transformLinesAndReturnNew(List<Line2D> inputLines) Transforms provided list of lines using this transformation and returns a new one.voidtransformPoints(List<Point2D> inputPoints, List<Point2D> outputPoints) Transforms provided list of points using this transformation and stores the result in provided output list of points.transformPointsAndReturnNew(List<Point2D> inputPoints) Transforms provided list of points using this transformation and returns a new one.
-
Constructor Details
-
Transformation2D
protected Transformation2D()Empty constructor.
-
-
Method Details
-
transformAndReturnNew
Transforms provided point using this transformation.- Parameters:
inputPoint- point to be transformed.- Returns:
- transformed point.
-
transform
Transforms and updates provided point.- Parameters:
point- point to be transformed and updated.
-
transform
Transforms input point using this transformation and stores the result in provided output points.- Parameters:
inputPoint- point to be transformed.outputPoint- instance where transformed point data will be stored.
-
transformPointsAndReturnNew
Transforms provided list of points using this transformation and returns a new one.- Parameters:
inputPoints- points to be transformed.- Returns:
- transformed points.
-
transformPoints
Transforms provided list of points using this transformation and stores the result in provided output list of points. Notice that any previous content in output list will be removed when calling this method.- Parameters:
inputPoints- points to be transformed.outputPoints- transformed points.
-
transformAndOverwritePoints
Transforms provided list of points using this transformation and overwriting their previous values.- Parameters:
points- points to be transformed and overwritten.
-
transformAndReturnNew
public Conic transformAndReturnNew(Conic inputConic) throws NonSymmetricMatrixException, com.irurueta.algebra.AlgebraException Transforms a conic using this transformation and returns a new one.- Parameters:
inputConic- conic to be transformed.- Returns:
- transformed conic.
- Throws:
NonSymmetricMatrixException- raised if due to numerical precision the resulting output conic matrix is not considered to be symmetric.com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transform
public void transform(Conic conic) throws NonSymmetricMatrixException, com.irurueta.algebra.AlgebraException Transforms and updates provided conic.- Parameters:
conic- conic to be transformed.- Throws:
NonSymmetricMatrixException- raised if due to numerical precision the resulting conic matrix is not considered to be symmetric.com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transform
public abstract void transform(Conic inputConic, Conic outputConic) throws NonSymmetricMatrixException, com.irurueta.algebra.AlgebraException Transforms a conic using this transformation and stores the result into provided output conic.- Parameters:
inputConic- conic to be transformed.outputConic- instance where data of transformed conic will be stored.- Throws:
NonSymmetricMatrixException- raised if due to numerical precision the resulting output conic matrix is not considered to be symmetric.com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transformAndReturnNew
public DualConic transformAndReturnNew(DualConic inputDualConic) throws NonSymmetricMatrixException, com.irurueta.algebra.AlgebraException Transforms a dual conic using this transformation and returns a new one.- Parameters:
inputDualConic- dual conic to be transformed.- Returns:
- transformed dual conic.
- Throws:
NonSymmetricMatrixException- raised if due to numerical precision the resulting output conic matrix is not considered to be symmetric.com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transform
public void transform(DualConic dualConic) throws NonSymmetricMatrixException, com.irurueta.algebra.AlgebraException Transforms and updates a dual conic using this transformation.- Parameters:
dualConic- dual conic to be transformed.- Throws:
NonSymmetricMatrixException- raised if due to numerical precision the resulting conic matrix is not considered to be symmetric.com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transform
public abstract void transform(DualConic inputDualConic, DualConic outputDualConic) throws NonSymmetricMatrixException, com.irurueta.algebra.AlgebraException Transforms a dual conic using this transformation and stores the result into provided output dual conic.- Parameters:
inputDualConic- dual conic to be transformed.outputDualConic- instance where data of transformed dual conic will be stored.- Throws:
NonSymmetricMatrixException- raised if due to numerical precision the resulting output dual conic matrix is not considered to be symmetric.com.irurueta.algebra.AlgebraException- Raised if transform cannot be computed because of numerical instabilities.
-
transformAndReturnNew
Transforms provided line using this transformation and returns a new one.- Parameters:
inputLine- line to be transformed.- Returns:
- transformed line.
- Throws:
com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transform
Transforms and updates provided line using this transformation.- Parameters:
line- line to be transformed and updated.- Throws:
com.irurueta.algebra.AlgebraException- if transform cannot be computed because of numerical instabilities.
-
transform
public abstract void transform(Line2D inputLine, Line2D outputLine) throws com.irurueta.algebra.AlgebraException Transforms provided input line using this transformation and stores the result into provided output line instance.- Parameters:
inputLine- line to be transformed.outputLine- instance where data of transformed line will be stored.- Throws:
com.irurueta.algebra.AlgebraException- Raised if transform cannot be computed because of numerical instabilities.
-
transformLinesAndReturnNew
public List<Line2D> transformLinesAndReturnNew(List<Line2D> inputLines) throws com.irurueta.algebra.AlgebraException Transforms provided list of lines using this transformation and returns a new one.- Parameters:
inputLines- lines to be transformed.- Returns:
- transformed lines.
- Throws:
com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transformLines
public void transformLines(List<Line2D> inputLines, List<Line2D> outputLines) throws com.irurueta.algebra.AlgebraException Transforms provided list of lines using this transformation and stores the result in provided output list of lines. Notice that any previous content in output list will be removed when calling this method.- Parameters:
inputLines- lines to be transformed.outputLines- transformed lines.- Throws:
com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transformAndOverwriteLines
public void transformAndOverwriteLines(List<Line2D> lines) throws com.irurueta.algebra.AlgebraException Transforms provided list of lines using this transformation and overwriting their previous values.- Parameters:
lines- lines to be transformed and overwritten.- Throws:
com.irurueta.algebra.AlgebraException- raised if transform cannot be computed because of numerical instabilities.
-
transformAndReturnNew
Transforms provided polygon using this transformation and returns a new one.- Parameters:
inputPolygon- polygon to be transformed.- Returns:
- Transformed polygon.
-
transform
Transforms and updates provided polygon using this transformation.- Parameters:
polygon- polygon to be transformed.
-
transform
Transforms provided input polygon using this transformation and stores the result into provided output polygon instance.- Parameters:
inputPolygon- polygon to be transformed.outputPolygon- instance where transformed polygon data will be stored.
-
transformAndReturnNew
Transforms provided triangle using this transformation and returns a new one.- Parameters:
inputTriangle- triangle to be transformed.- Returns:
- transformed triangle.
-
transform
Transforms and updates provided input triangle using this transformation.- Parameters:
triangle- triangle to be transformed.
-
transform
Transforms provided input triangle using this transformation and stores the result into provided output triangle instance.- Parameters:
inputTriangle- triangle to be transformed.outputTriangle- instance where transformed triangle data will be stored
-
asMatrix
public abstract com.irurueta.algebra.Matrix asMatrix()Represents this transformation as a 3x3 matrix. A point can be transformed as T * p, where T is the transformation matrix and p is a point expressed as an homogeneous vector.- Returns:
- This transformation in matrix form.
-
asMatrix
public abstract void asMatrix(com.irurueta.algebra.Matrix m) Represents this transformation as a 3x3 matrix and stores the result in provided instance.- Parameters:
m- Instance where transformation matrix will be stored.- Throws:
IllegalArgumentException- Raised if provided instance is not a 3x3 matrix.
-