Class Matrix3x3C
- Namespace
- VirtualLabAPI.Core.Numerics
- Assembly
- VirtualLabAPI.dll
This class defines a 3x3 Matrix of complex numbers.
Operators (\(a+b\), \(a-b\)). Operator (\(a*b\)) supports
\(b\) as complex or Vector3C as well.
[Serializable]
public class Matrix3x3C
- Inheritance
-
Matrix3x3C
- Inherited Members
Constructors
Matrix3x3C()
Standard constructor, creates an empty (all zero values) matrix.
public Matrix3x3C()
Matrix3x3C(Complex)
Constructor to get a diagonal matrix having constant value \(c\) on all diagonal elements.
public Matrix3x3C(Complex c)
Parameters
cComplexValue \(c\) used to initialize diagonal elements.
Matrix3x3C(Complex, Complex, Complex, Complex, Complex, Complex, Complex, Complex, Complex)
Constructor taking nine complex values to initialize a Matrix3x3C.
public Matrix3x3C(Complex m11, Complex m21, Complex m31, Complex m12, Complex m22, Complex m32, Complex m13, Complex m23, Complex m33)
Parameters
m11ComplexFirst element of first column.
m21ComplexSecond element of first column.
m31ComplexThird element of first column.
m12ComplexFirst element of second column.
m22ComplexSecond element of second column.
m32ComplexThird element of second column.
m13ComplexFirst element of third column.
m23ComplexSecond element of third column.
m33ComplexThird element of third column.
Matrix3x3C(Matrix3x3C)
Copy constructor.
public Matrix3x3C(Matrix3x3C matC)
Parameters
matCMatrix3x3CMatrix3x3C to be copied.
Matrix3x3C(Vector3C, Vector3C, Vector3C)
Constructor taking three Vector3C to initialize the Matrix3x3C.
public Matrix3x3C(Vector3C firstCol, Vector3C secondCol, Vector3C thirdCol)
Parameters
Fields
_elements
The field in which the complex 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)\).
public Complex[] _elements
Field Value
- Complex[]
Properties
this[int, int]
Gets or sets a certain matrix element.
public Complex this[int row, int col] { get; set; }
Parameters
Property Value
- Complex
The selected matrix element.
Exceptions
- ArgumentOutOfRangeException
At least one of the two given indices is out of range.
Methods
Determinant()
Calculates the determinant of this matrix.
public Complex Determinant()
Returns
- Complex
The determinant of this matrix.
Equals(object)
Compares two matrices for equality.
public override bool Equals(object matrix)
Parameters
matrixobjectMatrix to compare with.
Returns
- bool
Trueif the two matrices store the same values.
GetCol(int)
Returns the specified column of this Matrix3x3C as Vector3C.
public Vector3C GetCol(int index)
Parameters
indexintColumn to return (index is one-based!).
Returns
- Vector3C
Result of operation.
GetHashCode()
Returns a hash code for this instance.
public override int GetHashCode()
Returns
- int
A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.
GetInverse()
Calculates the inverse matrix of this one.
public Matrix3x3C GetInverse()
Returns
- Matrix3x3C
Result of operation.
InverseMatrix(Matrix3x3C)
Calculates inverse matrix of the given matrix.
public static Matrix3x3C InverseMatrix(Matrix3x3C mat)
Parameters
matMatrix3x3CMatrix3x3C to invert.
Returns
- Matrix3x3C
Result of operation.
ToString()
Returns an output string representing this matrix.
public override string ToString()
Returns
- string
A string representing this matrix.
Operators
operator +(Matrix3x3C, Matrix3x3C)
Adds the elements of two Matrix3x3C objects.
public static Matrix3x3C operator +(Matrix3x3C a, Matrix3x3C b)
Parameters
aMatrix3x3Cthe first matrix
bMatrix3x3Cthe second matrix
Returns
- Matrix3x3C
The sum of the two matrices.
operator ==(Matrix3x3C, Matrix3x3C)
Compares two matrices. Two matrices are equal when they are equal in all elements.
public static bool operator ==(Matrix3x3C a, Matrix3x3C b)
Parameters
aMatrix3x3Cfirst matrix
bMatrix3x3Csecond matrix
Returns
operator !=(Matrix3x3C, Matrix3x3C)
Checks two matrices for inequality.
public static bool operator !=(Matrix3x3C a, Matrix3x3C b)
Parameters
aMatrix3x3Cfirst matrix
bMatrix3x3Csecond matrix
Returns
operator *(double, Matrix3x3C)
Multiplies a Matrix3x3C with a scalar.
public static Matrix3x3C operator *(double b, Matrix3x3C a)
Parameters
bdoublescalar
aMatrix3x3Cmatrix
Returns
- Matrix3x3C
Result of operation.
operator *(Matrix3x3C, double)
Multiplies a Matrix3x3C with a scalar.
public static Matrix3x3C operator *(Matrix3x3C a, double b)
Parameters
aMatrix3x3Cmatrix
bdoublescalar
Returns
- Matrix3x3C
Result of operation.
operator *(Matrix3x3C, Matrix3x3C)
Multiplies the elements of two Matrix3x3C objects.
public static Matrix3x3C operator *(Matrix3x3C a, Matrix3x3C b)
Parameters
aMatrix3x3Cthe first matrix
bMatrix3x3Cthe second matrix
Returns
- Matrix3x3C
The product of the two matrices.
operator *(Matrix3x3C, Matrix3x3D)
Multiplies the elements of two 3x3 matrices.
public static Matrix3x3C operator *(Matrix3x3C a, Matrix3x3D b)
Parameters
aMatrix3x3Cthe first matrix
bMatrix3x3Dthe second matrix
Returns
- Matrix3x3C
The product of the two matrices.
operator *(Matrix3x3C, Vector3C)
Multiplies a Matrix with an 3-dimensional complex Vector (A*Vec).
public static Vector3C operator *(Matrix3x3C a, Vector3C vec)
Parameters
aMatrix3x3C3x3-Matrix
vecVector3CA complex vector.
Returns
- Vector3C
Result of operation.
operator *(Matrix3x3D, Matrix3x3C)
Multiplies the elements of two 3x3 matrices objects.
public static Matrix3x3C operator *(Matrix3x3D a, Matrix3x3C b)
Parameters
aMatrix3x3Dthe first matrix
bMatrix3x3Cthe second matrix
Returns
- Matrix3x3C
The product of the two matrices.
operator -(Matrix3x3C, Matrix3x3C)
Subtracts the elements of two Matrix3x3C objects.
public static Matrix3x3C operator -(Matrix3x3C a, Matrix3x3C b)
Parameters
aMatrix3x3Cthe first matrix
bMatrix3x3Cthe second matrix
Returns
- Matrix3x3C
The Difference of the two matrices.