Interface Transform<P extends Point<P>>

  • Type Parameters:
    P - Point implementation type
    All Superinterfaces:
    java.util.function.Function<P,​P>, java.util.function.UnaryOperator<P>
    All Known Subinterfaces:
    EuclideanTransform<V>, Rotation3D
    All Known Implementing Classes:
    AbstractAffineTransformMatrix, AffineTransformMatrix1D, AffineTransformMatrix2D, AffineTransformMatrix3D, QuaternionRotation, Rotation2D, Transform1S, Transform2S

    public interface Transform<P extends Point<P>>
    extends java.util.function.UnaryOperator<P>
    Interface representing geometric transforms in a space, i.e. mappings from points to points. Implementations must fulfill a set of requirements, listed below, that preserve the consistency of partitionings on the space. Transforms that do not meet these requirements, while potentially valid mathematically, cannot be expected to produce correct results with algorithms that use this interface.
    1. Transforms must represent functions that are one-to-one and onto (i.e. bijections). This means that every point in the space must be mapped to exactly one other point in the space. This also implies that the function is invertible.
    2. Transforms must preserve collinearity. This means that if a set of points lie on a common hyperplane before the transform, then they must also lie on a common hyperplane after the transform. For example, if the Euclidean 2D points a, b, and c lie on line L, then the transformed points a', b', and c' must lie on line L', where L' is the transformed form of the line.
    3. Transforms must preserve the concept of parallelism defined for the space. This means that hyperplanes that are parallel before the transformation must remain parallel afterwards, and hyperplanes that intersect must also intersect afterwards. For example, a transform that causes parallel lines to converge to a single point in Euclidean space (such as the projective transforms used to create perspective viewpoints in 3D graphics) would not meet this requirement. However, a transform that turns a square into a rhombus with no right angles would fulfill the requirement, since the two pairs of parallel lines forming the square remain parallel after the transformation.

    Transforms that meet the above requirements in Euclidean space (and other affine spaces) are known as affine transforms. Common affine transforms include translation, scaling, rotation, reflection, and any compositions thereof.

    See Also:
    Geometric Transformation
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Transform<P> inverse()
      Get an instance representing the inverse transform.
      boolean preservesOrientation()
      Return true if the transform preserves the orientation of the space.
      • Methods inherited from interface java.util.function.Function

        andThen, apply, compose
    • Method Detail

      • inverse

        Transform<P> inverse()
        Get an instance representing the inverse transform.
        Returns:
        an instance representing the inverse transform
      • preservesOrientation

        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.
        Returns:
        true if the transform preserves the orientation of the space
        See Also:
        Orientation