Class Transformation2D

java.lang.Object
com.irurueta.geometry.Transformation2D
Direct Known Subclasses:
AffineTransformation2D, EuclideanTransformation2D, ProjectiveTransformation2D

public abstract class Transformation2D extends Object
This class performs transformations on 2D space. Transformations can be applied to any 2D geometric figure.
  • Constructor Details

    • Transformation2D

      protected Transformation2D()
      Empty constructor.
  • Method Details

    • transformAndReturnNew

      public Point2D transformAndReturnNew(Point2D inputPoint)
      Transforms provided point using this transformation.
      Parameters:
      inputPoint - point to be transformed.
      Returns:
      transformed point.
    • transform

      public void transform(Point2D point)
      Transforms and updates provided point.
      Parameters:
      point - point to be transformed and updated.
    • transform

      public abstract void transform(Point2D inputPoint, Point2D outputPoint)
      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

      public List<Point2D> transformPointsAndReturnNew(List<Point2D> inputPoints)
      Transforms provided list of points using this transformation and returns a new one.
      Parameters:
      inputPoints - points to be transformed.
      Returns:
      transformed points.
    • transformPoints

      public void transformPoints(List<Point2D> inputPoints, List<Point2D> outputPoints)
      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

      public void transformAndOverwritePoints(List<Point2D> points)
      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

      public Line2D transformAndReturnNew(Line2D inputLine) throws com.irurueta.algebra.AlgebraException
      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

      public void transform(Line2D line) throws com.irurueta.algebra.AlgebraException
      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

      public Polygon2D transformAndReturnNew(Polygon2D inputPolygon)
      Transforms provided polygon using this transformation and returns a new one.
      Parameters:
      inputPolygon - polygon to be transformed.
      Returns:
      Transformed polygon.
    • transform

      public void transform(Polygon2D polygon)
      Transforms and updates provided polygon using this transformation.
      Parameters:
      polygon - polygon to be transformed.
    • transform

      public void transform(Polygon2D inputPolygon, Polygon2D outputPolygon)
      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

      public Triangle2D transformAndReturnNew(Triangle2D inputTriangle)
      Transforms provided triangle using this transformation and returns a new one.
      Parameters:
      inputTriangle - triangle to be transformed.
      Returns:
      transformed triangle.
    • transform

      public void transform(Triangle2D triangle)
      Transforms and updates provided input triangle using this transformation.
      Parameters:
      triangle - triangle to be transformed.
    • transform

      public void transform(Triangle2D inputTriangle, Triangle2D outputTriangle)
      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.