Programming Reference for VirtualLab Fusion  2025.1
Loading...
Searching...
No Matches
Matrix3x3D Class Reference

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class defines a 3x3 Matrix of double numbers.
Operators ( \(a+b\), \(a-b\)). Operator ( \(a*b\)) supports \(b\) as double or VectorD as well. More...

Inheritance diagram for Matrix3x3D:

Public Member Functions

override object Clone ()
 
double Determinant ()
 Calculates the determinant of current Matrix3x3.
 
override bool Equals (object matrix, EqualityIntent equalityIntent)
 Compares two matrices for equality.
 
Vector3D GetCol (int index)
 Returns specified column current Matrix3x3 as VectorD.
 
override int GetHashCode ()
 Returns a hash code for this instance.
 
Matrix3x3D GetInverse ()
 Calculates the inverse Matrix3x3 of current one.
 
Vector3D GetRow (int index)
 Returns specified row current Matrix3x3 as VectorD.
 
Matrix3x3D GetTransposed ()
 Returns transposed Matrix3x3 of current one.
 
bool IsIdentity ()
 Checks whether the matrix is the identity matrix.
 
bool IsIdentityNumericalChecks ()
 Checks whether the matrix is the identity matrix.
 
bool IsOrthogonal ()
 Checks if matrix is orthogonal, i.e. if M * M^T is the identity matrix.
 
 Matrix3x3D ()
 Standard constructor, creates an empty (all zero values) matrix.
 
 Matrix3x3D (double c)
 Constructor to get a diagonal matrix having constant value \(c\) on all diagonal elements.
 
 Matrix3x3D (double m11, double m21, double m31, double m12, double m22, double m32, double m13, double m23, double m33)
 Constructor taking nine doubles to initialize Matrix3x3.
 
 Matrix3x3D (Matrix3x3D matC)
 Copy constructor.
 
 Matrix3x3D (Vector3D firstCol, Vector3D secondCol, Vector3D thirdCol)
 Constructor taking three VectorD to initialize Matrix3x3.
 
override string ToString ()
 Returns an output string representing current Matrix3x3.
 

Static Public Member Functions

static Matrix3x3D InverseMatrix (Matrix3x3D mat)
 Calculates inverse current Matrix3x3 of the given one.
 
static bool operator!= (Matrix3x3D a, Matrix3x3D b)
 Checks to matrices for inequality.
 
static Matrix3x3D operator* (double b, Matrix3x3D a)
 Multiplies a Matrix3x3D with a scalar.
 
static Matrix3x3D operator* (Matrix3x3D a, double b)
 Multiplies a Matrix3x3D with a scalar.
 
static Matrix3x3D operator* (Matrix3x3D a, Matrix3x3D b)
 Multiplies the elements of two Matrix3x3D objects.
 
static Vector3C operator* (Matrix3x3D a, Vector3C vec)
 Multiplies a Matrix with an 3-dim. complex Vector (A*Vec)
 
static Vector3D operator* (Matrix3x3D a, Vector3D vec)
 Multiplies a Matrix with an 3-dim. Vector (A*Vec)
 
static Matrix3x3D operator+ (Matrix3x3D a, Matrix3x3D b)
 Adds the elements of two Matrix3x3D objects.
 
static Matrix3x3D operator- (Matrix3x3D a, Matrix3x3D b)
 Subtracts the elements of two Matrix3x3D objects.
 
static bool operator== (Matrix3x3D a, Matrix3x3D b)
 Compares two matrices. Two matrices are equal when they are equal in all elements.
 
static bool TryParse (string matrixText, out Matrix3x3D matrix3x3D)
 Tries to parse a Matrix3x3D object from a string.
 

Public Attributes

double[] Elements
 The field in which the double elements are stored. Note that indices [1..9] are interpreted mathematical. [0] exists but contains no information. Mapping of rows [1..3] and columns [1..3] to one-dimensional index \(i\) is defined by: \(i := row + 3 * (column-1)\).
 

Properties

static Matrix3x3D Identity [get]
 Static property which gives the identity matrix.
 
double this[int row, int col] [get, set]
 Gets or sets a certain matrix element.
 

Detailed Description

This class is subject to change. Programs using this class may require changes with a new version of VirtualLab.
This class defines a 3x3 Matrix of double numbers.
Operators ( \(a+b\), \(a-b\)). Operator ( \(a*b\)) supports \(b\) as double or VectorD as well.

Constructor & Destructor Documentation

◆ Matrix3x3D() [1/5]

Standard constructor, creates an empty (all zero values) matrix.


◆ Matrix3x3D() [2/5]

Matrix3x3D ( double  c)

Constructor to get a diagonal matrix having constant value \(c\) on all diagonal elements.

Parameters
cValue \(c\) used to initialize diagonal elements.

◆ Matrix3x3D() [3/5]

Copy constructor.

Parameters
matCMatrix3x3D to be copied.

◆ Matrix3x3D() [4/5]

Matrix3x3D ( Vector3D  firstCol,
Vector3D  secondCol,
Vector3D  thirdCol 
)

Constructor taking three VectorD to initialize Matrix3x3.

Parameters
firstColFirst column.
secondColSecond column.
thirdColThird column.

◆ Matrix3x3D() [5/5]

Matrix3x3D ( double  m11,
double  m21,
double  m31,
double  m12,
double  m22,
double  m32,
double  m13,
double  m23,
double  m33 
)

Constructor taking nine doubles to initialize Matrix3x3.

Parameters
m11First element of first column.
m21Second element of first column.
m31Third element of first column.
m12First element of second column.
m22Second element of second column.
m32Third element of second column.
m13First element of third column.
m23Second element of third column.
m33Third element of third column.

Member Function Documentation

◆ Determinant()

double Determinant ( )

Calculates the determinant of current Matrix3x3.

Returns

◆ Equals()

override bool Equals ( object  matrix,
EqualityIntent  equalityIntent 
)

Compares two matrices for equality.

Parameters
matrixmatrix to compare with
equalityIntent
Returns
True if the two matrices store the same values.

◆ GetCol()

Vector3D GetCol ( int  index)

Returns specified column current Matrix3x3 as VectorD.

Parameters
indexColumn to return (index is one-based!).
Returns
Result of operation.

◆ GetHashCode()

override int GetHashCode ( )

Returns a hash code for this instance.

Returns
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

◆ GetInverse()

Matrix3x3D GetInverse ( )

Calculates the inverse Matrix3x3 of current one.

Returns

◆ GetRow()

Vector3D GetRow ( int  index)

Returns specified row current Matrix3x3 as VectorD.

Parameters
indexRow to return (index is one-based!).
Returns
Result of operation.

◆ GetTransposed()

Matrix3x3D GetTransposed ( )

Returns transposed Matrix3x3 of current one.

Returns
Result of operation..

◆ InverseMatrix()

static Matrix3x3D InverseMatrix ( Matrix3x3D  mat)
static

Calculates inverse current Matrix3x3 of the given one.

Parameters
matMatrix3x3 to invert.
Returns
Result of operation.

◆ IsIdentity()

bool IsIdentity ( )

Checks whether the matrix is the identity matrix.

Returns
TRUE iff the matrix is the identity matrix

◆ IsIdentityNumericalChecks()

bool IsIdentityNumericalChecks ( )

Checks whether the matrix is the identity matrix.

Returns
TRUE iff the matrix is the identity matrix

◆ IsOrthogonal()

bool IsOrthogonal ( )

Checks if matrix is orthogonal, i.e. if M * M^T is the identity matrix.

Returns
True iff matrix is orthogonal

◆ operator!=()

static bool operator!= ( Matrix3x3D  a,
Matrix3x3D  b 
)
static

Checks to matrices for inequality.

Parameters
afirst matrix
bsecond matrix
Returns
FALSE if they are equal, otherwise TRUE.

◆ operator*() [1/5]

static Matrix3x3D operator* ( double  b,
Matrix3x3D  a 
)
static

Multiplies a Matrix3x3D with a scalar.

Parameters
bscalar
aMatrix
Returns
product

◆ operator*() [2/5]

static Matrix3x3D operator* ( Matrix3x3D  a,
double  b 
)
static

Multiplies a Matrix3x3D with a scalar.

Parameters
aMatrix
bscalar
Returns
product

◆ operator*() [3/5]

static Matrix3x3D operator* ( Matrix3x3D  a,
Matrix3x3D  b 
)
static

Multiplies the elements of two Matrix3x3D objects.

Parameters
athe first matrix
bthe second matrix
Returns
The product of the two matrices.

◆ operator*() [4/5]

static Vector3C operator* ( Matrix3x3D  a,
Vector3C  vec 
)
static

Multiplies a Matrix with an 3-dim. complex Vector (A*Vec)

Parameters
a3x3-Matrix
vecVector3C
Returns
Product: Vector3C

◆ operator*() [5/5]

static Vector3D operator* ( Matrix3x3D  a,
Vector3D  vec 
)
static

Multiplies a Matrix with an 3-dim. Vector (A*Vec)

Parameters
a3x3-Matrix
vecVector
Returns
Product: Vector3D

◆ operator+()

static Matrix3x3D operator+ ( Matrix3x3D  a,
Matrix3x3D  b 
)
static

Adds the elements of two Matrix3x3D objects.

Parameters
athe first matrix
bthe second matrix
Returns
The sum of the two matrices.

◆ operator-()

static Matrix3x3D operator- ( Matrix3x3D  a,
Matrix3x3D  b 
)
static

Subtracts the elements of two Matrix3x3D objects.

Parameters
athe first matrix
bthe second matrix
Returns
The Difference of the two matrices.

◆ operator==()

static bool operator== ( Matrix3x3D  a,
Matrix3x3D  b 
)
static

Compares two matrices. Two matrices are equal when they are equal in all elements.

Parameters
afirst matrix
bsecond matrix
Returns
TRUE if they are equal, otherwise false.

◆ ToString()

override string ToString ( )

Returns an output string representing current Matrix3x3.

Returns
A string that represents the current object.

◆ TryParse()

static bool TryParse ( string  matrixText,
out Matrix3x3D  matrix3x3D 
)
static

Tries to parse a Matrix3x3D object from a string.

Parameters
matrixTextString which have to be formatted like inside Marix3x3D.ToString()
matrix3x3DThe parsed matrix if parse has been possible. Null otherwise.
Returns
A flag indicating whether or not the parsing was successful.

Property Documentation

◆ this[int row, int col]

double this[int row, int col]
getset

Gets or sets a certain matrix element.

The selected matrix element.

Parameters
rowThe zero-based row index.
colThe zero-based column index.
Returns
The element at the specified matrix position.
Exceptions
System.ArgumentOutOfRangeExceptionAt least one of the two given indices is out of range.