matrix: trace of matrix

This commit is contained in:
Recep Aslantas
2018-12-06 18:17:02 +03:00
parent 2ef9c23a6c
commit 21834b4ffb
8 changed files with 105 additions and 0 deletions

View File

@@ -29,6 +29,7 @@ Functions:
#. :c:func:`glm_mat3_scale`
#. :c:func:`glm_mat3_det`
#. :c:func:`glm_mat3_inv`
#. :c:func:`glm_mat3_trace`
#. :c:func:`glm_mat3_swap_col`
#. :c:func:`glm_mat3_swap_row`
@@ -133,6 +134,16 @@ Functions documentation
| *[in]* **mat** matrix
| *[out]* **dest** destination (inverse matrix)
.. c:function:: void glm_mat3_trace(mat3 m)
| sum of the elements on the main diagonal from upper left to the lower right
Parameters:
| *[in]* **m** matrix
Returns:
trace of matrix
.. c:function:: void glm_mat3_swap_col(mat3 mat, int col1, int col2)
swap two matrix columns

View File

@@ -33,6 +33,8 @@ Functions:
#. :c:func:`glm_mat4_mulN`
#. :c:func:`glm_mat4_mulv`
#. :c:func:`glm_mat4_mulv3`
#. :c:func:`glm_mat3_trace`
#. :c:func:`glm_mat3_trace3`
#. :c:func:`glm_mat4_quat`
#. :c:func:`glm_mat4_transpose_to`
#. :c:func:`glm_mat4_transpose`
@@ -156,6 +158,27 @@ Functions documentation
| *[in]* **v** vec3 (right, column vector)
| *[out]* **dest** vec3 (result, column vector)
.. c:function:: void glm_mat4_trace(mat4 m)
| sum of the elements on the main diagonal from upper left to the lower right
Parameters:
| *[in]* **m** matrix
Returns:
trace of matrix
.. c:function:: void glm_mat4_trace3(mat4 m)
| trace of matrix (rotation part)
| sum of the elements on the main diagonal from upper left to the lower right
Parameters:
| *[in]* **m** matrix
Returns:
trace of matrix
.. c:function:: void glm_mat4_quat(mat4 m, versor dest)
convert mat4's rotation part to quaternion