90 return m.
v[0] * m.
v[3] - m.
v[1] * m.
v[2];
matrix2 mat2_transpose(const matrix2 m)
Computes the transpose of a 2x2 matrix.
matrix2 mat2_inverse(const matrix2 m)
Computes the inverse of a 2x2 matrix.
vm_float_t mat2_determinant(const matrix2 m)
Calculates the determinant of the given 2x2 matrix.
matrix2 mat2_identity(void)
Constructs the 2x2 identity matrix.
vector2 mat2_mul_vec2(const matrix2 m, const vector2 v)
Multiplies a 2x2 matrix by a vector2.
matrix2 mat2_from_mat3(const matrix3 m)
Copies the upper-left 2x2 of a matrix3.
matrix2 mat2_scale(const vector2 s)
Builds a 2x2 scaling matrix from a vector2.
matrix2 mat2_mul(const matrix2 a, const matrix2 b)
Multiplies two 2x2 matrices (a * b).
matrix2 mat2_rotation_z(const vm_float_t degrees)
Constructs a 2x2 Z-axis rotation matrix.
vm_float_t v[VECMAT_MAT2_SIZE]
void mat2_scale_ptr(matrix2 *res, const vector2 *s)
Builds a 2x2 scaling matrix from a vector2.
void mat2_mul_ptr(matrix2 *res, const matrix2 *a, const matrix2 *b)
Multiplies two 2x2 matrices (a * b) in column-major / column-vector convention.
void mat2_transpose_ptr(matrix2 *res, const matrix2 *m)
Computes the transpose of the input 2x2 matrix and stores in res.
void mat2_rotation_z_ptr(matrix2 *res, vm_float_t degrees)
Sets res to a 2x2 rotation matrix for rotation around the Z-axis.
void mat2_identity_ptr(matrix2 *res)
Initializes the 2x2 matrix to identity (diagonal 1.0, others 0.0).
void mat2_inverse_ptr(matrix2 *res, const matrix2 *m)
Computes the inverse of the input 2x2 matrix using determinant and stores in res.
void mat2_mul_vec2_ptr(vector2 *res, const matrix2 *m, const vector2 *v)
Multiplies a 2x2 matrix by a vector2.
void mat2_from_mat3_ptr(matrix2 *res, const matrix3 *m)
Copies the upper-left 2x2 of a matrix3.