Class AffineTransform2D

java.lang.Object
edu.ntnu.stud.chaosgame.model.transformations.Transform2D
edu.ntnu.stud.chaosgame.model.transformations.AffineTransform2D

public class AffineTransform2D extends Transform2D
Represents affine transformations in a 2D-plane by extending the abstract class Transform2D Transform2D.
  • Field Details

    • matrix

      private Matrix2x2 matrix
      The matrixMatrix2x2 which performs the matrix-multiplication part of the affine transformation.
    • vector

      private Vector2D vector
      The vectorVector2D which is added as part of the affine transformation.
  • Constructor Details

    • AffineTransform2D

      public AffineTransform2D(Matrix2x2 inputMatrix, Vector2D inputVector)
      Create a type of affine transformation.
      Parameters:
      inputMatrix - A matrix Matrix2x2 which defines the matrix-multiplication part of the affine transformation.
      inputVector - A vector Vector2D which defines the vector-addition part of the affine transformation.
  • Method Details

    • transform

      public Vector2D transform(Vector2D point)
      Multiplies the matrix Matrix2x2 matrix by the vector Vector2D vector and adds the vector Vector2D point.
      Specified by:
      transform in class Transform2D
      Parameters:
      point - The vector Vector2D which transformations are performed on.
      Returns:
      A new vector Vector2D which represents a point on a plane. The point represents a new step in the creation of fractal.
    • getMatrix

      public Matrix2x2 getMatrix()
      Getter method to use with ChaosGameFileHandler.
      Returns:
      The matrix for the transformation.
    • getVector

      public Vector2D getVector()
      Getter method to use with ChaosGameFileHandler.
      Returns:
      The vector for the transformation.