src/matrix2i.c file

Functions

auto mat2i_identity(void) -> matrix2i
Constructs the 2x2 integer identity matrix.
auto mat2i_mul(const matrix2i a, const matrix2i b) -> matrix2i
Multiplies two 2x2 integer matrices (a * b).
auto mat2i_transpose(const matrix2i m) -> matrix2i
Computes the transpose of a 2x2 integer matrix.
auto mat2i_inverse(const matrix2i m) -> matrix2i
Computes the inverse of a 2x2 integer matrix.
auto mat2i_determinant(const matrix2i m) -> vm_int_t
Calculates the determinant of the given 2x2 integer matrix.
auto mat2i_mul_vec2i(const matrix2i m, const 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_mul(const matrix2i a, const matrix2i b)

Multiplies two 2x2 integer matrices (a * b).

Parameters
a The first matrix.
b The second matrix.
Returns The resulting product matrix2i.

matrix2i mat2i_transpose(const matrix2i m)

Computes the transpose of a 2x2 integer matrix.

Parameters
m The input matrix.
Returns The transposed matrix2i.

matrix2i mat2i_inverse(const matrix2i m)

Computes the inverse of a 2x2 integer matrix.

Parameters
m The input matrix.
Returns The inverse matrix2i.

vm_int_t mat2i_determinant(const 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]).

vector2i mat2i_mul_vec2i(const matrix2i m, const vector2i v)

Multiplies a 2x2 integer matrix by a vector2i.

Parameters
m Input matrix.
v Input vector.
Returns The resulting vector2i.