Class AffineTransformation
Represents an affine transformation on the 2D Cartesian plane.
Inherited Members
Namespace: NetTopologySuite.Geometries.Utilities
Assembly: NetTopologySuite.dll
Syntax
public class AffineTransformation : ICloneable, ICoordinateSequenceFilter, IEquatable<AffineTransformation>
Remarks
It can be used to transform a Coordinate or Geometry. An affine transformation is a mapping of the 2D plane into itself via a series of transformations of the following basic types:
- reflection (through a line)
- rotation (around the origin)
- scaling (relative to the origin)
- shearing (in both the X and Y directions)
- translation
In general, affine transformations preserve straightness and parallel lines, but do not preserve distance or shape.
An affine transformation can be represented by a 3x3 matrix in the following form:
A coordinate P = (x, y) can be transformed to a new coordinate P' = (x', y') by representing it as a 3x1 matrix and using matrix multiplication to compute:T = | m00 m01 m02 |
| m10 m11 m12 |
| 0 0 1 |
| x' | = T x | x |
| y' | | y |
| 1 | | 1 |
Transformation Composition
Affine transformations can be composed using the Compose(AffineTransformation) method. Composition is computed via multiplication of the transformation matrices, and is defined as:
A.compose(B) = TB x TA
This produces a transformation whose effect is that of A followed by B. The methods Reflect(Double, Double, Double, Double), Rotate(Double), Scale(Double, Double), Shear(Double, Double), and Translate(Double, Double) have the effect of composing a transformation of that type with the transformation they are invoked on. The composition of transformations is in general not commutative.
Transformation Inversion
Affine transformations may be invertible or non-invertible. If a transformation is invertible, then there exists an inverse transformation which when composed produces the identity transformation. The GetInverse() method computes the inverse of a transformation, if one exists.
@author Martin Davis
Constructors
| Improve this Doc View SourceAffineTransformation()
Constructs a new identity transformation
Declaration
public AffineTransformation()
AffineTransformation(Coordinate, Coordinate, Coordinate, Coordinate, Coordinate, Coordinate)
Constructs a transformation which maps the given source points into the given destination points.
Declaration
public AffineTransformation(Coordinate src0, Coordinate src1, Coordinate src2, Coordinate dest0, Coordinate dest1, Coordinate dest2)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | src0 | source point 0 |
Coordinate | src1 | source point 1 |
Coordinate | src2 | source point 2 |
Coordinate | dest0 | the mapped point for source point 0 |
Coordinate | dest1 | the mapped point for source point 1 |
Coordinate | dest2 | the mapped point for source point 2 |
AffineTransformation(AffineTransformation)
Constructs a transformation which is a copy of the given one.
Declaration
public AffineTransformation(AffineTransformation trans)
Parameters
Type | Name | Description |
---|---|---|
AffineTransformation | trans | the transformation to copy |
AffineTransformation(Double, Double, Double, Double, Double, Double)
Constructs a new transformation whose matrix has the specified values.
Declaration
public AffineTransformation(double m00, double m01, double m02, double m10, double m11, double m12)
Parameters
Type | Name | Description |
---|---|---|
Double | m00 | the entry for the [0, 0] element in the transformation matrix |
Double | m01 | the entry for the [0, 1] element in the transformation matrix |
Double | m02 | the entry for the [0, 2] element in the transformation matrix |
Double | m10 | the entry for the [1, 0] element in the transformation matrix |
Double | m11 | the entry for the [1, 1] element in the transformation matrix |
Double | m12 | the entry for the [1, 2] element in the transformation matrix |
AffineTransformation(Double[])
Constructs a new transformation whose matrix has the specified values.
Declaration
public AffineTransformation(double[] matrix)
Parameters
Type | Name | Description |
---|---|---|
Double[] | matrix | an array containing the 6 values { m00, m01, m02, m10, m11, m12 } |
Exceptions
Type | Condition |
---|---|
NullReferenceException | if matrix is null |
IndexOutOfRangeException | if matrix is too small |
Properties
| Improve this Doc View SourceDeterminant
Computes the determinant of the transformation matrix.
Declaration
public double Determinant { get; }
Property Value
Type | Description |
---|---|
Double | the determinant of the transformation |
Remarks
The determinant is computed as:
| m00 m01 m02 |
| m10 m11 m12 | = m00 * m11 - m01 * m10
| 0 0 1 |
If the determinant is zero, the transform is singular (not invertible), and operations which attempt to compute an inverse will throw a NoninvertibleTransformationException.
Done
Reports that this filter should continue to be executed until all coordinates have been transformed.
Declaration
public bool Done { get; }
Property Value
Type | Description |
---|---|
Boolean | false |
GeometryChanged
Declaration
public bool GeometryChanged { get; }
Property Value
Type | Description |
---|---|
Boolean |
IsIdentity
Tests if this transformation is the identity transformation.
Declaration
public bool IsIdentity { get; }
Property Value
Type | Description |
---|---|
Boolean |
MatrixEntries
Gets an array containing the entries of the transformation matrix.
Declaration
public double[] MatrixEntries { get; }
Property Value
Type | Description |
---|---|
Double[] | an array of length 6 |
Remarks
Only the 6 non-trivial entries are returned, in the sequence:
m00, m01, m02, m10, m11, m12
Methods
| Improve this Doc View SourceClone()
Clones this transformation
Declaration
public object Clone()
Returns
Type | Description |
---|---|
Object | A copy of this transformation |
Compose(AffineTransformation)
Updates this transformation to be the composition of this transformation with the given AffineTransformation.
Declaration
public AffineTransformation Compose(AffineTransformation trans)
Parameters
Type | Name | Description |
---|---|---|
AffineTransformation | trans | an affine transformation |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
This produces a transformation whose effect is equal to applying this transformation followed by the argument transformation. Mathematically,
A.compose(B) = TB x TA
ComposeBefore(AffineTransformation)
Updates this transformation to be the composition of a given AffineTransformation with this transformation.
Declaration
public AffineTransformation ComposeBefore(AffineTransformation trans)
Parameters
Type | Name | Description |
---|---|---|
AffineTransformation | trans | an affine transformation |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
This produces a transformation whose effect is equal to applying the argument transformation followed by this transformation. Mathematically,
A.composeBefore(B) = TA x TB
Equals(AffineTransformation)
Declaration
public bool Equals(AffineTransformation trans)
Parameters
Type | Name | Description |
---|---|---|
AffineTransformation | trans |
Returns
Type | Description |
---|---|
Boolean |
Equals(Object)
Tests if an object is an AffineTransformation
and has the same matrix as this transformation.
Declaration
public override bool Equals(object obj)
Parameters
Type | Name | Description |
---|---|---|
Object | obj | An object to test |
Returns
Type | Description |
---|---|
Boolean | true if the given object is equal to this object |
Overrides
| Improve this Doc View SourceFilter(CoordinateSequence, Int32)
Transforms the i'th coordinate in the input sequence
Declaration
public void Filter(CoordinateSequence seq, int i)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequence | seq | A |
Int32 | i | The index of the coordinate to transform |
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 |
Overrides
| Improve this Doc View SourceGetInverse()
Computes the inverse of this transformation, if one exists.
Declaration
public AffineTransformation GetInverse()
Returns
Type | Description |
---|---|
AffineTransformation | A new inverse transformation |
Remarks
The inverse is the transformation which when composed with this one produces the identity transformation. A transformation has an inverse if and only if it is not singular (i.e. its determinant is non-zero). Geometrically, an transformation is non-invertible if it maps the plane to a line or a point. If no inverse exists this method will throw a NoninvertibleTransformationException.
The matrix of the inverse is equal to the inverse of the matrix for the transformation. It is computed as follows:
1 inverse(A) = --- x adjoint(A) det
= 1 | m11 -m01 m01*m12-m02*m11 | --- x | -m10 m00 -m00*m12+m10*m02 | det | 0 0 m00*m11-m10*m01 | = | m11/det -m01/det m01*m12-m02*m11/det | | -m10/det m00/det -m00*m12+m10*m02/det | | 0 0 1 |</code></pre></blockquote>
Exceptions
Type | Condition |
---|---|
NoninvertibleTransformationException |
Reflect(Double, Double)
Updates the value of this transformation to that of a reflection transformation composed with the current value.
Declaration
public AffineTransformation Reflect(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | the x-ordinate of the line to reflect around |
Double | y | the y-ordinate of the line to reflect around |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Reflect(Double, Double, Double, Double)
Updates the value of this transformation to that of a reflection transformation composed with the current value.
Declaration
public AffineTransformation Reflect(double x0, double y0, double x1, double y1)
Parameters
Type | Name | Description |
---|---|---|
Double | x0 | the x-ordinate of a point on the line to reflect around |
Double | y0 | the y-ordinate of a point on the line to reflect around |
Double | x1 | the x-ordinate of a point on the line to reflect around |
Double | y1 | the y-ordinate of a point on the line to reflect around |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
ReflectionInstance(Double, Double)
Creates a transformation for a reflection about the line (0,0) - (x,y).
Declaration
public static AffineTransformation ReflectionInstance(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | the x-ordinate of a point on the reflection line |
Double | y | the y-ordinate of a point on the reflection line |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the reflection |
ReflectionInstance(Double, Double, Double, Double)
Creates a transformation for a reflection about the line (x0,y0) - (x1,y1).
Declaration
public static AffineTransformation ReflectionInstance(double x0, double y0, double x1, double y1)
Parameters
Type | Name | Description |
---|---|---|
Double | x0 | the x-ordinate of a point on the reflection line |
Double | y0 | the y-ordinate of a point on the reflection line |
Double | x1 | the x-ordinate of a another point on the reflection line |
Double | y1 | the y-ordinate of a another point on the reflection line |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the reflection |
Rotate(Double)
Updates the value of this transformation to that of a rotation transformation composed with the current value.
Declaration
public AffineTransformation Rotate(double theta)
Parameters
Type | Name | Description |
---|---|---|
Double | theta | the angle to rotate by in radians |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
Positive angles correspond to a rotation in the counter-clockwise direction.
Rotate(Double, Double)
Updates the value of this transformation to that of a rotation around the origin composed with the current value, with the sin and cos of the rotation angle specified directly.
Declaration
public AffineTransformation Rotate(double sinTheta, double cosTheta)
Parameters
Type | Name | Description |
---|---|---|
Double | sinTheta | the sine of the angle to rotate by |
Double | cosTheta | the cosine of the angle to rotate by |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Rotate(Double, Double, Double)
Updates the value of this transformation to that of a rotation around a given point composed with the current value.
Declaration
public AffineTransformation Rotate(double theta, double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | theta | the angle to rotate by, in radians |
Double | x | the x-ordinate of the rotation point |
Double | y | the y-ordinate of the rotation point |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
Positive angles correspond to a rotation in the counter-clockwise direction.
Rotate(Double, Double, Double, Double)
Updates the value of this transformation to that of a rotation around a given point composed with the current value, with the sin and cos of the rotation angle specified directly.
Declaration
public AffineTransformation Rotate(double sinTheta, double cosTheta, double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | sinTheta | the sine of the angle to rotate by |
Double | cosTheta | the cosine of the angle to rotate by |
Double | x | the x-ordinate of the rotation point |
Double | y | the y-ordinate of the rotation point |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
RotationInstance(Double)
Creates a transformation for a rotation about the origin by an angle theta.
Declaration
public static AffineTransformation RotationInstance(double theta)
Parameters
Type | Name | Description |
---|---|---|
Double | theta | the rotation angle, in radians |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the rotation |
Remarks
Positive angles correspond to a rotation in the counter-clockwise direction.
RotationInstance(Double, Double)
Creates a transformation for a rotation by an angle theta, specified by the sine and cosine of the angle.
Declaration
public static AffineTransformation RotationInstance(double sinTheta, double cosTheta)
Parameters
Type | Name | Description |
---|---|---|
Double | sinTheta | the sine of the rotation angle |
Double | cosTheta | the cosine of the rotation angle |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the rotation |
Remarks
This allows providing exact values for sin(theta) and cos(theta) for the common case of rotations of multiples of quarter-circles.
RotationInstance(Double, Double, Double)
Creates a transformation for a rotation about the point (x,y) by an angle theta.
Declaration
public static AffineTransformation RotationInstance(double theta, double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | theta | the rotation angle, in radians |
Double | x | the x-ordinate of the rotation point |
Double | y | the y-ordinate of the rotation point |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the rotation |
Remarks
Positive angles correspond to a rotation in the counter-clockwise direction.
RotationInstance(Double, Double, Double, Double)
Creates a transformation for a rotation about the point (x,y) by an angle theta, specified by the sine and cosine of the angle.
Declaration
public static AffineTransformation RotationInstance(double sinTheta, double cosTheta, double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | sinTheta | the sine of the rotation angle |
Double | cosTheta | the cosine of the rotation angle |
Double | x | the x-ordinate of the rotation point |
Double | y | the y-ordinate of the rotation point |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the rotation |
Remarks
This allows providing exact values for sin(theta) and cos(theta) for the common case of rotations of multiples of quarter-circles.
Scale(Double, Double)
Updates the value of this transformation to that of a scale transformation composed with the current value.
Declaration
public AffineTransformation Scale(double xScale, double yScale)
Parameters
Type | Name | Description |
---|---|---|
Double | xScale | the value to scale by in the x direction |
Double | yScale | the value to scale by in the y direction |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
ScaleInstance(Double, Double)
Creates a transformation for a scaling relative to the origin.
Declaration
public static AffineTransformation ScaleInstance(double xScale, double yScale)
Parameters
Type | Name | Description |
---|---|---|
Double | xScale | the value to scale by in the x direction |
Double | yScale | the value to scale by in the y direction |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the scaling |
ScaleInstance(Double, Double, Double, Double)
Creates a transformation for a scaling relative to the point (x,y).
Declaration
public static AffineTransformation ScaleInstance(double xScale, double yScale, double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | xScale | The value to scale by in the x direction |
Double | yScale | The value to scale by in the y direction |
Double | x | The x-ordinate of the point to scale around |
Double | y | The y-ordinate of the point to scale around |
Returns
Type | Description |
---|---|
AffineTransformation | A transformation for the scaling |
SetToIdentity()
Sets this transformation to be the identity transformation.
Declaration
public AffineTransformation SetToIdentity()
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
The identity transformation has the matrix:
| 1 0 0 |
| 0 1 0 |
| 0 0 1 |
SetToReflection(Double, Double)
Sets this transformation to be a reflection about the line defined by vector (x,y).
Declaration
public AffineTransformation SetToReflection(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | the x-component of the reflection line vector |
Double | y | the y-component of the reflection line vector |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
The transformation for a reflection is computed by:
d = sqrt(x2 + y2) sin = x / d; cos = x / d; Tref = Trot(sin, cos) x Tscale(1, -1) x Trot(-sin, cos)
SetToReflection(Double, Double, Double, Double)
Sets this transformation to be a reflection about the line defined by a line (x0,y0) - (x1,y1).
Declaration
public AffineTransformation SetToReflection(double x0, double y0, double x1, double y1)
Parameters
Type | Name | Description |
---|---|---|
Double | x0 | The x-ordinate of one point on the reflection line |
Double | y0 | The y-ordinate of one point on the reflection line |
Double | x1 | The x-ordinate of another point on the reflection line |
Double | y1 | The y-ordinate of another point on the reflection line |
Returns
Type | Description |
---|---|
AffineTransformation | This transformation with an updated matrix |
SetToReflectionBasic(Double, Double, Double, Double)
Explicitly computes the math for a reflection. May not work.
Declaration
public AffineTransformation SetToReflectionBasic(double x0, double y0, double x1, double y1)
Parameters
Type | Name | Description |
---|---|---|
Double | x0 | The x-ordinate of one point on the reflection line |
Double | y0 | The y-ordinate of one point on the reflection line |
Double | x1 | The x-ordinate of another point on the reflection line |
Double | y1 | The y-ordinate of another point on the reflection line |
Returns
Type | Description |
---|---|
AffineTransformation | This transformation with an updated matrix |
SetToRotation(Double)
Sets this transformation to be a rotation around the orign.
Declaration
public AffineTransformation SetToRotation(double theta)
Parameters
Type | Name | Description |
---|---|---|
Double | theta | the rotation angle, in radians |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
A positive rotation angle corresponds
to a counter-clockwise rotation.
The transformation matrix for a rotation
by an angle theta
has the value:
| cos(theta) -sin(theta) 0 | | sin(theta) cos(theta) 0 | | 0 0 1 |
SetToRotation(Double, Double)
Sets this transformation to be a rotation around the origin by specifying the sin and cos of the rotation angle directly.
Declaration
public AffineTransformation SetToRotation(double sinTheta, double cosTheta)
Parameters
Type | Name | Description |
---|---|---|
Double | sinTheta | the sine of the rotation angle |
Double | cosTheta | the cosine of the rotation angle |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
The transformation matrix for the rotation has the value:
| cosTheta -sinTheta 0 | | sinTheta cosTheta 0 | | 0 0 1 |
SetToRotation(Double, Double, Double)
Sets this transformation to be a rotation around a given point (x,y).
Declaration
public AffineTransformation SetToRotation(double theta, double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | theta | the rotation angle, in radians |
Double | x | the x-ordinate of the rotation point |
Double | y | the y-ordinate of the rotation point |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
A positive rotation angle corresponds
to a counter-clockwise rotation.
The transformation matrix for a rotation
by an angle theta
has the value:
| cosTheta -sinTheta x-x*cos+y*sin | | sinTheta cosTheta y-x*sin-y*cos | | 0 0 1 |
SetToRotation(Double, Double, Double, Double)
Sets this transformation to be a rotation around a given point (x,y) by specifying the sin and cos of the rotation angle directly.
Declaration
public AffineTransformation SetToRotation(double sinTheta, double cosTheta, double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | sinTheta | the sine of the rotation angle |
Double | cosTheta | the cosine of the rotation angle |
Double | x | the x-ordinate of the rotation point |
Double | y | the y-ordinate of the rotation point |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
The transformation matrix for the rotation has the value:
| cosTheta -sinTheta x-x*cos+y*sin | | sinTheta cosTheta y-x*sin-y*cos | | 0 0 1 |
SetToScale(Double, Double)
Sets this transformation to be a scaling.
Declaration
public AffineTransformation SetToScale(double xScale, double yScale)
Parameters
Type | Name | Description |
---|---|---|
Double | xScale | the amount to scale x-ordinates by |
Double | yScale | the amount to scale y-ordinates by |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
The transformation matrix for a scale has the value:
| xScale 0 dx | | 0 yScale dy | | 0 0 1 |
SetToShear(Double, Double)
Sets this transformation to be a shear.
Declaration
public AffineTransformation SetToShear(double xShear, double yShear)
Parameters
Type | Name | Description |
---|---|---|
Double | xShear | the x component to shear by |
Double | yShear | the y component to shear by |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
The transformation matrix for a shear has the value:
Note that a shear of (1, 1) is not equal to shear(1, 0) composed with shear(0, 1). Instead, shear(1, 1) corresponds to a mapping onto the line x = y.| 1 xShear 0 | | yShear 1 0 | | 0 0 1 |
SetToTranslation(Double, Double)
Sets this transformation to be a translation.
Declaration
public AffineTransformation SetToTranslation(double dx, double dy)
Parameters
Type | Name | Description |
---|---|---|
Double | dx | the x component to translate by |
Double | dy | the y component to translate by |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Remarks
For a translation by the vector (x, y) the transformation matrix has the value:
| 1 0 dx | | 1 0 dy | | 0 0 1 |
SetTransformation(AffineTransformation)
Sets this transformation to be a copy of the given one
Declaration
public AffineTransformation SetTransformation(AffineTransformation trans)
Parameters
Type | Name | Description |
---|---|---|
AffineTransformation | trans | a transformation to copy |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
SetTransformation(Double, Double, Double, Double, Double, Double)
Sets this transformation's matrix to have the given values.
Declaration
public AffineTransformation SetTransformation(double m00, double m01, double m02, double m10, double m11, double m12)
Parameters
Type | Name | Description |
---|---|---|
Double | m00 | the entry for the [0, 0] element in the transformation matrix |
Double | m01 | the entry for the [0, 1] element in the transformation matrix |
Double | m02 | the entry for the [0, 2] element in the transformation matrix |
Double | m10 | the entry for the [1, 0] element in the transformation matrix |
Double | m11 | the entry for the [1, 1] element in the transformation matrix |
Double | m12 | the entry for the [1, 2] element in the transformation matrix |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
Shear(Double, Double)
Updates the value of this transformation to that of a shear transformation composed with the current value.
Declaration
public AffineTransformation Shear(double xShear, double yShear)
Parameters
Type | Name | Description |
---|---|---|
Double | xShear | the value to shear by in the x direction |
Double | yShear | the value to shear by in the y direction |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
ShearInstance(Double, Double)
Creates a transformation for a shear.
Declaration
public static AffineTransformation ShearInstance(double xShear, double yShear)
Parameters
Type | Name | Description |
---|---|---|
Double | xShear | the value to shear by in the x direction |
Double | yShear | the value to shear by in the y direction |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the shear |
ToString()
Gets a text representation of this transformation. The string is of the form:
AffineTransformation[[m00, m01, m02], [m10, m11, m12]]
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
String | A string representing this transformation |
Overrides
| Improve this Doc View SourceTransform(Coordinate, Coordinate)
Applies this transformation to the src
coordinate
and places the results in the dest
coordinate
(which may be the same as the source).
Declaration
public Coordinate Transform(Coordinate src, Coordinate dest)
Parameters
Type | Name | Description |
---|---|---|
Coordinate | src | the coordinate to transform |
Coordinate | dest | the coordinate to accept the results |
Returns
Type | Description |
---|---|
Coordinate | the |
Transform(CoordinateSequence, Int32)
Applies this transformation to the i'th coordinate in the given CoordinateSequence.
Declaration
public void Transform(CoordinateSequence seq, int i)
Parameters
Type | Name | Description |
---|---|---|
CoordinateSequence | seq | a |
Int32 | i | the index of the coordinate to transform |
Transform(Geometry)
Creates a new Geometry which is the result of this transformation applied to the input Geometry.
Declaration
public Geometry Transform(Geometry g)
Parameters
Type | Name | Description |
---|---|---|
Geometry | g | A |
Returns
Type | Description |
---|---|
Geometry | The transformed Geometry |
Translate(Double, Double)
Updates the value of this transformation to that of a translation transformation composed with the current value.
Declaration
public AffineTransformation Translate(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | the value to translate by in the x direction |
Double | y | the value to translate by in the y direction |
Returns
Type | Description |
---|---|
AffineTransformation | this transformation, with an updated matrix |
TranslationInstance(Double, Double)
Creates a transformation for a translation.
Declaration
public static AffineTransformation TranslationInstance(double x, double y)
Parameters
Type | Name | Description |
---|---|---|
Double | x | the value to translate by in the x direction |
Double | y | the value to translate by in the y direction |
Returns
Type | Description |
---|---|
AffineTransformation | a transformation for the translation |