Graphmath.Mat44
This is the 3D mathematics library for graphmath.
This submodule handles 4x4 matrices using tuples of floats.
Summary
| add(a, b) |
|
| apply(a, v) |
|
| apply_left(v, a) |
|
| apply_left_transpose(v, a) |
|
| apply_transpose(a, v) |
|
| at(a, i, j) |
|
| column0(a) |
|
| column1(a) |
|
| column2(a) |
|
| column3(a) |
|
| diag(a) |
|
| identity() |
|
| make_scale(k) |
|
| make_scale(sx, sy, sz, sw) |
|
| make_translate(tx, ty, tz) |
|
| multiply(a, b) |
|
| multiply_transpose(a, b) |
|
| round(a, sigfigs) |
|
| row0(a) |
|
| row1(a) |
|
| row2(a) |
|
| row3(a) |
|
| scale(a, k) |
|
| subtract(a, b) |
|
| zero() |
|
Types ↑
mat44 :: {float, float, float, float, float, float, float, float, float, float, float, float, float, float, float, float}
vec4 :: {float, float, float, float}
Functions
Specs:
apply( a, v ) transforms a vector v by a 4x4 matrix a.
Specs:
apply_left( v, a ) transforms a vector v by a 4x4 matrix a.
Specs:
apply_left_transpose( v, a ) transforms a vector v by a 4x4 matrix a transposed.
Specs:
apply_transpose( a, v ) transforms a vector v by a 4x4 matrix a transposed.
Specs:
- at(mat44, Integer, Integer) :: float
at( a, i, j) selects the element of a 4x4 matrix at row i and column j.
Specs:
column0( a ) selects the first column from a matrix 4x4 as a vec4.
Specs:
column1( a ) selects the second column from a matrix 4x4 as a vec4.
Specs:
column2( a ) selects the third column from a matrix 4x4 as a vec4.
Specs:
column3( a ) selects the fourth column from a matrix 4x4 as a vec4.
Specs:
diag( a ) selects the diagonal from a matrix 4x4 as a vec4.
Specs:
- make_scale(float) :: mat44
make_scale( k ) creates a mat44 that uniformly scales by a value k.
Specs:
- make_scale(float, float, float, float) :: mat44
make_scale( sx, sy, sz, sw ) creates a mat44 that scales by sx, sy, sz, and sz.
Specs:
- make_translate(float, float, float) :: mat44
make_translate( tx, ty, tz ) creates a mat44 that translates a point by tx, ty, and tz.
Specs:
multiply( a, b ) multiply two matrices a and b together.
Specs:
multiply_transpose( a, b ) multiply two matrices a and b transpose together.
Specs:
round( a, sigfigs ) rounds every element of a supplied mat44 a to number of digits sigfigs.
Specs:
row0( a ) selects the first row from a matrix 4x4 as a vec4.
Specs:
row1( a ) selects the second row from a matrix 4x4 as a vec4.
Specs:
row2( a ) selects the third row from a matrix 4x4 as a vec4.
Specs:
row3( a ) selects the fourth row from a matrix 4x4 as a vec4.
Specs:
scale( a, k ) scales every element in a matrix a by coefficient k.
Specs:
subtract(a,b) subtracts one 4x4 matrix from another..