The Open Toolkit library  1.1
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
OpenTK.Matrix3d Struct Reference

Represents a 3x3 matrix containing 3D rotation and scale with double-precision components. More...

Inherits IEquatable< Matrix3d >.

Public Member Functions

 Matrix3d (Vector3d row0, Vector3d row1, Vector3d row2)
 Constructs a new instance. More...
 
 Matrix3d (double m00, double m01, double m02, double m10, double m11, double m12, double m20, double m21, double m22)
 Constructs a new instance. More...
 
 Matrix3d (Matrix4d matrix)
 Constructs a new instance. More...
 
void Invert ()
 Converts this instance into its inverse. More...
 
void Transpose ()
 Converts this instance into its transpose. More...
 
Matrix3d Normalized ()
 Returns a normalised copy of this instance. More...
 
void Normalize ()
 Divides each element in the Matrix by the Determinant. More...
 
Matrix3d Inverted ()
 Returns an inverted copy of this instance. More...
 
Matrix3d ClearScale ()
 Returns a copy of this Matrix3 without scale. More...
 
Matrix3d ClearRotation ()
 Returns a copy of this Matrix3 without rotation. More...
 
Vector3d ExtractScale ()
 Returns the scale component of this instance. More...
 
Quaterniond ExtractRotation (bool row_normalise=true)
 Returns the rotation component of this instance. Quite slow. More...
 
override string ToString ()
 Returns a System.String that represents the current Matrix3d. More...
 
override int GetHashCode ()
 Returns the hashcode for this instance. More...
 
override bool Equals (object obj)
 Indicates whether this instance and a specified object are equal. More...
 
bool Equals (Matrix3d other)
 Indicates whether the current matrix is equal to another matrix. More...
 

Static Public Member Functions

static void CreateFromAxisAngle (Vector3d axis, double angle, out Matrix3d result)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static Matrix3d CreateFromAxisAngle (Vector3d axis, double angle)
 Build a rotation matrix from the specified axis/angle rotation. More...
 
static void CreateFromQuaternion (ref Quaterniond q, out Matrix3d result)
 Build a rotation matrix from the specified quaternion. More...
 
static Matrix3d CreateFromQuaternion (Quaterniond q)
 Build a rotation matrix from the specified quaternion. More...
 
static void CreateRotationX (double angle, out Matrix3d result)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static Matrix3d CreateRotationX (double angle)
 Builds a rotation matrix for a rotation around the x-axis. More...
 
static void CreateRotationY (double angle, out Matrix3d result)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static Matrix3d CreateRotationY (double angle)
 Builds a rotation matrix for a rotation around the y-axis. More...
 
static void CreateRotationZ (double angle, out Matrix3d result)
 Builds a rotation matrix for a rotation around the z-axis. More...
 
static Matrix3d CreateRotationZ (double angle)
 Builds a rotation matrix for a rotation around the z-axis. More...
 
static Matrix3d CreateScale (double scale)
 Creates a scale matrix. More...
 
static Matrix3d CreateScale (Vector3d scale)
 Creates a scale matrix. More...
 
static Matrix3d CreateScale (double x, double y, double z)
 Creates a scale matrix. More...
 
static void CreateScale (double scale, out Matrix3d result)
 Creates a scale matrix. More...
 
static void CreateScale (ref Vector3d scale, out Matrix3d result)
 Creates a scale matrix. More...
 
static void CreateScale (double x, double y, double z, out Matrix3d result)
 Creates a scale matrix. More...
 
static Matrix3d Mult (Matrix3d left, Matrix3d right)
 Multiplies two instances. More...
 
static void Mult (ref Matrix3d left, ref Matrix3d right, out Matrix3d result)
 Multiplies two instances. More...
 
static void Invert (ref Matrix3d mat, out Matrix3d result)
 Calculate the inverse of the given matrix More...
 
static Matrix3d Invert (Matrix3d mat)
 Calculate the inverse of the given matrix More...
 
static Matrix3d Transpose (Matrix3d mat)
 Calculate the transpose of the given matrix More...
 
static void Transpose (ref Matrix3d mat, out Matrix3d result)
 Calculate the transpose of the given matrix More...
 
static Matrix3d operator* (Matrix3d left, Matrix3d right)
 Matrix multiplication More...
 
static bool operator== (Matrix3d left, Matrix3d right)
 Compares two instances for equality. More...
 
static bool operator!= (Matrix3d left, Matrix3d right)
 Compares two instances for inequality. More...
 

Public Attributes

Vector3d Row0
 First row of the matrix. More...
 
Vector3d Row1
 Second row of the matrix. More...
 
Vector3d Row2
 Third row of the matrix. More...
 

Static Public Attributes

static Matrix3d Identity = new Matrix3d(Vector3d.UnitX, Vector3d.UnitY, Vector3d.UnitZ)
 The identity matrix. More...
 

Properties

double Determinant [get]
 Gets the determinant of this matrix. More...
 
Vector3d Column0 [get]
 Gets the first column of this matrix. More...
 
Vector3d Column1 [get]
 Gets the second column of this matrix. More...
 
Vector3d Column2 [get]
 Gets the third column of this matrix. More...
 
double M11 [get, set]
 Gets or sets the value at row 1, column 1 of this instance. More...
 
double M12 [get, set]
 Gets or sets the value at row 1, column 2 of this instance. More...
 
double M13 [get, set]
 Gets or sets the value at row 1, column 3 of this instance. More...
 
double M21 [get, set]
 Gets or sets the value at row 2, column 1 of this instance. More...
 
double M22 [get, set]
 Gets or sets the value at row 2, column 2 of this instance. More...
 
double M23 [get, set]
 Gets or sets the value at row 2, column 3 of this instance. More...
 
double M31 [get, set]
 Gets or sets the value at row 3, column 1 of this instance. More...
 
double M32 [get, set]
 Gets or sets the value at row 3, column 2 of this instance. More...
 
double M33 [get, set]
 Gets or sets the value at row 3, column 3 of this instance. More...
 
Vector3d Diagonal [get, set]
 Gets or sets the values along the main diagonal of the matrix. More...
 
double Trace [get]
 Gets the trace of the matrix, the sum of the values along the diagonal. More...
 
double this[int rowIndex, int columnIndex] [get, set]
 Gets or sets the value at a specified row and column. More...
 

Detailed Description

Represents a 3x3 matrix containing 3D rotation and scale with double-precision components.

Constructor & Destructor Documentation

OpenTK.Matrix3d.Matrix3d ( Vector3d  row0,
Vector3d  row1,
Vector3d  row2 
)

Constructs a new instance.

Parameters
row0Top row of the matrix
row1Second row of the matrix
row2Bottom row of the matrix
OpenTK.Matrix3d.Matrix3d ( double  m00,
double  m01,
double  m02,
double  m10,
double  m11,
double  m12,
double  m20,
double  m21,
double  m22 
)

Constructs a new instance.

Parameters
m00First item of the first row of the matrix.
m01Second item of the first row of the matrix.
m02Third item of the first row of the matrix.
m10First item of the second row of the matrix.
m11Second item of the second row of the matrix.
m12Third item of the second row of the matrix.
m20First item of the third row of the matrix.
m21Second item of the third row of the matrix.
m22Third item of the third row of the matrix.
OpenTK.Matrix3d.Matrix3d ( Matrix4d  matrix)

Constructs a new instance.

Parameters
matrixA Matrix4d to take the upper-left 3x3 from.

Member Function Documentation

Matrix3d OpenTK.Matrix3d.ClearRotation ( )

Returns a copy of this Matrix3 without rotation.

Matrix3d OpenTK.Matrix3d.ClearScale ( )

Returns a copy of this Matrix3 without scale.

static void OpenTK.Matrix3d.CreateFromAxisAngle ( Vector3d  axis,
double  angle,
out Matrix3d  result 
)
static

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

Parameters
axisThe axis to rotate about.
angleAngle in radians to rotate counter-clockwise (looking in the direction of the given axis).
resultA matrix instance.
static Matrix3d OpenTK.Matrix3d.CreateFromAxisAngle ( Vector3d  axis,
double  angle 
)
static

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

Parameters
axisThe axis to rotate about.
angleAngle in radians to rotate counter-clockwise (looking in the direction of the given axis).
Returns
A matrix instance.
static void OpenTK.Matrix3d.CreateFromQuaternion ( ref Quaterniond  q,
out Matrix3d  result 
)
static

Build a rotation matrix from the specified quaternion.

Parameters
qQuaternion to translate.
resultMatrix result.
static Matrix3d OpenTK.Matrix3d.CreateFromQuaternion ( Quaterniond  q)
static

Build a rotation matrix from the specified quaternion.

Parameters
qQuaternion to translate.
Returns
A matrix instance.
static void OpenTK.Matrix3d.CreateRotationX ( double  angle,
out Matrix3d  result 
)
static

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

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix3d instance.
static Matrix3d OpenTK.Matrix3d.CreateRotationX ( double  angle)
static

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

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix3d instance.
static void OpenTK.Matrix3d.CreateRotationY ( double  angle,
out Matrix3d  result 
)
static

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

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix3d instance.
static Matrix3d OpenTK.Matrix3d.CreateRotationY ( double  angle)
static

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

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix3d instance.
static void OpenTK.Matrix3d.CreateRotationZ ( double  angle,
out Matrix3d  result 
)
static

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

Parameters
angleThe counter-clockwise angle in radians.
resultThe resulting Matrix3d instance.
static Matrix3d OpenTK.Matrix3d.CreateRotationZ ( double  angle)
static

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

Parameters
angleThe counter-clockwise angle in radians.
Returns
The resulting Matrix3d instance.
static Matrix3d OpenTK.Matrix3d.CreateScale ( double  scale)
static

Creates a scale matrix.

Parameters
scaleSingle scale factor for the x, y, and z axes.
Returns
A scale matrix.
static Matrix3d OpenTK.Matrix3d.CreateScale ( Vector3d  scale)
static

Creates a scale matrix.

Parameters
scaleScale factors for the x, y, and z axes.
Returns
A scale matrix.
static Matrix3d OpenTK.Matrix3d.CreateScale ( double  x,
double  y,
double  z 
)
static

Creates a scale matrix.

Parameters
xScale factor for the x axis.
yScale factor for the y axis.
zScale factor for the z axis.
Returns
A scale matrix.
static void OpenTK.Matrix3d.CreateScale ( double  scale,
out Matrix3d  result 
)
static

Creates a scale matrix.

Parameters
scaleSingle scale factor for the x, y, and z axes.
resultA scale matrix.
static void OpenTK.Matrix3d.CreateScale ( ref Vector3d  scale,
out Matrix3d  result 
)
static

Creates a scale matrix.

Parameters
scaleScale factors for the x, y, and z axes.
resultA scale matrix.
static void OpenTK.Matrix3d.CreateScale ( double  x,
double  y,
double  z,
out Matrix3d  result 
)
static

Creates a scale matrix.

Parameters
xScale factor for the x axis.
yScale factor for the y axis.
zScale factor for the z axis.
resultA scale matrix.
override bool OpenTK.Matrix3d.Equals ( object  obj)

Indicates whether this instance and a specified object are equal.

Parameters
objThe object to compare to.
Returns
True if the instances are equal; false otherwise.
bool OpenTK.Matrix3d.Equals ( Matrix3d  other)

Indicates whether the current matrix is equal to another matrix.

Parameters
otherA matrix to compare with this matrix.
Returns
true if the current matrix is equal to the matrix parameter; otherwise, false.
Quaterniond OpenTK.Matrix3d.ExtractRotation ( bool  row_normalise = true)

Returns the rotation component of this instance. Quite slow.

Parameters
row_normaliseWhether the method should row-normalise (i.e. remove scale from) the Matrix. Pass false if you know it's already normalised.
Vector3d OpenTK.Matrix3d.ExtractScale ( )

Returns the scale component of this instance.

override int OpenTK.Matrix3d.GetHashCode ( )

Returns the hashcode for this instance.

Returns
A System.Int32 containing the unique hashcode for this instance.
void OpenTK.Matrix3d.Invert ( )

Converts this instance into its inverse.

static void OpenTK.Matrix3d.Invert ( ref Matrix3d  mat,
out Matrix3d  result 
)
static

Calculate the inverse of the given matrix

Parameters
matThe matrix to invert
resultThe inverse of the given matrix if it has one, or the input if it is singular
Exceptions
InvalidOperationExceptionThrown if the Matrix3d is singular.
static Matrix3d OpenTK.Matrix3d.Invert ( Matrix3d  mat)
static

Calculate the inverse of the given matrix

Parameters
matThe matrix to invert
Returns
The inverse of the given matrix if it has one, or the input if it is singular
Exceptions
InvalidOperationExceptionThrown if the Matrix4 is singular.
Matrix3d OpenTK.Matrix3d.Inverted ( )

Returns an inverted copy of this instance.

static Matrix3d OpenTK.Matrix3d.Mult ( Matrix3d  left,
Matrix3d  right 
)
static

Multiplies two instances.

Parameters
leftThe left operand of the multiplication.
rightThe right operand of the multiplication.
Returns
A new instance that is the result of the multiplication
static void OpenTK.Matrix3d.Mult ( ref Matrix3d  left,
ref Matrix3d  right,
out Matrix3d  result 
)
static

Multiplies two instances.

Parameters
leftThe left operand of the multiplication.
rightThe right operand of the multiplication.
resultA new instance that is the result of the multiplication
void OpenTK.Matrix3d.Normalize ( )

Divides each element in the Matrix by the Determinant.

Matrix3d OpenTK.Matrix3d.Normalized ( )

Returns a normalised copy of this instance.

static bool OpenTK.Matrix3d.operator!= ( Matrix3d  left,
Matrix3d  right 
)
static

Compares two instances for inequality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left does not equal right; false otherwise.
static Matrix3d OpenTK.Matrix3d.operator* ( Matrix3d  left,
Matrix3d  right 
)
static

Matrix multiplication

Parameters
leftleft-hand operand
rightright-hand operand
Returns
A new Matrix3d which holds the result of the multiplication
static bool OpenTK.Matrix3d.operator== ( Matrix3d  left,
Matrix3d  right 
)
static

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
override string OpenTK.Matrix3d.ToString ( )

Returns a System.String that represents the current Matrix3d.

Returns
The string representation of the matrix.
void OpenTK.Matrix3d.Transpose ( )

Converts this instance into its transpose.

static Matrix3d OpenTK.Matrix3d.Transpose ( Matrix3d  mat)
static

Calculate the transpose of the given matrix

Parameters
matThe matrix to transpose
Returns
The transpose of the given matrix
static void OpenTK.Matrix3d.Transpose ( ref Matrix3d  mat,
out Matrix3d  result 
)
static

Calculate the transpose of the given matrix

Parameters
matThe matrix to transpose
resultThe result of the calculation

Member Data Documentation

Matrix3d OpenTK.Matrix3d.Identity = new Matrix3d(Vector3d.UnitX, Vector3d.UnitY, Vector3d.UnitZ)
static

The identity matrix.

Vector3d OpenTK.Matrix3d.Row0

First row of the matrix.

Vector3d OpenTK.Matrix3d.Row1

Second row of the matrix.

Vector3d OpenTK.Matrix3d.Row2

Third row of the matrix.

Property Documentation

Vector3d OpenTK.Matrix3d.Column0
get

Gets the first column of this matrix.

Vector3d OpenTK.Matrix3d.Column1
get

Gets the second column of this matrix.

Vector3d OpenTK.Matrix3d.Column2
get

Gets the third column of this matrix.

double OpenTK.Matrix3d.Determinant
get

Gets the determinant of this matrix.

Vector3d OpenTK.Matrix3d.Diagonal
getset

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

double OpenTK.Matrix3d.M11
getset

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

double OpenTK.Matrix3d.M12
getset

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

double OpenTK.Matrix3d.M13
getset

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

double OpenTK.Matrix3d.M21
getset

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

double OpenTK.Matrix3d.M22
getset

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

double OpenTK.Matrix3d.M23
getset

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

double OpenTK.Matrix3d.M31
getset

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

double OpenTK.Matrix3d.M32
getset

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

double OpenTK.Matrix3d.M33
getset

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

double OpenTK.Matrix3d.this[int rowIndex, int columnIndex]
getset

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

double OpenTK.Matrix3d.Trace
get

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