matrix2i.c file
Functions
- auto mat2i_identity(void) -> matrix2i
- Constructs the 2x2 integer identity matrix.
- auto mat2i_mul(matrix2i a, matrix2i b) -> matrix2i
- Multiplies two 2x2 integer matrices (a * b).
- auto mat2i_transpose(matrix2i m) -> matrix2i
- Computes the transpose of a 2x2 integer matrix.
- auto mat2i_inverse(matrix2i m) -> matrix2i
- Computes the inverse of a 2x2 integer matrix.
-
auto mat2i_determinant(matrix2i m) -> vm_
int_ t - Calculates the determinant of the given 2x2 integer matrix.
- auto mat2i_mul_vec2i(matrix2i m, vector2i v) -> vector2i
- Multiplies a 2x2 integer matrix by a vector2i.
Function documentation
matrix2i mat2i_identity(void)
Constructs the 2x2 integer identity matrix.
| Returns | The identity matrix2i. |
|---|
matrix2i mat2i_transpose(matrix2i m)
Computes the transpose of a 2x2 integer matrix.
| Parameters | |
|---|---|
| m | The input matrix. |
| Returns | The transposed matrix2i. |
matrix2i mat2i_inverse(matrix2i m)
Computes the inverse of a 2x2 integer matrix.
| Parameters | |
|---|---|
| m | The input matrix. |
| Returns | The inverse matrix2i. |
Truncated integer inverse (not a modular inverse).
vm_ int_ t mat2i_determinant(matrix2i m)
Calculates the determinant of the given 2x2 integer matrix.
| Parameters | |
|---|---|
| m | The matrix. |
| Returns | The determinant value (m.v[0]*m.v[3] - m.v[1]*m.v[2]). |