Package org.locationtech.jts.geom.util
Class AffineTransformationFactory
- java.lang.Object
-
- org.locationtech.jts.geom.util.AffineTransformationFactory
-
public class AffineTransformationFactory extends java.lang.Object
Supports creatingAffineTransformation
s defined by various kinds of inputs and transformation mapping rules.- Author:
- Martin Davis
-
-
Constructor Summary
Constructors Constructor Description AffineTransformationFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static AffineTransformation
createFromBaseLines(Coordinate src0, Coordinate src1, Coordinate dest0, Coordinate dest1)
Creates an AffineTransformation defined by a mapping between two baselines.static AffineTransformation
createFromControlVectors(Coordinate[] src, Coordinate[] dest)
Creates an AffineTransformation defined by a set of control vectors.static AffineTransformation
createFromControlVectors(Coordinate src0, Coordinate dest0)
Creates an AffineTransformation defined by a single control vector.static AffineTransformation
createFromControlVectors(Coordinate src0, Coordinate src1, Coordinate dest0, Coordinate dest1)
Creates an AffineTransformation defined by a pair of control vectors.static AffineTransformation
createFromControlVectors(Coordinate src0, Coordinate src1, Coordinate src2, Coordinate dest0, Coordinate dest1, Coordinate dest2)
Creates a transformation from a set of three control vectors.
-
-
-
Method Detail
-
createFromControlVectors
public static AffineTransformation createFromControlVectors(Coordinate src0, Coordinate src1, Coordinate src2, Coordinate dest0, Coordinate dest1, Coordinate dest2)
Creates a transformation from a set of three control vectors. A control vector consists of a source point and a destination point, which is the image of the source point under the desired transformation. Three control vectors allows defining a fully general affine transformation.- Parameters:
src0
-src1
-src2
-dest0
-dest1
-dest2
-- Returns:
- the computed transformation
-
createFromControlVectors
public static AffineTransformation createFromControlVectors(Coordinate src0, Coordinate src1, Coordinate dest0, Coordinate dest1)
Creates an AffineTransformation defined by a pair of control vectors. A control vector consists of a source point and a destination point, which is the image of the source point under the desired transformation. The computed transformation is a combination of one or more of a uniform scale, a rotation, and a translation (i.e. there is no shear component and no reflection)- Parameters:
src0
-src1
-dest0
-dest1
-- Returns:
- the computed transformation, or null if the control vectors do not determine a well-defined transformation
-
createFromControlVectors
public static AffineTransformation createFromControlVectors(Coordinate src0, Coordinate dest0)
Creates an AffineTransformation defined by a single control vector. A control vector consists of a source point and a destination point, which is the image of the source point under the desired transformation. This produces a translation.- Parameters:
src0
- the start point of the control vectordest0
- the end point of the control vector- Returns:
- the computed transformation
-
createFromControlVectors
public static AffineTransformation createFromControlVectors(Coordinate[] src, Coordinate[] dest)
Creates an AffineTransformation defined by a set of control vectors. Between one and three vectors must be supplied.- Parameters:
src
- the source points of the vectorsdest
- the destination points of the vectors- Returns:
- the computed transformation
- Throws:
java.lang.IllegalArgumentException
- if the control vector arrays are too short, long or of different lengths
-
createFromBaseLines
public static AffineTransformation createFromBaseLines(Coordinate src0, Coordinate src1, Coordinate dest0, Coordinate dest1)
Creates an AffineTransformation defined by a mapping between two baselines. The computed transformation consists of:- a translation from the start point of the source baseline to the start point of the destination baseline,
- a rotation through the angle between the baselines about the destination start point,
- and a scaling equal to the ratio of the baseline lengths.
- Parameters:
src0
- the start point of the source baselinesrc1
- the end point of the source baselinedest0
- the start point of the destination baselinedest1
- the end point of the destination baseline- Returns:
- the computed transformation
-
-