Click or drag to resize

Transform2d Structure

Represents the values in a 2d affine transformation.

This is parallel to C++ ON_Xform2d.

Namespace:  Rhino.Geometry
Assembly:  RhinoCommon (in RhinoCommon.dll)
Syntax
[SerializableAttribute]
public struct Transform2d : IComparable<Transform2d>, 
	IEquatable<Transform2d>, ICloneable

The Transform2d type exposes the following members.

Constructors
  NameDescription
Public methodTransform2d(Double)
Initializes a new transform matrix with a specified value along the diagonal.
Public methodTransform2d(Transform2d)
Initializes a new transform matrix from another transform matrix.
Public methodTransform2d(Double, Double, Double, Double, Double, Double)
Initializes a new transform matrix from its six values.
Top
Properties
  NameDescription
Public propertyDeterminant
The determinant of the 2x2 linear part of this matrix. Because the bottom row is (0,0,1) this is also the signed area scale factor of the transformation. A negative determinant means the transformation reverses orientation.
Public propertyStatic memberIdentity
Gets a new identity transform matrix. An identity matrix defines no transformation.
Public propertyIsIdentity
Return true if this Transform2d is the identity transform.
Public propertyIsTranslation
True if this transform is a pure translation, that is the linear part is the 2x2 identity.
Public propertyIsValid
Gets a value indicating whether or not this Transform2d is a valid matrix. A valid transform matrix is not allowed to have any invalid numbers.
Public propertyIsZeroTransformation
True if every value is 0. This transformation maps every point to (0,0).
Public propertyItem
Gets or sets the matrix value at the given row and column indices.
Public propertyM00
Gets or sets this[0,0].
Public propertyM01
Gets or sets this[0,1].
Public propertyM02
Gets or sets this[0,2], the X translation.
Public propertyM10
Gets or sets this[1,0].
Public propertyM11
Gets or sets this[1,1].
Public propertyM12
Gets or sets this[1,2], the Y translation.
Public propertyStatic memberNan
Gets a transform matrix in which every value is not-a-number. The static constructors return this when they are given invalid input.
Public propertyStatic memberUnset
Gets a transform matrix filled with RhinoMath.UnsetValue.
Public propertyStatic memberZeroTransformation
Gets a transform matrix in which every value is zero. This transformation maps every point to (0,0).
Top
Methods
  NameDescription
Public methodClone
Returns a deep copy of the transform. For languages that treat structures as value types, this can be accomplished by a simple assignment.
Public methodCompareTo
Compares this transform with another transform.

M00 has highest value, then M01, etc..

Public methodEquals(Object)
Determines if another object is a Transform2d and its value equals this transform value.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(Transform2d)
Determines if another transform equals this transform value.
Public methodStatic memberFromAffineElements(Double)
Creates a transform from an array of six coefficients in (a, b, c, d, tx, ty) order.
Public methodStatic memberFromAffineElements(Single)
Creates a transform from an array of six coefficients in (a, b, c, d, tx, ty) order.
Public methodStatic memberFromAffineElements(Double, Double, Double, Double, Double, Double)
Creates a transform from the six coefficients used by the traditional 2d drawing APIs. See the remarks on ToAffineElements.
Public methodGetAffineElements
Gets the six coefficients used by the traditional 2d drawing APIs. See the remarks on ToAffineElements.
Public methodGetHashCode
Gets a non-unique hashing code for this transform.
(Overrides ValueTypeGetHashCode.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberMultiply
Multiplies (combines) two transformations.

This is the same as the * operator between two transformations.

Public methodStatic memberRotation(Double)
Constructs a new rotation transformation with the origin as the rotation center.
Public methodStatic memberRotation(Double, Point2d)
Constructs a new rotation transformation with a specified rotation center.
Public methodStatic memberRotation(Double, Double, Point2d)
Constructs a new rotation transformation from the sine and cosine of an angle and a specified rotation center.
Public methodStatic memberRotation(Vector2d, Vector2d, Point2d)
Constructs the rotation that maps one direction onto another while fixing a rotation center.
Public methodStatic memberScale(Point2d, Double)
Constructs a new uniform scaling transformation with a specified anchor point.
Public methodStatic memberScale(Point2d, Double, Double)
Constructs a new non-uniform scaling transformation with a specified anchor point.
Public methodToAffineElements
Gets the six coefficients used by the traditional 2d drawing APIs as an array in (a, b, c, d, tx, ty) order.
Public methodToString
Returns a string representation of this transform.
(Overrides ValueTypeToString.)
Public methodToTransform
Gets the 4x4 transformation that applies this 2d transformation to the x and y coordinates and leaves the z coordinate unchanged.
Public methodStatic memberTranslation(Vector2d)
Constructs a new translation (move) transformation.
Public methodStatic memberTranslation(Double, Double)
Constructs a new translation (move) transformation. Right column is (dx, dy).
Public methodTryGetInverse
Attempts to get the inverse transform of this transform.
Public methodStatic memberTryGetTransform2d(Transform, Transform2d)
Attempts to get the 2d transformation defined by the x and y rows and columns of a 4x4 transformation. This succeeds when transform is affine and maps the world xy plane to itself.
Public methodStatic memberTryGetTransform2d(Transform, Double, Transform2d)
Attempts to get the 2d transformation defined by the x and y rows and columns of a 4x4 transformation. This succeeds when transform is affine and maps the world xy plane to itself.
Top
Operators
  NameDescription
Public operatorStatic memberEquality
Determines if two transformations are equal in value.
Public operatorStatic memberInequality
Determines if two transformations are different in value.
Public operatorStatic memberMultiply(Transform2d, Point2d)
Multiplies a transformation by a point and gets a new point.
Public operatorStatic memberMultiply(Transform2d, Transform2d)
Multiplies (combines) two transformations.
Public operatorStatic memberMultiply(Transform2d, Vector2d)
Multiplies a transformation by a vector and gets a new vector.
Top
See Also