Table of Contents

Class AffineTransformationFactory

Namespace
NetTopologySuite.Geometries.Utilities
Assembly
NetTopologySuite.dll

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

public static class AffineTransformationFactory
Inheritance
AffineTransformationFactory
Inherited Members

Methods

CreateFromBaseLines(Coordinate, Coordinate, Coordinate, Coordinate)

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.
If the source baseline has zero length, an identity transformation is returned.
public static AffineTransformation CreateFromBaseLines(Coordinate src0, Coordinate src1, Coordinate dest0, Coordinate dest1)

Parameters

src0 Coordinate

The start point of the source baseline

src1 Coordinate

The end point of the source baseline

dest0 Coordinate

The start point of the destination baseline

dest1 Coordinate

The end point of the destination baseline

Returns

AffineTransformation

CreateFromControlVectors(Coordinate, Coordinate)

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.

public static AffineTransformation CreateFromControlVectors(Coordinate src0, Coordinate dest0)

Parameters

src0 Coordinate

The start point of the control vector

dest0 Coordinate

The end point of the control vector

Returns

AffineTransformation

The computed transformation

CreateFromControlVectors(Coordinate, Coordinate, Coordinate, Coordinate)

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)

public static AffineTransformation CreateFromControlVectors(Coordinate src0, Coordinate src1, Coordinate dest0, Coordinate dest1)

Parameters

src0 Coordinate
src1 Coordinate
dest0 Coordinate
dest1 Coordinate

Returns

AffineTransformation

The computed transformation

CreateFromControlVectors(Coordinate, Coordinate, Coordinate, Coordinate, Coordinate, Coordinate)

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.

public static AffineTransformation CreateFromControlVectors(Coordinate src0, Coordinate src1, Coordinate src2, Coordinate dest0, Coordinate dest1, Coordinate dest2)

Parameters

src0 Coordinate
src1 Coordinate
src2 Coordinate
dest0 Coordinate
dest1 Coordinate
dest2 Coordinate

Returns

AffineTransformation

The computed transformation

CreateFromControlVectors(Coordinate[], Coordinate[])

Creates an AffineTransformation defined by a set of control vectors. Between one and three vectors must be supplied.

public static AffineTransformation CreateFromControlVectors(Coordinate[] src, Coordinate[] dest)

Parameters

src Coordinate[]

The source points of the vectors

dest Coordinate[]

The destination points of the vectors

Returns

AffineTransformation

The computed transformation

Exceptions

ArgumentException

if the control vector arrays are too short, long or of different lengths