Table of Contents

Struct Matrix2

Namespace
NominalSystems
Assembly
NominalSystems.Core.dll

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


public struct Matrix2 : IEnumerable<double>, IEnumerable
Implements

Constructors

Matrix2()

Creates a zero-initialized matrix.

public Matrix2()

Matrix2(in Matrix2)

Creates a deep-copy from another matrix.

public Matrix2(in Matrix2 a)

Parameters

a Matrix2

Matrix2(in double)

Creates a value-initialized matrix.

public Matrix2(in double a)

Parameters

a double

Matrix2(in double, in double, in double, in double)

Creates and initializes all matrix values.

public Matrix2(in double m00, in double m01, in double m10, in double m11)

Parameters

m00 double
m01 double
m10 double
m11 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

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

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 Matrix2 Identity { get; }

Property Value

Matrix2

Inverse

A matrix representing the inverse of the matrix.

public readonly Matrix2 Inverse { get; }

Property Value

Matrix2

One

A matrix with all values initialized with 1's.

public static Matrix2 One { get; }

Property Value

Matrix2

Transpose

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

public readonly Matrix2 Transpose { get; }

Property Value

Matrix2

Zero

A matrix with all values initialized with 0's.

public static Matrix2 Zero { get; }

Property Value

Matrix2

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 Matrix2, in Matrix2)

Returns the addition of a matrix with another matrix.

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

Parameters

a Matrix2
b Matrix2

Returns

Matrix2

operator +(in Matrix2, in double)

Returns the addition of a matrix with a number.

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

Parameters

a Matrix2
b double

Returns

Matrix2

operator +(in double, in Matrix2)

Returns the addition of a number with a matrix.

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

Parameters

a double
b Matrix2

Returns

Matrix2

operator /(in Matrix2, in double)

Returns the division of a matrix with a number.

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

Parameters

a Matrix2
b double

Returns

Matrix2

operator /(in double, in Matrix2)

Returns the division of a number with a matrix.

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

Parameters

a double
b Matrix2

Returns

Matrix2

operator ==(in Matrix2, in Matrix2)

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

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

Parameters

a Matrix2
b Matrix2

Returns

bool

operator ==(in Matrix2, in double)

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

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

Parameters

a Matrix2
b double

Returns

bool

operator ==(in double, in Matrix2)

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

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

Parameters

a double
b Matrix2

Returns

bool

operator >(in Matrix2, in double)

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

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

Parameters

a Matrix2
b double

Returns

bool

operator >(in double, in Matrix2)

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

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

Parameters

a double
b Matrix2

Returns

bool

operator >=(in Matrix2, in double)

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

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

Parameters

a Matrix2
b double

Returns

bool

operator >=(in double, in Matrix2)

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

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

Parameters

a double
b Matrix2

Returns

bool

operator !=(in Matrix2, in Matrix2)

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

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

Parameters

a Matrix2
b Matrix2

Returns

bool

operator !=(in Matrix2, in double)

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

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

Parameters

a Matrix2
b double

Returns

bool

operator !=(in double, in Matrix2)

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

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

Parameters

a double
b Matrix2

Returns

bool

operator <(in Matrix2, in double)

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

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

Parameters

a Matrix2
b double

Returns

bool

operator <(in double, in Matrix2)

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

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

Parameters

a double
b Matrix2

Returns

bool

operator <=(in Matrix2, in double)

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

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

Parameters

a Matrix2
b double

Returns

bool

operator <=(in double, in Matrix2)

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

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

Parameters

a double
b Matrix2

Returns

bool

operator *(in Matrix2, in Matrix2)

Returns the multiplication of a matrix with another matrix.

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

Parameters

a Matrix2
b Matrix2

Returns

Matrix2

operator *(in Matrix2, in Vector2)

Returns the multiplication of a matrix with a column vector.

public static Vector2 operator *(in Matrix2 a, in Vector2 b)

Parameters

a Matrix2
b Vector2

Returns

Vector2

operator *(in Matrix2, in double)

Returns the multiplication of a matrix with a number.

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

Parameters

a Matrix2
b double

Returns

Matrix2

operator *(in Vector2, in Matrix2)

Returns the multiplication of a row vector with a matrix.

public static Vector2 operator *(in Vector2 a, in Matrix2 b)

Parameters

a Vector2
b Matrix2

Returns

Vector2

operator *(in double, in Matrix2)

Returns the multiplication of a number with a matrix.

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

Parameters

a double
b Matrix2

Returns

Matrix2

operator -(in Matrix2, in Matrix2)

Returns the subtraction of a matrix with another matrix.

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

Parameters

a Matrix2
b Matrix2

Returns

Matrix2

operator -(in Matrix2, in double)

Returns the subtraction of a matrix with a number.

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

Parameters

a Matrix2
b double

Returns

Matrix2

operator -(in double, in Matrix2)

Returns the subtraction of a number with a matrix.

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

Parameters

a double
b Matrix2

Returns

Matrix2

operator -(in Matrix2)

Returns the negation of all values in a matrix.

public static Matrix2 operator -(in Matrix2 a)

Parameters

a Matrix2

Returns

Matrix2