Table of Contents

Struct Matrix4

Namespace
NominalSystems
Assembly
NominalSystems.Core.dll

Represents a matrix or table of 16 numbers, within a fixed size of 4 rows and 4 columns.


public struct Matrix4 : IEnumerable<double>, IEnumerable
Implements

Constructors

Matrix4()

Creates a zero-initialized matrix.

public Matrix4()

Matrix4(in Matrix4)

Creates a deep-copy from another matrix.

public Matrix4(in Matrix4 a)

Parameters

a Matrix4

Matrix4(in double)

Creates a value-initialized matrix.

public Matrix4(in double a)

Parameters

a double

Matrix4(in double, in double, in double, in double, in double, in double, in double, in double, in double, in double, in double, in double, in double, in double, in double, in double)

Creates and initializes all matrix values.

public Matrix4(in double m00, in double m01, in double m02, in double m03, in double m10, in double m11, in double m12, in double m13, in double m20, in double m21, in double m22, in double m23, in double m30, in double m31, in double m32, in double m33)

Parameters

m00 double
m01 double
m02 double
m03 double
m10 double
m11 double
m12 double
m13 double
m20 double
m21 double
m22 double
m23 double
m30 double
m31 double
m32 double
m33 double

Fields

M00

The matrix's 1st column value.

public double M00

Field Value

double

M01

The matrix's 2nd column value.

public double M01

Field Value

double

M02

The matrix's 3rd column value.

public double M02

Field Value

double

M03

The matrix's 4th column value.

public double M03

Field Value

double

M10

The matrix's 1st column value.

public double M10

Field Value

double

M11

The matrix's 2nd column value.

public double M11

Field Value

double

M12

The matrix's 3rd column value.

public double M12

Field Value

double

M13

The matrix's 4th column value.

public double M13

Field Value

double

M20

The matrix's 1st column value.

public double M20

Field Value

double

M21

The matrix's 2nd column value.

public double M21

Field Value

double

M22

The matrix's 3rd column value.

public double M22

Field Value

double

M23

The matrix's 4th column value.

public double M23

Field Value

double

M30

The matrix's 1st column value.

public double M30

Field Value

double

M31

The matrix's 2nd column value.

public double M31

Field Value

double

M32

The matrix's 3rd column value.

public double M32

Field Value

double

M33

The matrix's 4th column value.

public double M33

Field Value

double

Properties

Determinant

A number representing the determinant of the matrix.

public readonly double Determinant { get; }

Property Value

double

Identity

A matrix with all diagonal values initialized with 1's.

public static Matrix4 Identity { get; }

Property Value

Matrix4

Inverse

A matrix representing the inverse of the matrix.

public readonly Matrix4 Inverse { get; }

Property Value

Matrix4

One

A matrix with all values initialized with 1's.

public static Matrix4 One { get; }

Property Value

Matrix4

Transpose

A matrix representing the transposition/flip of all matrix values by it's diagonal.

public readonly Matrix4 Transpose { get; }

Property Value

Matrix4

Zero

A matrix with all values initialized with 0's.

public static Matrix4 Zero { get; }

Property Value

Matrix4

Methods

Equals(object)

public override readonly bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(object, in double)

public readonly bool Equals(object obj, in double precision)

Parameters

obj object

The object to compare.

precision double

The precision error.

Returns

bool

GetEnumerator()

public readonly IEnumerator<double> GetEnumerator()

Returns

IEnumerator<double>

GetHashCode()

public override readonly int GetHashCode()

Returns

int

ToString()

public override readonly string ToString()

Returns

string

ToString(string)

public readonly string ToString(string fmt)

Parameters

fmt string

A numeric format string.

Returns

string

Operators

operator +(in Matrix4, in Matrix4)

Returns the addition of a matrix with another matrix.

public static Matrix4 operator +(in Matrix4 a, in Matrix4 b)

Parameters

a Matrix4
b Matrix4

Returns

Matrix4

operator +(in Matrix4, in double)

Returns the addition of a matrix with a number.

public static Matrix4 operator +(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

Matrix4

operator +(in double, in Matrix4)

Returns the addition of a number with a matrix.

public static Matrix4 operator +(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

Matrix4

operator /(in Matrix4, in double)

Returns the division of a matrix with a number.

public static Matrix4 operator /(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

Matrix4

operator /(in double, in Matrix4)

Returns the division of a number with a matrix.

public static Matrix4 operator /(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

Matrix4

operator ==(in Matrix4, in Matrix4)

Returns true if all values in a matrix are equal to another matrix.

public static bool operator ==(in Matrix4 a, in Matrix4 b)

Parameters

a Matrix4
b Matrix4

Returns

bool

operator ==(in Matrix4, in double)

Returns true if all values in a matrix are equal to a number.

public static bool operator ==(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

bool

operator ==(in double, in Matrix4)

Returns true if a number is equal to all values in a matrix.

public static bool operator ==(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

bool

operator >(in Matrix4, in double)

Returns true if all values in a matrix are greater than a number.

public static bool operator >(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

bool

operator >(in double, in Matrix4)

Returns true if a number is greater than all values in a matrix.

public static bool operator >(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

bool

operator >=(in Matrix4, in double)

Returns true if all values in a matrix are greater than or equal to a number.

public static bool operator >=(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

bool

operator >=(in double, in Matrix4)

Returns true if a number is greater than or equal to all values in a matrix.

public static bool operator >=(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

bool

operator !=(in Matrix4, in Matrix4)

Returns true if all values in a matrix are not equal to another matrix.

public static bool operator !=(in Matrix4 a, in Matrix4 b)

Parameters

a Matrix4
b Matrix4

Returns

bool

operator !=(in Matrix4, in double)

Returns true if all values in a matrix are not equal to a number.

public static bool operator !=(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

bool

operator !=(in double, in Matrix4)

Returns true if a number is not equal to all values in a matrix.

public static bool operator !=(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

bool

operator <(in Matrix4, in double)

Returns true if all values in a matrix are less than a number.

public static bool operator <(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

bool

operator <(in double, in Matrix4)

Returns true if a number is less than all values in a matrix.

public static bool operator <(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

bool

operator <=(in Matrix4, in double)

Returns true if all values in a matrix are less than or equal to a number.

public static bool operator <=(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

bool

operator <=(in double, in Matrix4)

Returns true if a number is less than or equal to all values in a matrix.

public static bool operator <=(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

bool

operator *(in Matrix4, in Matrix4)

Returns the multiplication of a matrix with another matrix.

public static Matrix4 operator *(in Matrix4 a, in Matrix4 b)

Parameters

a Matrix4
b Matrix4

Returns

Matrix4

operator *(in Matrix4, in Vector4)

Returns the multiplication of a matrix with a column vector.

public static Vector4 operator *(in Matrix4 a, in Vector4 b)

Parameters

a Matrix4
b Vector4

Returns

Vector4

operator *(in Matrix4, in double)

Returns the multiplication of a matrix with a number.

public static Matrix4 operator *(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

Matrix4

operator *(in Vector4, in Matrix4)

Returns the multiplication of a row vector with a matrix.

public static Vector4 operator *(in Vector4 a, in Matrix4 b)

Parameters

a Vector4
b Matrix4

Returns

Vector4

operator *(in double, in Matrix4)

Returns the multiplication of a number with a matrix.

public static Matrix4 operator *(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

Matrix4

operator -(in Matrix4, in Matrix4)

Returns the subtraction of a matrix with another matrix.

public static Matrix4 operator -(in Matrix4 a, in Matrix4 b)

Parameters

a Matrix4
b Matrix4

Returns

Matrix4

operator -(in Matrix4, in double)

Returns the subtraction of a matrix with a number.

public static Matrix4 operator -(in Matrix4 a, in double b)

Parameters

a Matrix4
b double

Returns

Matrix4

operator -(in double, in Matrix4)

Returns the subtraction of a number with a matrix.

public static Matrix4 operator -(in double a, in Matrix4 b)

Parameters

a double
b Matrix4

Returns

Matrix4

operator -(in Matrix4)

Returns the negation of all values in a matrix.

public static Matrix4 operator -(in Matrix4 a)

Parameters

a Matrix4

Returns

Matrix4