Vecmat 0.2.3
C math and linear algebra library for 2D/3D graphics, physics, and science.
Loading...
Searching...
No Matches
matrix2i.c File Reference
#include <vecmat.h>

Go to the source code of this file.

Functions

matrix2i mat2i_identity (void)
 Constructs the 2x2 integer identity matrix.
matrix2i mat2i_mul (const matrix2i a, const matrix2i b)
 Multiplies two 2x2 integer matrices (a * b).
matrix2i mat2i_transpose (const matrix2i m)
 Computes the transpose of a 2x2 integer matrix.
matrix2i mat2i_inverse (const matrix2i m)
 Computes the inverse of a 2x2 integer matrix.
vm_int_t mat2i_determinant (const matrix2i m)
 Calculates the determinant of the given 2x2 integer matrix.
vector2i mat2i_mul_vec2i (const matrix2i m, const vector2i v)
 Multiplies a 2x2 integer matrix by a vector2i.

Function Documentation

◆ mat2i_determinant()

vm_int_t mat2i_determinant ( const matrix2i m)

Calculates the determinant of the given 2x2 integer matrix.

Parameters
mThe matrix.
Returns
The determinant value (m.v[0]*m.v[3] - m.v[1]*m.v[2]).

Definition at line 73 of file matrix2i.c.

References matrix2i::v.

Referenced by mat2i_inverse_ptr().

◆ mat2i_identity()

matrix2i mat2i_identity ( void )

Constructs the 2x2 integer identity matrix.

See mat2i_identity_ptr instead.

Returns
The identity matrix2i.

Definition at line 14 of file matrix2i.c.

References mat2i_identity_ptr().

◆ mat2i_inverse()

matrix2i mat2i_inverse ( const matrix2i m)

Computes the inverse of a 2x2 integer matrix.

See mat2i_inverse_ptr instead.

Parameters
mThe input matrix.
Returns
The inverse matrix2i.

Definition at line 60 of file matrix2i.c.

References mat2i_inverse_ptr().

◆ mat2i_mul()

matrix2i mat2i_mul ( const matrix2i a,
const matrix2i b )

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

See mat2i_mul_ptr instead.

Parameters
aThe first matrix.
bThe second matrix.
Returns
The resulting product matrix2i.

Definition at line 30 of file matrix2i.c.

References mat2i_mul_ptr().

◆ mat2i_mul_vec2i()

vector2i mat2i_mul_vec2i ( const matrix2i m,
const vector2i v )

Multiplies a 2x2 integer matrix by a vector2i.

See mat2i_mul_vec2i_ptr instead.

Parameters
mInput matrix.
vInput vector.
Returns
The resulting vector2i.

Definition at line 87 of file matrix2i.c.

References mat2i_mul_vec2i_ptr().

◆ mat2i_transpose()

matrix2i mat2i_transpose ( const matrix2i m)

Computes the transpose of a 2x2 integer matrix.

See mat2i_transpose_ptr instead.

Parameters
mThe input matrix.
Returns
The transposed matrix2i.

Definition at line 45 of file matrix2i.c.

References mat2i_transpose_ptr().