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.Matrix2d Struct Reference

Represents a 2x2 matrix More...

Inherits IEquatable< Matrix2d >.

Public Member Functions

 Matrix2d (Vector2d row0, Vector2d row1)
 Constructs a new instance. More...
 
 Matrix2d (double m00, double m01, double m10, double m11)
 Constructs a new instance More...
 
void Transpose ()
 Converts this instance to it's transpose. More...
 
void Invert ()
 Converts this instance into its inverse. More...
 
override string ToString ()
 Returns a System.String that represents the current Matrix4. 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 (Matrix2d other)
 Indicates whether the current matrix is equal to another matrix. More...
 

Static Public Member Functions

static void CreateRotation (double angle, out Matrix2d result)
 Builds a rotation matrix. More...
 
static Matrix2d CreateRotation (double angle)
 Builds a rotation matrix. More...
 
static void CreateScale (double scale, out Matrix2d result)
 Creates a scale matrix. More...
 
static Matrix2d CreateScale (double scale)
 Creates a scale matrix. More...
 
static void CreateScale (Vector2d scale, out Matrix2d result)
 Creates a scale matrix. More...
 
static Matrix2d CreateScale (Vector2d scale)
 Creates a scale matrix. More...
 
static void CreateScale (double x, double y, out Matrix2d result)
 Creates a scale matrix. More...
 
static Matrix2d CreateScale (double x, double y)
 Creates a scale matrix. More...
 
static void Mult (ref Matrix2d left, double right, out Matrix2d result)
 Multiplies and instance by a scalar. More...
 
static Matrix2d Mult (Matrix2d left, double right)
 Multiplies and instance by a scalar. More...
 
static void Mult (ref Matrix2d left, ref Matrix2d right, out Matrix2d result)
 Multiplies two instances. More...
 
static Matrix2d Mult (Matrix2d left, Matrix2d right)
 Multiplies two instances. More...
 
static void Mult (ref Matrix2d left, ref Matrix2x3d right, out Matrix2x3d result)
 Multiplies two instances. More...
 
static Matrix2x3d Mult (Matrix2d left, Matrix2x3d right)
 Multiplies two instances. More...
 
static void Mult (ref Matrix2d left, ref Matrix2x4d right, out Matrix2x4d result)
 Multiplies two instances. More...
 
static Matrix2x4d Mult (Matrix2d left, Matrix2x4d right)
 Multiplies two instances. More...
 
static void Add (ref Matrix2d left, ref Matrix2d right, out Matrix2d result)
 Adds two instances. More...
 
static Matrix2d Add (Matrix2d left, Matrix2d right)
 Adds two instances. More...
 
static void Subtract (ref Matrix2d left, ref Matrix2d right, out Matrix2d result)
 Subtracts two instances. More...
 
static Matrix2d Subtract (Matrix2d left, Matrix2d right)
 Subtracts two instances. More...
 
static void Invert (ref Matrix2d mat, out Matrix2d result)
 Calculate the inverse of the given matrix More...
 
static Matrix2d Invert (Matrix2d mat)
 Calculate the inverse of the given matrix More...
 
static void Transpose (ref Matrix2d mat, out Matrix2d result)
 Calculate the transpose of the given matrix. More...
 
static Matrix2d Transpose (Matrix2d mat)
 Calculate the transpose of the given matrix. More...
 
static Matrix2d operator* (double left, Matrix2d right)
 Scalar multiplication. More...
 
static Matrix2d operator* (Matrix2d left, double right)
 Scalar multiplication. More...
 
static Matrix2d operator* (Matrix2d left, Matrix2d right)
 Matrix multiplication More...
 
static Matrix2x3d operator* (Matrix2d left, Matrix2x3d right)
 Matrix multiplication More...
 
static Matrix2x4d operator* (Matrix2d left, Matrix2x4d right)
 Matrix multiplication More...
 
static Matrix2d operator+ (Matrix2d left, Matrix2d right)
 Matrix addition More...
 
static Matrix2d operator- (Matrix2d left, Matrix2d right)
 Matrix subtraction More...
 
static bool operator== (Matrix2d left, Matrix2d right)
 Compares two instances for equality. More...
 
static bool operator!= (Matrix2d left, Matrix2d right)
 Compares two instances for inequality. More...
 

Public Attributes

Vector2d Row0
 Top row of the matrix. More...
 
Vector2d Row1
 Bottom row of the matrix. More...
 

Static Public Attributes

static readonly Matrix2d Identity = new Matrix2d(Vector2d.UnitX, Vector2d.UnitY)
 The identity matrix. More...
 
static readonly Matrix2d Zero = new Matrix2d(Vector2d.Zero, Vector2d.Zero)
 The zero matrix. More...
 

Properties

double Determinant [get]
 Gets the determinant of this matrix. More...
 
Vector2d Column0 [get, set]
 Gets or sets the first column of this matrix. More...
 
Vector2d Column1 [get, set]
 Gets or sets the second 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 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...
 
Vector2d 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 2x2 matrix

Constructor & Destructor Documentation

OpenTK.Matrix2d.Matrix2d ( Vector2d  row0,
Vector2d  row1 
)

Constructs a new instance.

Parameters
row0Top row of the matrix.
row1Bottom row of the matrix.
OpenTK.Matrix2d.Matrix2d ( double  m00,
double  m01,
double  m10,
double  m11 
)

Constructs a new instance

Parameters
m00First item of the first row of the matrix.
m01Second 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.

Member Function Documentation

static void OpenTK.Matrix2d.Add ( ref Matrix2d  left,
ref Matrix2d  right,
out Matrix2d  result 
)
static

Adds two instances.

Parameters
leftThe left operand of the addition.
rightThe right operand of the addition.
resultA new instance that is the result of the addition.
static Matrix2d OpenTK.Matrix2d.Add ( Matrix2d  left,
Matrix2d  right 
)
static

Adds two instances.

Parameters
leftThe left operand of the addition.
rightThe right operand of the addition.
Returns
A new instance that is the result of the addition.
static void OpenTK.Matrix2d.CreateRotation ( double  angle,
out Matrix2d  result 
)
static

Builds a rotation matrix.

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

Builds a rotation matrix.

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

Creates a scale matrix.

Parameters
scaleSingle scale factor for the x, y, and z axes.
resultA scale matrix.
static Matrix2d OpenTK.Matrix2d.CreateScale ( double  scale)
static

Creates a scale matrix.

Parameters
scaleSingle scale factor for the x and y axes.
Returns
A scale matrix.
static void OpenTK.Matrix2d.CreateScale ( Vector2d  scale,
out Matrix2d  result 
)
static

Creates a scale matrix.

Parameters
scaleScale factors for the x and y axes.
resultA scale matrix.
static Matrix2d OpenTK.Matrix2d.CreateScale ( Vector2d  scale)
static

Creates a scale matrix.

Parameters
scaleScale factors for the x and y axes.
Returns
A scale matrix.
static void OpenTK.Matrix2d.CreateScale ( double  x,
double  y,
out Matrix2d  result 
)
static

Creates a scale matrix.

Parameters
xScale factor for the x axis.
yScale factor for the y axis.
resultA scale matrix.
static Matrix2d OpenTK.Matrix2d.CreateScale ( double  x,
double  y 
)
static

Creates a scale matrix.

Parameters
xScale factor for the x axis.
yScale factor for the y axis.
Returns
A scale matrix.
override bool OpenTK.Matrix2d.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.Matrix2d.Equals ( Matrix2d  other)

Indicates whether the current matrix is equal to another matrix.

Parameters
otherAn matrix to compare with this matrix.
Returns
true if the current matrix is equal to the matrix parameter; otherwise, false.
override int OpenTK.Matrix2d.GetHashCode ( )

Returns the hashcode for this instance.

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

Converts this instance into its inverse.

static void OpenTK.Matrix2d.Invert ( ref Matrix2d  mat,
out Matrix2d  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 Matrix2d is singular.
static Matrix2d OpenTK.Matrix2d.Invert ( Matrix2d  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 Matrix2d is singular.
static void OpenTK.Matrix2d.Mult ( ref Matrix2d  left,
double  right,
out Matrix2d  result 
)
static

Multiplies and instance by a scalar.

Parameters
leftThe left operand of the multiplication.
rightThe right operand of the multiplication.
resultA new instance that is the result of the multiplication.
static Matrix2d OpenTK.Matrix2d.Mult ( Matrix2d  left,
double  right 
)
static

Multiplies and instance by a scalar.

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.Matrix2d.Mult ( ref Matrix2d  left,
ref Matrix2d  right,
out Matrix2d  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.
static Matrix2d OpenTK.Matrix2d.Mult ( Matrix2d  left,
Matrix2d  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.Matrix2d.Mult ( ref Matrix2d  left,
ref Matrix2x3d  right,
out Matrix2x3d  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.
static Matrix2x3d OpenTK.Matrix2d.Mult ( Matrix2d  left,
Matrix2x3d  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.Matrix2d.Mult ( ref Matrix2d  left,
ref Matrix2x4d  right,
out Matrix2x4d  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.
static Matrix2x4d OpenTK.Matrix2d.Mult ( Matrix2d  left,
Matrix2x4d  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 bool OpenTK.Matrix2d.operator!= ( Matrix2d  left,
Matrix2d  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 Matrix2d OpenTK.Matrix2d.operator* ( double  left,
Matrix2d  right 
)
static

Scalar multiplication.

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

Scalar multiplication.

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

Matrix multiplication

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

Matrix multiplication

Parameters
leftleft-hand operand
rightright-hand operand
Returns
A new Matrix2x3d which holds the result of the multiplication
static Matrix2x4d OpenTK.Matrix2d.operator* ( Matrix2d  left,
Matrix2x4d  right 
)
static

Matrix multiplication

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

Matrix addition

Parameters
leftleft-hand operand
rightright-hand operand
Returns
A new Matrix2d which holds the result of the addition
static Matrix2d OpenTK.Matrix2d.operator- ( Matrix2d  left,
Matrix2d  right 
)
static

Matrix subtraction

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

Compares two instances for equality.

Parameters
leftThe first instance.
rightThe second instance.
Returns
True, if left equals right; false otherwise.
static void OpenTK.Matrix2d.Subtract ( ref Matrix2d  left,
ref Matrix2d  right,
out Matrix2d  result 
)
static

Subtracts two instances.

Parameters
leftThe left operand of the subtraction.
rightThe right operand of the subtraction.
resultA new instance that is the result of the subtraction.
static Matrix2d OpenTK.Matrix2d.Subtract ( Matrix2d  left,
Matrix2d  right 
)
static

Subtracts two instances.

Parameters
leftThe left operand of the subtraction.
rightThe right operand of the subtraction.
Returns
A new instance that is the result of the subtraction.
override string OpenTK.Matrix2d.ToString ( )

Returns a System.String that represents the current Matrix4.

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

Converts this instance to it's transpose.

static void OpenTK.Matrix2d.Transpose ( ref Matrix2d  mat,
out Matrix2d  result 
)
static

Calculate the transpose of the given matrix.

Parameters
matThe matrix to transpose.
resultThe transpose of the given matrix.
static Matrix2d OpenTK.Matrix2d.Transpose ( Matrix2d  mat)
static

Calculate the transpose of the given matrix.

Parameters
matThe matrix to transpose.
Returns
The transpose of the given matrix.

Member Data Documentation

readonly Matrix2d OpenTK.Matrix2d.Identity = new Matrix2d(Vector2d.UnitX, Vector2d.UnitY)
static

The identity matrix.

Vector2d OpenTK.Matrix2d.Row0

Top row of the matrix.

Vector2d OpenTK.Matrix2d.Row1

Bottom row of the matrix.

readonly Matrix2d OpenTK.Matrix2d.Zero = new Matrix2d(Vector2d.Zero, Vector2d.Zero)
static

The zero matrix.

Property Documentation

Vector2d OpenTK.Matrix2d.Column0
getset

Gets or sets the first column of this matrix.

Vector2d OpenTK.Matrix2d.Column1
getset

Gets or sets the second column of this matrix.

double OpenTK.Matrix2d.Determinant
get

Gets the determinant of this matrix.

Vector2d OpenTK.Matrix2d.Diagonal
getset

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

double OpenTK.Matrix2d.M11
getset

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

double OpenTK.Matrix2d.M12
getset

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

double OpenTK.Matrix2d.M21
getset

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

double OpenTK.Matrix2d.M22
getset

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

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

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

double OpenTK.Matrix2d.Trace
get

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