From c5dcb93c92c0eb9d3825414d4ff058b446a4614a Mon Sep 17 00:00:00 2001 From: Vincent Davis Jr Date: Sat, 30 Mar 2024 14:22:23 -0400 Subject: [PATCH] docs: mat2x3 account for latest mulitplication changes This also includes tables to explain how mat2x3, column vectors and row vectors are represented. Also includes how resulting matrix or vector is formed. Signed-off-by: Vincent Davis Jr --- docs/source/mat2x3.rst | 60 ++++++++++++++++++++++++++++++++++++++---- 1 file changed, 55 insertions(+), 5 deletions(-) diff --git a/docs/source/mat2x3.rst b/docs/source/mat2x3.rst index 433c637..06780d6 100644 --- a/docs/source/mat2x3.rst +++ b/docs/source/mat2x3.rst @@ -23,6 +23,16 @@ Functions: #. :c:func:`glm_mat2x3_transpose` #. :c:func:`glm_mat2x3_scale` +Represented +~~~~~~~~~~~ + +.. csv-table:: mat2x3 + :header: "", "column 1", "column 2" + + "row 1", "m00", "m10" + "row 2", "m01", "m11" + "row 3", "m02", "m12" + Functions documentation ~~~~~~~~~~~~~~~~~~~~~~~ @@ -51,28 +61,68 @@ Functions documentation | *[in]* **src** pointer to an array of floats | *[out]* **dest** destination matrix2x3 -.. c:function:: void glm_mat2x3_mul(mat2x3 m1, mat3x2 m2, mat2 dest) +.. c:function:: void glm_mat2x3_mul(mat2x3 m1, mat3x2 m2, mat3 dest) multiply m1 and m2 to dest .. code-block:: c - glm_mat2x3_mul(mat2x3, mat3x2, mat2); + glm_mat2x3_mul(mat2x3, mat3x2, mat3); Parameters: | *[in]* **m1** left matrix (mat2x3) | *[in]* **m2** right matrix (mat3x2) - | *[out]* **dest** destination matrix (mat2) + | *[out]* **dest** destination matrix (mat3) -.. c:function:: void glm_mat2x3_mulv(mat2x3 m, vec3 v, vec2 dest) + .. csv-table:: mat2x3 + :header: "", "column 1", "column 2" - multiply mat2x3 with vec3 (column vector) and store in dest vector + "row 1", "a00", "a10" + "row 2", "a01", "a11" + "row 3", "a02", "a12" + + .. csv-table:: mat3x2 + :header: "", "column 1", "column 2", "column 3" + + "row 1", "b00", "b10", "b20" + "row 2", "b01", "b11", "b21" + + .. csv-table:: mat3x3 + :header: "", "column 1", "column 2", "column 3" + + "row 1", "a00 * b00 + a10 * b01", "a00 * b10 + a10 * b11", "a00 * b20 + a10 * b21" + "row 2", "a01 * b00 + a11 * b01", "a01 * b10 + a11 * b11", "a01 * b20 + a11 * b21" + "row 3", "a02 * b00 + a12 * b01", "a02 * b10 + a12 * b11", "a02 * b20 + a12 * b21" + +.. c:function:: void glm_mat2x3_mulv(mat2x3 m, vec2 v, vec3 dest) + + multiply mat2x3 with vec2 (column vector) and store in dest column vector Parameters: | *[in]* **m** mat2x3 (left) | *[in]* **v** vec3 (right, column vector) | *[out]* **dest** destination (result, column vector) + .. csv-table:: mat2x3 + :header: "", "column 1", "column 2" + + "row 1", "m00", "m10" + "row 2", "m01", "m11" + "row 3", "m02", "m12" + + .. csv-table:: column vec2 (1x2) + :header: "", "column 1" + + "row 1", "v0" + "row 2", "v1" + + .. csv-table:: column vec3 (1x3) + :header: "", "column 1" + + "row 1", "m00 * v0 + m10 * v1" + "row 2", "m01 * v0 + m11 * v1" + "row 3", "m02 * v0 + m12 * v1" + .. c:function:: void glm_mat2x3_transpose(mat2x3 m, mat3x2 dest) transpose matrix and store in dest