|
Vecmat 0.2.3
C math and linear algebra library for 2D/3D graphics, physics, and science.
|
#include <vecmat.h>Go to the source code of this file.
Functions | |
| void | mat2i_identity_ptr (matrix2i *res) |
| Initializes the integer 2x2 matrix to identity (diagonal 1, others 0). | |
| void | mat2i_mul_ptr (matrix2i *res, const matrix2i *a, const matrix2i *b) |
| Multiplies two integer 2x2 matrices (a * b) using explicit loops and stores the result in res. | |
| void | mat2i_transpose_ptr (matrix2i *res, const matrix2i *m) |
| Computes the transpose of the input integer 2x2 matrix and stores in res. | |
| void | mat2i_inverse_ptr (matrix2i *res, const matrix2i *m) |
| Computes the inverse of the input integer 2x2 matrix and stores in res. | |
| void | mat2i_mul_vec2i_ptr (vector2i *res, const matrix2i *m, const vector2i *v) |
| Multiplies a 2x2 integer matrix by a vector2i. | |
| void mat2i_identity_ptr | ( | matrix2i * | res | ) |
Initializes the integer 2x2 matrix to identity (diagonal 1, others 0).
| res | Pointer to the output matrix2i. |
Definition at line 12 of file matrix2i_ptr.c.
References matrix2i::v.
Referenced by mat2i_identity(), and mat2i_inverse_ptr().
Computes the inverse of the input integer 2x2 matrix and stores in res.
Uses double precision for inversion, truncates to int; sets to identity if det=0.
| res | Pointer to the output matrix2i. |
| m | Pointer to the input matrix. |
Definition at line 60 of file matrix2i_ptr.c.
References mat2i_determinant(), mat2i_identity_ptr(), and matrix2i::v.
Referenced by mat2i_inverse().
Multiplies two integer 2x2 matrices (a * b) using explicit loops and stores the result in res.
| res | Pointer to the output matrix2i. |
| a | Pointer to the first matrix. |
| b | Pointer to the second matrix. |
Definition at line 27 of file matrix2i_ptr.c.
References matrix2i::m11, matrix2i::m12, matrix2i::m21, and matrix2i::m22.
Referenced by mat2i_mul().
Multiplies a 2x2 integer matrix by a vector2i.
| res | Output value. |
| m | Input matrix. |
| v | Input vector. |
Definition at line 81 of file matrix2i_ptr.c.
References matrix2i::m11, matrix2i::m12, matrix2i::m21, matrix2i::m22, vector2i::x, and vector2i::y.
Referenced by mat2i_mul_vec2i().
Computes the transpose of the input integer 2x2 matrix and stores in res.
| res | Pointer to the output matrix2i. |
| m | Pointer to the input matrix. |
Definition at line 44 of file matrix2i_ptr.c.
References matrix2i::v.
Referenced by mat2i_transpose().