Show / Hide Table of Contents

Struct Matrix4x3d

Represents a 3x4 matrix.

Implements
IEquatable<Matrix4x3d>
Inherited Members
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetType()
Namespace: OpenTK
Assembly: OpenTK.dll
Syntax
[Serializable]
public struct Matrix4x3d : IEquatable<Matrix4x3d>

Constructors

Matrix4x3d(Vector3d, Vector3d, Vector3d, Vector3d)

Constructs a new instance.

Declaration
public Matrix4x3d(Vector3d row0, Vector3d row1, Vector3d row2, Vector3d row3)
Parameters
Type Name Description
Vector3d row0

Top row of the matrix

Vector3d row1

Second row of the matrix

Vector3d row2

Third row of the matrix

Vector3d row3

Bottom row of the matrix

Matrix4x3d(Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double, Double)

Constructs a new instance.

Declaration
public Matrix4x3d(double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22, double m30, double m31, double m32)
Parameters
Type Name Description
Double m00

First item of the first row of the matrix.

Double m01

Second item of the first row of the matrix.

Double m02

Third item of the first row of the matrix.

Double m10

First item of the second row of the matrix.

Double m11

Second item of the second row of the matrix.

Double m12

Third item of the second row of the matrix.

Double m20

First item of the third row of the matrix.

Double m21

Second item of the third row of the matrix.

Double m22

Third item of the third row of the matrix.

Double m30

First item of the fourth row of the matrix.

Double m31

Second item of the fourth row of the matrix.

Double m32

Third item of the fourth row of the matrix.

Fields

Row0

Top row of the matrix

Declaration
public Vector3d Row0
Field Value
Type Description
Vector3d

Row1

2nd row of the matrix

Declaration
public Vector3d Row1
Field Value
Type Description
Vector3d

Row2

3rd row of the matrix

Declaration
public Vector3d Row2
Field Value
Type Description
Vector3d

Row3

Bottom row of the matrix

Declaration
public Vector3d Row3
Field Value
Type Description
Vector3d

Zero

The zero matrix

Declaration
public static Matrix4x3d Zero
Field Value
Type Description
Matrix4x3d

Properties

Column0

Gets the first column of this matrix.

Declaration
public readonly Vector4d Column0 { get; }
Property Value
Type Description
Vector4d

Column1

Gets the second column of this matrix.

Declaration
public readonly Vector4d Column1 { get; }
Property Value
Type Description
Vector4d

Column2

Gets the third column of this matrix.

Declaration
public readonly Vector4d Column2 { get; }
Property Value
Type Description
Vector4d

Diagonal

Gets or sets the values along the main diagonal of the matrix.

Declaration
public Vector3d Diagonal { get; set; }
Property Value
Type Description
Vector3d

Item[Int32, Int32]

Gets or sets the value at a specified row and column.

Declaration
public double this[int rowIndex, int columnIndex] { get; set; }
Parameters
Type Name Description
Int32 rowIndex
Int32 columnIndex
Property Value
Type Description
Double

M11

Gets or sets the value at row 1, column 1 of this instance.

Declaration
public double M11 { get; set; }
Property Value
Type Description
Double

M12

Gets or sets the value at row 1, column 2 of this instance.

Declaration
public double M12 { get; set; }
Property Value
Type Description
Double

M13

Gets or sets the value at row 1, column 3 of this instance.

Declaration
public double M13 { get; set; }
Property Value
Type Description
Double

M21

Gets or sets the value at row 2, column 1 of this instance.

Declaration
public double M21 { get; set; }
Property Value
Type Description
Double

M22

Gets or sets the value at row 2, column 2 of this instance.

Declaration
public double M22 { get; set; }
Property Value
Type Description
Double

M23

Gets or sets the value at row 2, column 3 of this instance.

Declaration
public double M23 { get; set; }
Property Value
Type Description
Double

M31

Gets or sets the value at row 3, column 1 of this instance.

Declaration
public double M31 { get; set; }
Property Value
Type Description
Double

M32

Gets or sets the value at row 3, column 2 of this instance.

Declaration
public double M32 { get; set; }
Property Value
Type Description
Double

M33

Gets or sets the value at row 3, column 3 of this instance.

Declaration
public double M33 { get; set; }
Property Value
Type Description
Double

M41

Gets or sets the value at row 4, column 1 of this instance.

Declaration
public double M41 { get; set; }
Property Value
Type Description
Double

M42

Gets or sets the value at row 4, column 2 of this instance.

Declaration
public double M42 { get; set; }
Property Value
Type Description
Double

M43

Gets or sets the value at row 4, column 3 of this instance.

Declaration
public double M43 { get; set; }
Property Value
Type Description
Double

Trace

Gets the trace of the matrix, the sum of the values along the diagonal.

Declaration
public readonly double Trace { get; }
Property Value
Type Description
Double

Methods

Add(Matrix4x3d, Matrix4x3d)

Adds two instances.

Declaration
public static Matrix4x3d Add(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the addition.

Matrix4x3d right

The right operand of the addition.

Returns
Type Description
Matrix4x3d

A new instance that is the result of the addition.

Add(ref Matrix4x3d, ref Matrix4x3d, out Matrix4x3d)

Adds two instances.

Declaration
public static void Add(ref Matrix4x3d left, ref Matrix4x3d right, out Matrix4x3d result)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the addition.

Matrix4x3d right

The right operand of the addition.

Matrix4x3d result

A new instance that is the result of the addition.

CreateFromAxisAngle(Vector3d, Double)

Build a rotation matrix from the specified axis/angle rotation.

Declaration
public static Matrix4x3d CreateFromAxisAngle(Vector3d axis, double angle)
Parameters
Type Name Description
Vector3d axis

The axis to rotate about.

Double angle

Angle in radians to rotate counter-clockwise (looking in the direction of the given axis).

Returns
Type Description
Matrix4x3d

A matrix instance.

CreateFromAxisAngle(Vector3d, Double, out Matrix4x3d)

Build a rotation matrix from the specified axis/angle rotation.

Declaration
public static void CreateFromAxisAngle(Vector3d axis, double angle, out Matrix4x3d result)
Parameters
Type Name Description
Vector3d axis

The axis to rotate about.

Double angle

Angle in radians to rotate counter-clockwise (looking in the direction of the given axis).

Matrix4x3d result

A matrix instance.

CreateFromQuaternion(Quaternion)

Builds a rotation matrix from a quaternion.

Declaration
public static Matrix4x3d CreateFromQuaternion(Quaternion q)
Parameters
Type Name Description
Quaternion q

The quaternion to rotate by.

Returns
Type Description
Matrix4x3d

A matrix instance.

CreateFromQuaternion(ref Quaternion, out Matrix4x3d)

Builds a rotation matrix from a quaternion.

Declaration
public static void CreateFromQuaternion(ref Quaternion q, out Matrix4x3d result)
Parameters
Type Name Description
Quaternion q

The quaternion to rotate by.

Matrix4x3d result

A matrix instance.

CreateRotationX(Double)

Builds a rotation matrix for a rotation around the x-axis.

Declaration
public static Matrix4x3d CreateRotationX(double angle)
Parameters
Type Name Description
Double angle

The counter-clockwise angle in radians.

Returns
Type Description
Matrix4x3d

The resulting Matrix4dinstance.

CreateRotationX(Double, out Matrix4x3d)

Builds a rotation matrix for a rotation around the x-axis.

Declaration
public static void CreateRotationX(double angle, out Matrix4x3d result)
Parameters
Type Name Description
Double angle

The counter-clockwise angle in radians.

Matrix4x3d result

The resulting Matrix4dinstance.

CreateRotationY(Double)

Builds a rotation matrix for a rotation around the y-axis.

Declaration
public static Matrix4x3d CreateRotationY(double angle)
Parameters
Type Name Description
Double angle

The counter-clockwise angle in radians.

Returns
Type Description
Matrix4x3d

The resulting Matrix4dinstance.

CreateRotationY(Double, out Matrix4x3d)

Builds a rotation matrix for a rotation around the y-axis.

Declaration
public static void CreateRotationY(double angle, out Matrix4x3d result)
Parameters
Type Name Description
Double angle

The counter-clockwise angle in radians.

Matrix4x3d result

The resulting Matrix4dinstance.

CreateRotationZ(Double)

Builds a rotation matrix for a rotation around the z-axis.

Declaration
public static Matrix4x3d CreateRotationZ(double angle)
Parameters
Type Name Description
Double angle

The counter-clockwise angle in radians.

Returns
Type Description
Matrix4x3d

The resulting Matrix4dinstance.

CreateRotationZ(Double, out Matrix4x3d)

Builds a rotation matrix for a rotation around the z-axis.

Declaration
public static void CreateRotationZ(double angle, out Matrix4x3d result)
Parameters
Type Name Description
Double angle

The counter-clockwise angle in radians.

Matrix4x3d result

The resulting Matrix4dinstance.

CreateScale(Vector3d)

Build a scaling matrix

Declaration
public static Matrix4x3d CreateScale(Vector3d scale)
Parameters
Type Name Description
Vector3d scale

Scale factors for x,y and z axes

Returns
Type Description
Matrix4x3d

A scaling matrix

CreateScale(Double)

Build a scaling matrix

Declaration
public static Matrix4x3d CreateScale(double scale)
Parameters
Type Name Description
Double scale

Single scale factor for x,y and z axes

Returns
Type Description
Matrix4x3d

A scaling matrix

CreateScale(Double, Double, Double)

Build a scaling matrix

Declaration
public static Matrix4x3d CreateScale(double x, double y, double z)
Parameters
Type Name Description
Double x

Scale factor for x-axis

Double y

Scale factor for y-axis

Double z

Scale factor for z-axis

Returns
Type Description
Matrix4x3d

A scaling matrix

CreateTranslation(Vector3d)

Creates a translation matrix.

Declaration
public static Matrix4x3d CreateTranslation(Vector3d vector)
Parameters
Type Name Description
Vector3d vector

The translation vector.

Returns
Type Description
Matrix4x3d

The resulting Matrix4dinstance.

CreateTranslation(ref Vector3d, out Matrix4x3d)

Creates a translation matrix.

Declaration
public static void CreateTranslation(ref Vector3d vector, out Matrix4x3d result)
Parameters
Type Name Description
Vector3d vector

The translation vector.

Matrix4x3d result

The resulting Matrix4dinstance.

CreateTranslation(Double, Double, Double)

Creates a translation matrix.

Declaration
public static Matrix4x3d CreateTranslation(double x, double y, double z)
Parameters
Type Name Description
Double x

X translation.

Double y

Y translation.

Double z

Z translation.

Returns
Type Description
Matrix4x3d

The resulting Matrix4dinstance.

CreateTranslation(Double, Double, Double, out Matrix4x3d)

Creates a translation matrix.

Declaration
public static void CreateTranslation(double x, double y, double z, out Matrix4x3d result)
Parameters
Type Name Description
Double x

X translation.

Double y

Y translation.

Double z

Z translation.

Matrix4x3d result

The resulting Matrix4dinstance.

Equals(Matrix4x3d)

Indicates whether the current matrix is equal to another matrix.

Declaration
public bool Equals(Matrix4x3d other)
Parameters
Type Name Description
Matrix4x3d other

An matrix to compare with this matrix.

Returns
Type Description
Boolean

true if the current matrix is equal to the matrix parameter; otherwise, false.

Equals(Object)

Indicates whether this instance and a specified object are equal.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
Object obj

The object to compare tresult.

Returns
Type Description
Boolean

True if the instances are equal; false otherwise.

Overrides
ValueType.Equals(Object)

GetHashCode()

Returns the hashcode for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
Int32

A System.Int32 containing the unique hashcode for this instance.

Overrides
ValueType.GetHashCode()

Invert()

Converts this instance into its inverse.

Declaration
public void Invert()

Invert(Matrix4x3d)

Calculate the inverse of the given matrix

Declaration
public static Matrix4x3d Invert(Matrix4x3d mat)
Parameters
Type Name Description
Matrix4x3d mat

The matrix to invert

Returns
Type Description
Matrix4x3d

The inverse of the given matrix if it has one, or the input if it is singular

Exceptions
Type Condition
InvalidOperationException

Thrown if the Matrix4 is singular.

Invert(ref Matrix4x3d, out Matrix4x3d)

Calculate the inverse of the given matrix

Declaration
public static void Invert(ref Matrix4x3d mat, out Matrix4x3d result)
Parameters
Type Name Description
Matrix4x3d mat

The matrix to invert

Matrix4x3d result

The inverse of the given matrix if it has one, or the input if it is singular

Exceptions
Type Condition
InvalidOperationException

Thrown if the Matrix4 is singular.

Mult(Matrix4x3d, Matrix3x4d)

This isn't quite a multiply, but the result may be useful in some situations. Multiplies two instances.

Declaration
public static Matrix4d Mult(Matrix4x3d left, Matrix3x4d right)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the multiplication.

Matrix3x4d right

The right operand of the multiplication.

Returns
Type Description
Matrix4d

A new instance that is the result of the multiplication

Mult(Matrix4x3d, Matrix4x3d)

Multiplies two instances.

Declaration
public static Matrix4x3d Mult(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the multiplication.

Matrix4x3d right

The right operand of the multiplication.

Returns
Type Description
Matrix4x3d

A new instance that is the result of the multiplication

Mult(Matrix4x3d, Double)

Multiplies an instance by a scalar.

Declaration
public static Matrix4x3d Mult(Matrix4x3d left, double right)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the multiplication.

Double right

The right operand of the multiplication.

Returns
Type Description
Matrix4x3d

A new instance that is the result of the multiplication

Mult(ref Matrix4x3d, ref Matrix3x4d, out Matrix4d)

This isn't quite a multiply, but the result may be useful in some situations. Multiplies two instances.

Declaration
public static void Mult(ref Matrix4x3d left, ref Matrix3x4d right, out Matrix4d result)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the multiplication.

Matrix3x4d right

The right operand of the multiplication.

Matrix4d result

A new instance that is the result of the multiplication

Mult(ref Matrix4x3d, ref Matrix4x3d, out Matrix4x3d)

Multiplies two instances.

Declaration
public static void Mult(ref Matrix4x3d left, ref Matrix4x3d right, out Matrix4x3d result)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the multiplication.

Matrix4x3d right

The right operand of the multiplication.

Matrix4x3d result

A new instance that is the result of the multiplication

Mult(ref Matrix4x3d, Double, out Matrix4x3d)

Multiplies an instance by a scalar.

Declaration
public static void Mult(ref Matrix4x3d left, double right, out Matrix4x3d result)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the multiplication.

Double right

The right operand of the multiplication.

Matrix4x3d result

A new instance that is the result of the multiplication

Subtract(Matrix4x3d, Matrix4x3d)

Subtracts one instance from another.

Declaration
public static Matrix4x3d Subtract(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the subraction.

Matrix4x3d right

The right operand of the subraction.

Returns
Type Description
Matrix4x3d

A new instance that is the result of the subraction.

Subtract(ref Matrix4x3d, ref Matrix4x3d, out Matrix4x3d)

Subtracts one instance from another.

Declaration
public static void Subtract(ref Matrix4x3d left, ref Matrix4x3d right, out Matrix4x3d result)
Parameters
Type Name Description
Matrix4x3d left

The left operand of the subraction.

Matrix4x3d right

The right operand of the subraction.

Matrix4x3d result

A new instance that is the result of the subraction.

ToString()

Returns a System.String that represents the current Matrix4x3d.

Declaration
public override string ToString()
Returns
Type Description
String

The string representation of the matrix.

Overrides
ValueType.ToString()

Transpose(Matrix4x3d)

Calculate the transpose of the given matrix

Declaration
public static Matrix3x4d Transpose(Matrix4x3d mat)
Parameters
Type Name Description
Matrix4x3d mat

The matrix to transpose

Returns
Type Description
Matrix3x4d

The transpose of the given matrix

Transpose(ref Matrix4x3d, out Matrix3x4d)

Calculate the transpose of the given matrix

Declaration
public static void Transpose(ref Matrix4x3d mat, out Matrix3x4d result)
Parameters
Type Name Description
Matrix4x3d mat

The matrix to transpose

Matrix3x4d result

The result of the calculation

Operators

Addition(Matrix4x3d, Matrix4x3d)

Matrix addition

Declaration
public static Matrix4x3d operator +(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

left-hand operand

Matrix4x3d right

right-hand operand

Returns
Type Description
Matrix4x3d

A new Matrix4x3d which holds the result of the addition

Equality(Matrix4x3d, Matrix4x3d)

Compares two instances for equality.

Declaration
public static bool operator ==(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

The first instance.

Matrix4x3d right

The second instance.

Returns
Type Description
Boolean

True, if left equals right; false otherwise.

Inequality(Matrix4x3d, Matrix4x3d)

Compares two instances for inequality.

Declaration
public static bool operator !=(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

The first instance.

Matrix4x3d right

The second instance.

Returns
Type Description
Boolean

True, if left does not equal right; false otherwise.

Multiply(Matrix4x3d, Matrix3x4d)

Matrix multiplication

Declaration
public static Matrix4d operator *(Matrix4x3d left, Matrix3x4d right)
Parameters
Type Name Description
Matrix4x3d left

left-hand operand

Matrix3x4d right

right-hand operand

Returns
Type Description
Matrix4d

A new Matrix4d which holds the result of the multiplication

Multiply(Matrix4x3d, Matrix4x3d)

Matrix multiplication

Declaration
public static Matrix4x3d operator *(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

left-hand operand

Matrix4x3d right

right-hand operand

Returns
Type Description
Matrix4x3d

A new Matrix4x3d which holds the result of the multiplication

Multiply(Matrix4x3d, Double)

Matrix-scalar multiplication

Declaration
public static Matrix4x3d operator *(Matrix4x3d left, double right)
Parameters
Type Name Description
Matrix4x3d left

left-hand operand

Double right

right-hand operand

Returns
Type Description
Matrix4x3d

A new Matrix4x3d which holds the result of the multiplication

Subtraction(Matrix4x3d, Matrix4x3d)

Matrix subtraction

Declaration
public static Matrix4x3d operator -(Matrix4x3d left, Matrix4x3d right)
Parameters
Type Name Description
Matrix4x3d left

left-hand operand

Matrix4x3d right

right-hand operand

Returns
Type Description
Matrix4x3d

A new Matrix4x3d which holds the result of the subtraction

Implements

System.IEquatable<T>
In This Article
Back to top Generated by DocFX