Package org.apache.commons.geometry.core
Interface Transform<P extends Point<P>>
- Type Parameters:
P
- Point implementation type
- All Superinterfaces:
Function<P,
,P> UnaryOperator<P>
- All Known Subinterfaces:
EuclideanTransform<V>
,Rotation3D
- All Known Implementing Classes:
AbstractAffineTransformMatrix
,AffineTransformMatrix1D
,AffineTransformMatrix2D
,AffineTransformMatrix3D
,QuaternionRotation
,Rotation2D
,Transform1S
,Transform2S
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.
- 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.
- 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
, andc
lie on lineL
, then the transformed pointsa'
,b'
, andc'
must lie on lineL'
, whereL'
is the transformed form of the line. - 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:
-
Method Summary
Modifier and TypeMethodDescriptioninverse()
Get an instance representing the inverse transform.boolean
Return true if the transform preserves the orientation of the space.
-
Method Details
-
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:
-