Class Matrix3D
Represents a 4 x 4 matrix used for transformations in 3-D space.
Inheritance
Namespace: Telerik.Windows.Media.Media3D
Assembly: Telerik.Windows.Controls.Charting.dll
Syntax
public sealed class Matrix3D : ValueType
Constructors
Matrix3D(Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double)
Initializes a new instance of the Matrix3D struct.
Declaration
public Matrix3D(double m11, double m12, double m13, double m14, double m21, double m22, double m23, double m24, double m31, double m32, double m33, double m34, double offsetX, double offsetY, double offsetZ, double m44)
Parameters
System.Double
m11
Value of the (1,1) field of the new matrix. |
System.Double
m12
Value of the (1,2) field of the new matrix. |
System.Double
m13
Value of the (1,3) field of the new matrix. |
System.Double
m14
Value of the (1,4) field of the new matrix. |
System.Double
m21
Value of the (2,1) field of the new matrix. |
System.Double
m22
Value of the (2,2) field of the new matrix. |
System.Double
m23
Value of the (2,3) field of the new matrix. |
System.Double
m24
Value of the (2,4) field of the new matrix. |
System.Double
m31
Value of the (3,1) field of the new matrix. |
System.Double
m32
Value of the (3,2) field of the new matrix. |
System.Double
m33
Value of the (3,3) field of the new matrix. |
System.Double
m34
Value of the (3,4) field of the new matrix. |
System.Double
offsetX
Value of the X offset field of the new matrix. |
System.Double
offsetY
Value of the Y offset field of the new matrix. |
System.Double
offsetZ
Value of the Z offset field of the new matrix. |
System.Double
m44
Value of the (4,4) field of the new matrix. |
Properties
Determinant
Retrieves the determinant of this Matrix3D structure.
Declaration
public double Determinant { get; }
Property Value
System.Double
|
HasInverse
Gets a value that indicates whether this Matrix3D is invertible.
Declaration
public bool HasInverse { get; }
Property Value
System.Boolean
|
Identity
Returns an identity matrix instance.
Declaration
public static Matrix3D Identity { get; }
Property Value
Matrix3D
|
IsAffine
Gets a value that indicates whether this Matrix3D structure is affine.
Declaration
public bool IsAffine { get; }
Property Value
System.Boolean
True if the Matrix3D structure is affine; otherwise, false. |
IsIdentity
Determines whether this Matrix3D structure is an identity Matrix3D.
Declaration
public bool IsIdentity { get; }
Property Value
System.Boolean
True if the Matrix3D structure is an identity Matrix3D; otherwise, false. The default value is true. |
Remarks
In an identity matrix, all coefficients are 0 except the [1,1][2,2][3,3][4,4] coefficients, which are set to 1. The identity matrix is special in that when it is applied to vertices, they are unchanged. The identity matrix is used as the starting point for matrices that modify vertex values to create rotations, translations, and any other transformations that can be represented by a 4x4 matrix.
M11
Gets or sets the value of the first row and first column of this Matrix3D structure.
Declaration
public double M11 { get; set; }
Property Value
System.Double
|
M12
Gets or sets the value of the first row and second column of this Matrix3D structure.
Declaration
public double M12 { get; set; }
Property Value
System.Double
|
M13
Gets or sets the value of the first row and third column of this Matrix3D structure.
Declaration
public double M13 { get; set; }
Property Value
System.Double
|
M14
Gets or sets the value of the first row and fourth column of this Matrix3D structure.
Declaration
public double M14 { get; set; }
Property Value
System.Double
|
M21
Gets or sets the value of the second row and first column of this Matrix3D structure.
Declaration
public double M21 { get; set; }
Property Value
System.Double
|
M22
Gets or sets the value of the second row and second column of this Matrix3D structure.
Declaration
public double M22 { get; set; }
Property Value
System.Double
|
M23
Gets or sets the value of the second row and third column of this Matrix3D structure.
Declaration
public double M23 { get; set; }
Property Value
System.Double
|
M24
Gets or sets the value of the second row and fourth column of this Matrix3D structure.
Declaration
public double M24 { get; set; }
Property Value
System.Double
|
M31
Gets or sets the value of the third row and first column of this Matrix3D structure.
Declaration
public double M31 { get; set; }
Property Value
System.Double
|
M32
Gets or sets the value of the third row and second column of this Matrix3D structure.
Declaration
public double M32 { get; set; }
Property Value
System.Double
|
M33
Gets or sets the value of the third row and third column of this Matrix3D structure.
Declaration
public double M33 { get; set; }
Property Value
System.Double
|
M34
Gets or sets the value of the third row and fourth column of this Matrix3D structure.
Declaration
public double M34 { get; set; }
Property Value
System.Double
|
M44
Gets or sets the value of the fourth row and fourth column of this Matrix3D structure.
Declaration
public double M44 { get; set; }
Property Value
System.Double
|
OffsetX
Gets or sets the value of the fourth row and first column of this Matrix3D structure.
Declaration
public double OffsetX { get; set; }
Property Value
System.Double
|
OffsetY
Gets or sets the value of the fourth row and second column of this Matrix3D structure.
Declaration
public double OffsetY { get; set; }
Property Value
System.Double
|
OffsetZ
Gets or sets the value of the fourth row and third column of this Matrix3D structure.
Declaration
public double OffsetZ { get; set; }
Property Value
System.Double
|
Methods
Append(Matrix3D)
Appends a specified matrix to the current matrix.
Declaration
public void Append(Matrix3D matrix)
Parameters
Matrix3D
matrix
Matrix to append. |
Equals(Object)
Tests equality between two matrices.
Declaration
public override bool Equals(object obj)
Parameters
System.Object
obj
Object to test for equality. |
Returns
System.Boolean
Boolean that indicates whether the matrices are equal. |
Equals(Matrix3D)
Tests equality between two matrices.
Declaration
public bool Equals(Matrix3D matrix)
Parameters
Matrix3D
matrix
The Matrix3D to which to compare. |
Returns
System.Boolean
Boolean that indicates whether the matrices are equal. |
Equals(Matrix3D, Matrix3D)
Tests equality between two matrices.
Declaration
public static bool Equals(Matrix3D matrix1, Matrix3D matrix2)
Parameters
Matrix3D
matrix1
The first Matrix3D to compare. |
Matrix3D
matrix2
The second Matrix3D to compare. |
Returns
System.Boolean
Boolean that indicates whether the matrices are equal. |
GetHashCode()
Gets a hash code for this Matrix3D structure.
Declaration
public override int GetHashCode()
Returns
System.Int32
A hash code for this Matrix3D structure. |
Invert()
Inverts this Matrix3D structure.
Declaration
public void Invert()
Remarks
To determine whether a Matrix3D structure is invertible, read its HasInverse property.
Exceptions
System.InvalidOperationException
Throws InvalidOperationException if the matrix is not invertible. |
Multiply(Matrix3D, Matrix3D)
Multiplies the specified matrices.
Declaration
public static Matrix3D Multiply(Matrix3D matrix1, Matrix3D matrix2)
Parameters
Matrix3D
matrix1
Matrix to multiply. |
Matrix3D
matrix2
Matrix by which the first matrix is multiplied. |
Returns
Matrix3D
Matrix3D that is the result of multiplication. |
Parse(String)
Converts a String representation of a 3-D matrix into the equivalent Matrix3D structure.
Declaration
public static Matrix3D Parse(string source)
Parameters
System.String
source
The String representation of the 3-D matrix. |
Returns
Matrix3D
The equivalent Matrix3D structure. |
Prepend(Matrix3D)
Prepends a specified matrix to the current matrix.
Declaration
public void Prepend(Matrix3D matrix)
Parameters
Matrix3D
matrix
Matrix to prepend. |
Rotate(Quaternion)
Appends a rotation transform to the current Matrix3D.
Declaration
public void Rotate(Quaternion quaternion)
Parameters
Quaternion
quaternion
Quaternion that represents the rotation. |
RotateAt(Quaternion, Point3D)
Rotates this Matrix3D about the specified Point3D.
Declaration
public void RotateAt(Quaternion quaternion, Point3D center)
Parameters
Quaternion
quaternion
Quaternion that represents the rotation. |
Point3D
center
Center Point3D about which to rotate. |
RotateAtPrepend(Quaternion, Point3D)
Prepends a rotation about a specified center Point3D to this Matrix3D structure.
Declaration
public void RotateAtPrepend(Quaternion quaternion, Point3D center)
Parameters
Quaternion
quaternion
Quaternion that represents the rotation. |
Point3D
center
Center Point3D about which to rotate. |
RotatePrepend(Quaternion)
Prepends a rotation specified by a Quaternion to this Matrix3D structure.
Declaration
public void RotatePrepend(Quaternion quaternion)
Parameters
Quaternion
quaternion
Quaternion representing rotation. |
Scale(Vector3D)
Appends the specified scale Vector3D to this Matrix3D structure.
Declaration
public void Scale(Vector3D vector)
Parameters
Vector3D
vector
Vector3D by which to scale this Matrix3D structure. |
ScaleAt(Vector3D, Point3D)
Scales this Matrix3D structure by the specified Vector3D about the specified Point3D.
Declaration
public void ScaleAt(Vector3D scale, Point3D center)
Parameters
Vector3D
scale
Vector3D by which to scale this Matrix3D structure. |
Point3D
center
Point3D about which to scale. |
ScaleAtPrepend(Vector3D, Point3D)
Prepends the specified scale transformation about the specified Point3D to this Matrix3D structure.
Declaration
public void ScaleAtPrepend(Vector3D scale, Point3D center)
Parameters
Vector3D
scale
Vector3D by which to scale this Matrix3D structure. |
Point3D
center
Point3D about which to scale. |
ScalePrepend(Vector3D)
Prepends the specified scale Vector3D to the current Matrix3D structure.
Declaration
public void ScalePrepend(Vector3D vector)
Parameters
Vector3D
vector
Vector3D by which to scale this Matrix3D structure. |
SetIdentity()
Changes this Matrix3D structure into an identity matrix.
Declaration
public void SetIdentity()
Remarks
In an identity matrix, all coefficients are 0 except the [1,1][2,2][3,3][4,4] coefficients, which are set to 1. The identity matrix is special in that when it is applied to vertices, they are unchanged. The identity matrix is used as the starting point for matrices that modify vertex values to create rotations, translations, and any other transformations that can be represented by a 4x4 matrix.
ToString()
Creates a String representation of this Matrix3D structure.
Declaration
public override string ToString()
Returns
System.String
String representation of this Matrix3D structure. |
ToString(IFormatProvider)
Creates a String representation of this Matrix3D structure.
Declaration
public string ToString(IFormatProvider provider)
Parameters
System.IFormatProvider
provider
The culture-specific formatting information. |
Returns
System.String
String representation of this Matrix3D structure. |
Transform(Point3D)
Transforms the specified Point3D by the Matrix3D and returns the result.
Declaration
public Point3D Transform(Point3D point)
Parameters
Point3D
point
Point3D to transform. |
Returns
Point3D
The result of transforming point by this Matrix3D. |
Transform(Point3D[])
Transforms the specified Point3D objects in the array by the Matrix3D.
Declaration
public void Transform(Point3D[] points)
Parameters
Point3D[]
points
Point3D objects to transform. The original points in the array are replaced by their transformed values. |
Transform(Vector3D)
Transforms the specified Vector3D by this Matrix3D.
Declaration
public Vector3D Transform(Vector3D vector)
Parameters
Vector3D
vector
Vector3D to transform. |
Returns
Vector3D
The result of transforming vector by this Matrix3D. |
Transform(Vector3D[])
Transforms the specified Vector3D objects in the array by this Matrix3D.
Declaration
public void Transform(Vector3D[] vectors)
Parameters
Vector3D[]
vectors
Vector3D objects to transform. The original Vector3D objects in the array are replaced by their transformed values. |
Translate(Vector3D)
Appends a translation of the specified offset to the current Matrix3D structure.
Declaration
public void Translate(Vector3D offset)
Parameters
Vector3D
offset
Vector3D that specifies the offset for transformation. |
TranslatePrepend(Vector3D)
Prepends a translation of the specified offset to this Matrix3D structure.
Declaration
public void TranslatePrepend(Vector3D offset)
Parameters
Vector3D
offset
Vector3D that specifies the offset for transformation. |
Operators
Equality(Matrix3D, Matrix3D)
Compares two Matrix3D instances for exact equality.
Declaration
public static bool operator ==(Matrix3D matrix1, Matrix3D matrix2)
Parameters
Matrix3D
matrix1
The first Matrix3D to compare. |
Matrix3D
matrix2
The second Matrix3D to compare. |
Returns
System.Boolean
Boolean that indicates whether the matrices are equal. |
Remarks
Note that double values can acquire error when operated upon, so that an exact comparison between two values that are logically equal may fail. Furthermore, using this equality operator, Double.NaN is not equal to itself.
Inequality(Matrix3D, Matrix3D)
Compares two Matrix3D instances for exact inequality.
Declaration
public static bool operator !=(Matrix3D matrix1, Matrix3D matrix2)
Parameters
Matrix3D
matrix1
The first Matrix3D to compare. |
Matrix3D
matrix2
The second Matrix3D to compare. |
Returns
System.Boolean
Boolean that indicates whether the two matrix instances are different. |
Remarks
Note that double values can acquire error when operated upon, so that an exact comparison between two values that are logically equal may fail. Furthermore, using this equality operator, Double.NaN is not equal to itself.
Multiply(Matrix3D, Matrix3D)
Multiplies the specified matrices.
Declaration
public static Matrix3D operator *(Matrix3D matrix1, Matrix3D matrix2)
Parameters
Matrix3D
matrix1
Matrix to multiply. |
Matrix3D
matrix2
Matrix by which the first matrix is multiplied. |
Returns
Matrix3D
Matrix3D that is the result of multiplication. |