Class AbstractAffineTransformMatrix<V extends EuclideanVector<V>,M extends AbstractAffineTransformMatrix<V,M>>

java.lang.Object
org.apache.commons.geometry.euclidean.AbstractAffineTransformMatrix<V,M>
Type Parameters:
V - Vector/point implementation type defining the space.
M - Matrix transform implementation type.
All Implemented Interfaces:
Function<V,V>, UnaryOperator<V>, Transform<V>, EuclideanTransform<V>
Direct Known Subclasses:
AffineTransformMatrix1D, AffineTransformMatrix2D, AffineTransformMatrix3D

public abstract class AbstractAffineTransformMatrix<V extends EuclideanVector<V>,M extends AbstractAffineTransformMatrix<V,M>> extends Object implements EuclideanTransform<V>
Base class for affine transform matrices in Euclidean space.
  • Constructor Details

    • AbstractAffineTransformMatrix

      public AbstractAffineTransformMatrix()
  • Method Details

    • applyDirection

      public abstract V applyDirection(V vec)
      Apply this transform to the given vector, ignoring translations and normalizing the result. This is equivalent to transform.applyVector(vec).normalize() but without the intermediate vector instance.
      Parameters:
      vec - the vector to transform
      Returns:
      the new, transformed unit vector
      Throws:
      IllegalArgumentException - if the transformed vector coordinates cannot be normalized
      See Also:
    • determinant

      public abstract double determinant()
      Get the determinant of the matrix.
      Returns:
      the determinant of the matrix
    • inverse

      public abstract M inverse()
      Get an instance representing the inverse transform.
      Specified by:
      inverse in interface Transform<V extends EuclideanVector<V>>
      Returns:
      an instance representing the inverse transform
      Throws:
      IllegalStateException - if the matrix cannot be inverted
    • linear

      public abstract M linear()
      Return a matrix containing only the linear portion of this transform. The returned instance contains the same matrix elements as this instance but with the translation component set to zero.
      Returns:
      a matrix containing only the linear portion of this transform
    • linearTranspose

      public abstract M linearTranspose()
      Return a matrix containing the transpose of the linear portion of this transform. The returned instance is linear, meaning it has a translation component of zero.
      Returns:
      a matrix containing the transpose of the linear portion of this transform
    • normalTransform

      public M normalTransform()
      Return a transform suitable for transforming normals. The returned matrix is the inverse transpose of the linear portion of this instance, i.e. N = (L-1)T, where L is the linear portion of this instance and N is the returned matrix. Note that normals transformed with the returned matrix may be scaled during transformation and require normalization.
      Returns:
      a transform suitable for transforming normals
      Throws:
      IllegalStateException - if the matrix cannot be inverted
      See Also:
    • preservesOrientation

      public boolean preservesOrientation()
      Return true if the transform preserves the orientation of the space. For example, in Euclidean 2D space, this will be true for translations, rotations, and scalings but will be false for reflections.

      This method returns true if the determinant of the matrix is positive.

      Specified by:
      preservesOrientation in interface Transform<V extends EuclideanVector<V>>
      Returns:
      true if the transform preserves the orientation of the space
      See Also: