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

    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract V applyDirection​(V vec)
      Apply this transform to the given vector, ignoring translations and normalizing the result.
      abstract double determinant()
      Get the determinant of the matrix.
      abstract M inverse()
      Get an instance representing the inverse transform.
      abstract M linear()
      Return a matrix containing only the linear portion of this transform.
      abstract M linearTranspose()
      Return a matrix containing the transpose of the linear portion of this transform.
      M normalTransform()
      Return a transform suitable for transforming normals.
      boolean preservesOrientation()
      Return true if the transform preserves the orientation of the space.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.function.Function

        andThen, apply, compose
    • Constructor Detail

      • AbstractAffineTransformMatrix

        public AbstractAffineTransformMatrix()
    • Method Detail

      • 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:
        java.lang.IllegalArgumentException - if the transformed vector coordinates cannot be normalized
        See Also:
        EuclideanTransform.applyVector(EuclideanVector)
      • 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:
        java.lang.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:
        java.lang.IllegalStateException - if the matrix cannot be inverted
        See Also:
        Transforming normals
      • 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:
        Orientation