Matrix3x3

A simple class to handle 3x3 matrices The aim of this class is to be able to manipulate 3x3 matrices and 3D vectors as naturally as possible and make calculations readable. For that reason, the operators +, -, * are overloaded. (Reading a = a + b*2 - c is much easier to read than a = Sub(Add(a, Mul(b,2)),c) )

Please be careful about overflows when using those matrices wth integer types The calculations are carried with ElemT. eg : if you are using ubyte as the base type, all values will be modulo 256. This feature is necessary to use the class in a more general framework with ElemT != plain old data type.

struct Matrix3x3 (
ElemT
) if (
traits.isNumeric!ElemT
) {}

Constructors

this
this(ThisT v)
Undocumented in source.
this
this(ElemT m00, ElemT m01, ElemT m02, ElemT m10, ElemT m11, ElemT m12, ElemT m20, ElemT m21, ElemT m22)

Constructor explicitly setting the values of all the coefficient of the matrix.

Members

Aliases

FloatT
alias FloatT = double
Undocumented in source.
FloatT
alias FloatT = ElemT
Undocumented in source.
ThisT
alias ThisT = Matrix3x3!ElemT
Undocumented in source.
VectorT
alias VectorT = Vector!(ElemT, 3)
Undocumented in source.

Functions

cofactorMatrixTransposed
ThisT cofactorMatrixTransposed()
Undocumented in source. Be warned that the author may not have intended to support it.
col
VectorT col(int i)
Undocumented in source.
det
ElemT det()
Undocumented in source. Be warned that the author may not have intended to support it.
eigenValues
int eigenValues(VectorT eig_val)
Undocumented in source. Be warned that the author may not have intended to support it.
frobeniusNorm
ElemT frobeniusNorm()
Undocumented in source. Be warned that the author may not have intended to support it.
inverse
ThisT inverse()
Undocumented in source. Be warned that the author may not have intended to support it.
isNaN
bool isNaN()
Undocumented in source. Be warned that the author may not have intended to support it.
mulBothSides
ElemT mulBothSides(VectorT v, VectorT u)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
ThisT opBinary(ThisT mb)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
ThisT opBinary(ThisT mb)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
ThisT opBinary(ElemT k)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinary
VectorT opBinary(VectorT v)
Undocumented in source. Be warned that the author may not have intended to support it.
opBinaryRight
ThisT opBinaryRight(ElemT k)
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
MatrixT opCast()

Casting constructor

opEquals
bool opEquals(Matrix3x3!ElemT v)
Undocumented in source. Be warned that the author may not have intended to support it.
opIndex
inout(ElemT) opIndex(size_t i, size_t j)
Undocumented in source.
opIndex
ElemT opIndex(size_t i)
Undocumented in source.
opIndexAssign
void opIndexAssign(ElemT value, size_t i, size_t j)
Undocumented in source.
opIndexAssign
ElemT opIndexAssign(ElemT value, size_t i)
Undocumented in source.
opOpAssign
ThisT opOpAssign(ThisT mb)

Support Matrix operators +=, -=.

opOpAssign
ThisT opOpAssign(ThisT mb)
Undocumented in source. Be warned that the author may not have intended to support it.
opOpAssign
ThisT opOpAssign(ElemT k)
Undocumented in source. Be warned that the author may not have intended to support it.
opUnary
ThisT opUnary()
Undocumented in source. Be warned that the author may not have intended to support it.
orthogonalize
ThisT orthogonalize()
Undocumented in source. Be warned that the author may not have intended to support it.
project
Vector2!ElemT project(Vector!(ElemT, 2) v)
Undocumented in source. Be warned that the author may not have intended to support it.
row
VectorT row(int i)
Undocumented in source.
set
ThisT set(ElemT m00, ElemT m01, ElemT m02, ElemT m10, ElemT m11, ElemT m12, ElemT m20, ElemT m21, ElemT m22)

Change the value of all the coefficients of the matrix.

setCol
void setCol(int i, VectorT v1)
Undocumented in source.
setRow
void setRow(int i, VectorT v1)
Undocumented in source.
symmetricEigenSolver
void symmetricEigenSolver(VectorT eig_val, Matrix3x3!ElemT eig_vec)
Undocumented in source. Be warned that the author may not have intended to support it.
toString
string toString()
Undocumented in source. Be warned that the author may not have intended to support it.
trace
ElemT trace()
Undocumented in source. Be warned that the author may not have intended to support it.
transpose
ThisT transpose()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

data
ElemT[3][3] data [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Static functions

antiSym3
ThisT antiSym3(VectorT v)
Undocumented in source. Be warned that the author may not have intended to support it.
diagonal
ThisT diagonal(VectorT v)
Undocumented in source. Be warned that the author may not have intended to support it.
fromCols
ThisT fromCols(VectorT v1, VectorT v2, VectorT v3)
Undocumented in source. Be warned that the author may not have intended to support it.
fromRows
ThisT fromRows(VectorT v1, VectorT v2, VectorT v3)
Undocumented in source. Be warned that the author may not have intended to support it.
identity
ThisT identity()
Undocumented in source. Be warned that the author may not have intended to support it.
rodrigues
ThisT rodrigues(VectorT rot)
Undocumented in source. Be warned that the author may not have intended to support it.
sym3
ThisT sym3(VectorT v)
Undocumented in source. Be warned that the author may not have intended to support it.
zero
ThisT zero()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta