src/matrix3i_ptr.c file

Functions

void mat3i_identity_ptr(matrix3i* res)
Fills the given 3x3 integer matrix with the identity matrix.
void mat3i_mul_ptr(matrix3i* res, const matrix3i* a, const matrix3i* b)
Multiplies two 3x3 integer matrices (standard matrix multiplication).
void mat3i_transpose_ptr(matrix3i* res, const matrix3i* m)
Computes the transpose of a 3x3 integer matrix.
void mat3i_inverse_ptr(matrix3i* res, const matrix3i* m)
Computes the inverse of a 3x3 integer matrix using adjugate over determinant.
void mat3i_mul_vec3i_ptr(vector3i* res, const matrix3i* m, const vector3i* v)
Multiplies a 3x3 integer matrix by a vector3i.
void mat3i_mul_vec2i_ptr(vector2i* res, const matrix3i* m, const vector2i* v)
Applies a 3x3 integer affine transform to a vector2i.

Function documentation

void mat3i_identity_ptr(matrix3i* res)

Fills the given 3x3 integer matrix with the identity matrix.

Parameters
res Pointer to the result matrix.

void mat3i_mul_ptr(matrix3i* res, const matrix3i* a, const matrix3i* b)

Multiplies two 3x3 integer matrices (standard matrix multiplication).

Parameters
res Pointer to the result matrix.
a Pointer to the first input matrix.
b Pointer to the second input matrix.

void mat3i_transpose_ptr(matrix3i* res, const matrix3i* m)

Computes the transpose of a 3x3 integer matrix.

Parameters
res Pointer to the result matrix.
m Pointer to the input matrix.

void mat3i_inverse_ptr(matrix3i* res, const matrix3i* m)

Computes the inverse of a 3x3 integer matrix using adjugate over determinant.

Parameters
res Pointer to the result matrix.
m Pointer to the input matrix.

If the determinant is zero (singular), sets the result to the identity matrix.

void mat3i_mul_vec3i_ptr(vector3i* res, const matrix3i* m, const vector3i* v)

Multiplies a 3x3 integer matrix by a vector3i.

Parameters
res Output value.
m Input matrix.
v Input vector.

void mat3i_mul_vec2i_ptr(vector2i* res, const matrix3i* m, const vector2i* v)

Applies a 3x3 integer affine transform to a vector2i.

Parameters
res Output value.
m Input matrix.
v Input vector.