com.vividsolutions.jts.geom.util
Class AffineTransformationFactory

java.lang.Object
  extended by com.vividsolutions.jts.geom.util.AffineTransformationFactory

public class AffineTransformationFactory
extends java.lang.Object

Supports creating AffineTransformations defined by various kinds of inputs and transformation mapping rules.

Author:
Martin Davis

Constructor Summary
AffineTransformationFactory()
           
 
Method Summary
static AffineTransformation createFromBaseLines(Coordinate src0, Coordinate src1, Coordinate dest0, Coordinate dest1)
          Creates an AffineTransformation defined by a maping 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 tranformation from a set of three control vectors.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AffineTransformationFactory

public AffineTransformationFactory()
Method Detail

createFromControlVectors

public static AffineTransformation createFromControlVectors(Coordinate src0,
                                                            Coordinate src1,
                                                            Coordinate src2,
                                                            Coordinate dest0,
                                                            Coordinate dest1,
                                                            Coordinate dest2)
Creates a tranformation 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

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 vector
dest0 - 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 vectors
dest - 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 maping between two baselines. The computed transformation consists of: If the source baseline has zero length, an identity transformation is returned.

Parameters:
src0 - the start point of the source baseline
src1 - the end point of the source baseline
dest0 - the start point of the destination baseline
dest1 - the end point of the destination baseline
Returns:
the computed transformation