Skip to content

Commit

Permalink
Merge pull request recp#340 from recp/non-square-matrix
Browse files Browse the repository at this point in the history
add some missing non-square matrix funcs
  • Loading branch information
recp authored Aug 7, 2023
2 parents 129287b + 54dfc4b commit cdd4d0e
Show file tree
Hide file tree
Showing 43 changed files with 2,929 additions and 25 deletions.
9 changes: 5 additions & 4 deletions docs/source/mat2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ Functions documentation
make given matrix zero
Parameters:
| *[in,out]* **mat** matrix to
| *[in,out]* **mat** matrix
.. c:function:: void glm_mat2_mul(mat2 m1, mat2 m2, mat2 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
Expand Down Expand Up @@ -101,7 +102,7 @@ Functions documentation
.. c:function:: void glm_mat2_mulv(mat2 m, vec2 v, vec2 dest)
multiply mat4 with vec4 (column vector) and store in dest vector
multiply mat2 with vec2 (column vector) and store in dest vector
Parameters:
| *[in]* **mat** mat2 (left)
Expand All @@ -113,8 +114,8 @@ Functions documentation
multiply matrix with scalar
Parameters:
| *[in, out]* **mat** matrix
| *[in]* **dest** scalar
| *[in, out]* **m** matrix
| *[in]* **s** scalar
.. c:function:: float glm_mat2_det(mat2 mat)
Expand Down
63 changes: 62 additions & 1 deletion docs/source/mat2x3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,32 @@ Macros:

Functions:

1. :c:func:`glm_mat2x3_make`
1. :c:func:`glm_mat2x3_copy`
#. :c:func:`glm_mat2x3_zero`
#. :c:func:`glm_mat2x3_make`
#. :c:func:`glm_mat2x3_mul`
#. :c:func:`glm_mat2x3_mulv`
#. :c:func:`glm_mat2x3_transpose`
#. :c:func:`glm_mat2x3_scale`

Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~

.. c:function:: void glm_mat2x3_copy(mat2x3 mat, mat2x3 dest)
copy mat2x3 to another one (dest).
Parameters:
| *[in]* **mat** source
| *[out]* **dest** destination
.. c:function:: void glm_mat2x3_zero(mat2x3 mat)
make given matrix zero
Parameters:
| *[in,out]* **mat** matrix
.. c:function:: void glm_mat2x3_make(float * __restrict src, mat2x3 dest)
Create mat2x3 matrix from pointer
Expand All @@ -29,3 +50,43 @@ Functions documentation
Parameters:
| *[in]* **src** pointer to an array of floats
| *[out]* **dest** destination matrix2x3
.. c:function:: void glm_mat2x3_mul(mat2x3 m1, mat3x2 m2, mat2 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
glm_mat2x3_mul(m, m, m);
Parameters:
| *[in]* **m1** left matrix
| *[in]* **m2** right matrix
| *[out]* **dest** destination matrix
.. c:function:: void glm_mat2x3_mulv(mat2x3 m, vec3 v, vec2 dest)
multiply mat2x3 with vec3 (column vector) and store in dest vector
Parameters:
| *[in]* **m** mat2x3 (left)
| *[in]* **v** vec3 (right, column vector)
| *[out]* **dest** destination (result, column vector)
.. c:function:: void glm_mat2x3_transpose(mat2x3 m, mat3x2 dest)
transpose matrix and store in dest
Parameters:
| *[in]* **m** matrix
| *[out]* **dest** destination
.. c:function:: void glm_mat2x3_scale(mat2x3 m, float s)
multiply matrix with scalar
Parameters:
| *[in, out]* **m** matrix
| *[in]* **s** scalar
63 changes: 62 additions & 1 deletion docs/source/mat2x4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,32 @@ Macros:

Functions:

1. :c:func:`glm_mat2x4_make`
1. :c:func:`glm_mat2x4_copy`
#. :c:func:`glm_mat2x4_zero`
#. :c:func:`glm_mat2x4_make`
#. :c:func:`glm_mat2x4_mul`
#. :c:func:`glm_mat2x4_mulv`
#. :c:func:`glm_mat2x4_transpose`
#. :c:func:`glm_mat2x4_scale`

Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~

.. c:function:: void glm_mat2x4_copy(mat2x4 mat, mat2x4 dest)
copy mat2x4 to another one (dest).
Parameters:
| *[in]* **mat** source
| *[out]* **dest** destination
.. c:function:: void glm_mat2x4_zero(mat2x4 mat)
make given matrix zero
Parameters:
| *[in,out]* **mat** matrix
.. c:function:: void glm_mat2x4_make(float * __restrict src, mat2x4 dest)
Create mat2x4 matrix from pointer
Expand All @@ -29,3 +50,43 @@ Functions documentation
Parameters:
| *[in]* **src** pointer to an array of floats
| *[out]* **dest** destination matrix2x4
.. c:function:: void glm_mat2x4_mul(mat2x4 m1, mat4x2 m2, mat2 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
glm_mat2x4_mul(m, m, m);
Parameters:
| *[in]* **m1** left matrix
| *[in]* **m2** right matrix
| *[out]* **dest** destination matrix
.. c:function:: void glm_mat2x4_mulv(mat2x4 m, vec4 v, vec2 dest)
multiply mat2x4 with vec4 (column vector) and store in dest vector
Parameters:
| *[in]* **m** mat2x4 (left)
| *[in]* **v** vec4 (right, column vector)
| *[out]* **dest** destination (result, column vector)
.. c:function:: void glm_mat2x4_transpose(mat2x4 m, mat4x2 dest)
transpose matrix and store in dest
Parameters:
| *[in]* **m** matrix
| *[out]* **dest** destination
.. c:function:: void glm_mat2x4_scale(mat2x4 m, float s)
multiply matrix with scalar
Parameters:
| *[in, out]* **m** matrix
| *[in]* **s** scalar
9 changes: 5 additions & 4 deletions docs/source/mat3.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Functions documentation
.. c:function:: void glm_mat3_mul(mat3 m1, mat3 m2, mat3 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
Expand Down Expand Up @@ -103,10 +104,10 @@ Functions documentation
.. c:function:: void glm_mat3_mulv(mat3 m, vec3 v, vec3 dest)
multiply mat4 with vec4 (column vector) and store in dest vector
multiply mat3 with vec3 (column vector) and store in dest vector
Parameters:
| *[in]* **mat** mat3 (left)
| *[in]* **m** mat3 (left)
| *[in]* **v** vec3 (right, column vector)
| *[out]* **dest** destination (result, column vector)
Expand All @@ -123,8 +124,8 @@ Functions documentation
multiply matrix with scalar
Parameters:
| *[in, out]* **mat** matrix
| *[in]* **dest** scalar
| *[in, out]* **m** matrix
| *[in]* **s** scalar
.. c:function:: float glm_mat3_det(mat3 mat)
Expand Down
63 changes: 62 additions & 1 deletion docs/source/mat3x2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,32 @@ Macros:

Functions:

1. :c:func:`glm_mat3x2_make`
1. :c:func:`glm_mat3x2_copy`
#. :c:func:`glm_mat3x2_zero`
#. :c:func:`glm_mat3x2_make`
#. :c:func:`glm_mat3x2_mul`
#. :c:func:`glm_mat3x2_mulv`
#. :c:func:`glm_mat3x2_transpose`
#. :c:func:`glm_mat3x2_scale`

Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~

.. c:function:: void glm_mat3x2_copy(mat3x2 mat, mat3x2 dest)
copy mat3x2 to another one (dest).
Parameters:
| *[in]* **mat** source
| *[out]* **dest** destination
.. c:function:: void glm_mat3x2_zero(mat3x2 mat)
make given matrix zero
Parameters:
| *[in,out]* **mat** matrix
.. c:function:: void glm_mat3x2_make(float * __restrict src, mat3x2 dest)
Create mat3x2 matrix from pointer
Expand All @@ -28,3 +49,43 @@ Functions documentation
Parameters:
| *[in]* **src** pointer to an array of floats
| *[out]* **dest** destination matrix3x2
.. c:function:: void glm_mat3x2_mul(mat3x2 m1, mat2x3 m2, mat3 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
glm_mat3x2_mul(m, m, m);
Parameters:
| *[in]* **m1** left matrix
| *[in]* **m2** right matrix
| *[out]* **dest** destination matrix
.. c:function:: void glm_mat3x2_mulv(mat3x2 m, vec2 v, vec3 dest)
multiply mat3x2 with vec2 (column vector) and store in dest vector
Parameters:
| *[in]* **m** mat3x2 (left)
| *[in]* **v** vec3 (right, column vector)
| *[out]* **dest** destination (result, column vector)
.. c:function:: void glm_mat3x2_transpose(mat3x2 m, mat2x3 dest)
transpose matrix and store in dest
Parameters:
| *[in]* **m** matrix
| *[out]* **dest** destination
.. c:function:: void glm_mat3x2_scale(mat3x2 m, float s)
multiply matrix with scalar
Parameters:
| *[in, out]* **m** matrix
| *[in]* **s** scalar
63 changes: 62 additions & 1 deletion docs/source/mat3x4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,32 @@ Macros:

Functions:

1. :c:func:`glm_mat3x4_make`
1. :c:func:`glm_mat3x4_copy`
#. :c:func:`glm_mat3x4_zero`
#. :c:func:`glm_mat3x4_make`
#. :c:func:`glm_mat3x4_mul`
#. :c:func:`glm_mat3x4_mulv`
#. :c:func:`glm_mat3x4_transpose`
#. :c:func:`glm_mat3x4_scale`

Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~

.. c:function:: void glm_mat3x4_copy(mat3x4 mat, mat3x4 dest)
copy mat3x4 to another one (dest).
Parameters:
| *[in]* **mat** source
| *[out]* **dest** destination
.. c:function:: void glm_mat3x4_zero(mat3x4 mat)
make given matrix zero
Parameters:
| *[in,out]* **mat** matrix
.. c:function:: void glm_mat3x4_make(float * __restrict src, mat3x4 dest)
Create mat3x4 matrix from pointer
Expand All @@ -28,3 +49,43 @@ Functions documentation
Parameters:
| *[in]* **src** pointer to an array of floats
| *[out]* **dest** destination matrix3x4
.. c:function:: void glm_mat3x4_mul(mat3x4 m1, mat4x3 m2, mat3 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
glm_mat3x4_mul(m, m, m);
Parameters:
| *[in]* **m1** left matrix
| *[in]* **m2** right matrix
| *[out]* **dest** destination matrix
.. c:function:: void glm_mat3x4_mulv(mat3x4 m, vec4 v, vec3 dest)
multiply mat3x4 with vec4 (column vector) and store in dest vector
Parameters:
| *[in]* **m** mat3x4 (left)
| *[in]* **v** vec4 (right, column vector)
| *[out]* **dest** destination (result, column vector)
.. c:function:: void glm_mat3x4_transpose(mat3x4 m, mat4x3 dest)
transpose matrix and store in dest
Parameters:
| *[in]* **m** matrix
| *[out]* **dest** destination
.. c:function:: void glm_mat3x4_scale(mat3x4 m, float s)
multiply matrix with scalar
Parameters:
| *[in, out]* **m** matrix
| *[in]* **s** scalar
2 changes: 1 addition & 1 deletion docs/source/mat4.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ Functions documentation
.. c:function:: void glm_mat4_mul(mat4 m1, mat4 m2, mat4 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
Expand Down Expand Up @@ -157,7 +158,6 @@ Functions documentation
Parameters:
| *[in]* **m** mat4 (left)
| *[in]* **v** vec4 (right, column vector)
| *[in]* **last** 4th item to make it vec4
| *[out]* **dest** vec4 (result, column vector)
.. c:function:: void glm_mat4_mulv3(mat4 m, vec3 v, float last, vec3 dest)
Expand Down
Loading

0 comments on commit cdd4d0e

Please sign in to comment.