Graphmath.Mat33.Tuple

This is the 3D mathematics library for graphmath.

This submodule handles 3x3 matrices using tuples of floats.

Summary

add(a, b)

add(a,b) adds one 3x3 matrix to another

apply(a, v)

apply( a, v ) transforms a vector v by a 3x3 matrix a

apply_left(v, a)

apply_left( v, a ) transforms a vector v by a 3x3 matrix a

at(a, i, j)

at( a, i, j) selects the element of a 3x3 matrix at row i and column j

column0(a)

column0( a ) selects the first column from a matrix 3x3 as a vec3

column1(a)

column1( a ) selects the second column from a matrix 3x3 as a vec3

column2(a)

column2( a ) selects the third column from a matrix 3x3 as a vec3

diag(a)

diag( a ) selects the diagonal from a matrix 3x3 as a vec3

identity()

identity() creates a 3x3 identity matrix

multiply(a, b)

multiply( a, b ) multiply two matrices a and b together

multiply_transpose(a, b)

multiply_transpose( a, b ) multiply two matrices a and b transpose together

row0(a)

row0( a ) selects the first row from a matrix 3x3 as a vec3

row1(a)

row1( a ) selects the second row from a matrix 3x3 as a vec3

row2(a)

row2( a ) selects the third row from a matrix 3x3 as a vec3

scale(a, k)

scale( a, k ) scales every element in a matrix a by coefficient k

subtract(a, b)

subtract(a,b) subtracts one 3x3 matrix from another

zero()

zero() creates a 3x3 zero matrix

Types

mat33 :: {float, float, float, float, float, float, float, float, float}

vec3 :: {float, float, float}

Functions

add(a, b)

Specs:

add(a,b) adds one 3x3 matrix to another.

apply(a, v)

Specs:

apply( a, v ) transforms a vector v by a 3x3 matrix a.

apply_left(v, a)

Specs:

apply_left( v, a ) transforms a vector v by a 3x3 matrix a.

at(a, i, j)

Specs:

  • at(mat33, Integer, Integer) :: float

at( a, i, j) selects the element of a 3x3 matrix at row i and column j.

column0(a)

Specs:

column0( a ) selects the first column from a matrix 3x3 as a vec3.

column1(a)

Specs:

column1( a ) selects the second column from a matrix 3x3 as a vec3.

column2(a)

Specs:

column2( a ) selects the third column from a matrix 3x3 as a vec3.

diag(a)

Specs:

diag( a ) selects the diagonal from a matrix 3x3 as a vec3.

identity()

Specs:

identity() creates a 3x3 identity matrix.

multiply(a, b)

Specs:

multiply( a, b ) multiply two matrices a and b together.

multiply_transpose(a, b)

Specs:

multiply_transpose( a, b ) multiply two matrices a and b transpose together.

row0(a)

Specs:

row0( a ) selects the first row from a matrix 3x3 as a vec3.

row1(a)

Specs:

row1( a ) selects the second row from a matrix 3x3 as a vec3.

row2(a)

Specs:

row2( a ) selects the third row from a matrix 3x3 as a vec3.

scale(a, k)

Specs:

scale( a, k ) scales every element in a matrix a by coefficient k.

subtract(a, b)

Specs:

subtract(a,b) subtracts one 3x3 matrix from another..

zero()

Specs:

zero() creates a 3x3 zero matrix.