C# Class MapAround.CoordinateSystems.Transformations.Affine

Implements an affine transformations. An affine transformation between two vector spaces (strictly speaking, two affine spaces) consists of a linear transformation followed by a translation: x => A * x + b.
Inheritance: MathTransform
显示文件 Open project: gkrsu/maparound.core Class Usage Examples

Public Methods

Method Description
Affine ( MathUtils matrix ) : System

Initializes a new instance of the MapAround.CoordinateSystem.Transformations.Affine.

Affine ( double m11, double m12, double m21, double m22, double dx, double dy ) : System

Initializes a new instance of the MapAround.CoordinateSystem.Transformations.Affine.

CombineWith ( Affine other ) : void

Combines this affine transfor with the other. The result of the combined transformation is equivalent to the result of successive application of transformations. Preferable to use this form of combination, not ConcatenatedTransform, because ConcatenatedTransform applies each transformation consistently, and CombineWith method calculates the resulting transformation matrix.

Inverse ( ) : IMathTransform

Creates the inverse transform of this object.

This method may fail if the transformation matrix is not invertible.

Invert ( ) : void

Inverts this transform.

This method may fail if the transformation matrix is not invertible.

Rotation ( double angle ) : Affine

Create a rotation transform.

RotationAt ( ICoordinate coordinate, double angle ) : Affine

Create a transform of rotation at the specified point.

Scaling ( double factor ) : Affine

Create a scaling transform.

Scaling ( double xFactor, double yFactor ) : Affine

Create a scaling transform.

Shearing ( double xShare, double yShare ) : Affine

Create a shearing transform.

Transform ( double point ) : double[]

Transforms a coordinate point.

The passed parameter point should not be modified.

TransformList ( List points ) : List

Transforms a list of coordinate point ordinal values.

This method is provided for efficiently transforming many points. The supplied array of ordinal values will contain packed ordinal values. For example, if the source dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). The size of the passed array must be an integer multiple of DimSource. The returned ordinal values are packed in a similar way. In some DCPs. the ordinals may be transformed in-place, and the returned array may be the same as the passed array. So any client code should not attempt to reuse the passed ordinal values (although they can certainly reuse the passed array). If there is any problem then the server implementation will throw an exception. If this happens then the client should not make any assumptions about the state of the ordinal values.

Translation ( double x, double y ) : Affine

Create a translation transform.

Private Methods

Method Description
Affine ( MathUtils matrix, MathUtils inverseMatrix, bool isInverse ) : System

Initializes a new instance of the MapAround.CoordinateSystem.Transformations.Affine.

Affine ( MathUtils matrix, bool isInverse ) : System

Initializes a new instance of the MapAround.CoordinateSystem.Transformations.Affine.

apply ( double p ) : double[]
applyInverted ( double p ) : double[]

Method Details

Affine() public method

Initializes a new instance of the MapAround.CoordinateSystem.Transformations.Affine.
public Affine ( MathUtils matrix ) : System
matrix MathUtils
return System

Affine() public method

Initializes a new instance of the MapAround.CoordinateSystem.Transformations.Affine.
public Affine ( double m11, double m12, double m21, double m22, double dx, double dy ) : System
m11 double Value in the first row first column
m12 double Value in the first row of the second column
m21 double Value in the second row first column
m22 double Value in the second row second column
dx double Value in the third row first column
dy double Value in the third row second column
return System

CombineWith() public method

Combines this affine transfor with the other. The result of the combined transformation is equivalent to the result of successive application of transformations. Preferable to use this form of combination, not ConcatenatedTransform, because ConcatenatedTransform applies each transformation consistently, and CombineWith method calculates the resulting transformation matrix.
public CombineWith ( Affine other ) : void
other Affine An affine transform to combine
return void

Inverse() public method

Creates the inverse transform of this object.
This method may fail if the transformation matrix is not invertible.
public Inverse ( ) : IMathTransform
return IMathTransform

Invert() public method

Inverts this transform.
This method may fail if the transformation matrix is not invertible.
public Invert ( ) : void
return void

Rotation() public static method

Create a rotation transform.
public static Rotation ( double angle ) : Affine
angle double An angle (in radians) of rotation
return Affine

RotationAt() public static method

Create a transform of rotation at the specified point.
public static RotationAt ( ICoordinate coordinate, double angle ) : Affine
coordinate ICoordinate Center of rotation
angle double An angle (in radians) of rotation
return Affine

Scaling() public static method

Create a scaling transform.
public static Scaling ( double factor ) : Affine
factor double Scale factor value
return Affine

Scaling() public static method

Create a scaling transform.
public static Scaling ( double xFactor, double yFactor ) : Affine
xFactor double X scale factor
yFactor double Y scale factor value
return Affine

Shearing() public static method

Create a shearing transform.
public static Shearing ( double xShare, double yShare ) : Affine
xShare double X sheare
yShare double Y sheare
return Affine

Transform() public method

Transforms a coordinate point.
The passed parameter point should not be modified.
public Transform ( double point ) : double[]
point double An array containing the point coordinates to transform
return double[]

TransformList() public method

Transforms a list of coordinate point ordinal values.
This method is provided for efficiently transforming many points. The supplied array of ordinal values will contain packed ordinal values. For example, if the source dimension is 3, then the ordinals will be packed in this order (x0,y0,z0,x1,y1,z1 ...). The size of the passed array must be an integer multiple of DimSource. The returned ordinal values are packed in a similar way. In some DCPs. the ordinals may be transformed in-place, and the returned array may be the same as the passed array. So any client code should not attempt to reuse the passed ordinal values (although they can certainly reuse the passed array). If there is any problem then the server implementation will throw an exception. If this happens then the client should not make any assumptions about the state of the ordinal values.
public TransformList ( List points ) : List
points List Packed ordinates of points to transform
return List

Translation() public static method

Create a translation transform.
public static Translation ( double x, double y ) : Affine
x double X translation
y double Y translation
return Affine