mat3x2.rst 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. .. default-domain:: C
  2. mat3x2
  3. ======
  4. Header: cglm/mat3x2.h
  5. Table of contents (click to go):
  6. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. Macros:
  8. 1. GLM_MAT3X2_ZERO_INIT
  9. #. GLM_MAT3X2_ZERO
  10. Functions:
  11. 1. :c:func:`glm_mat3x2_copy`
  12. #. :c:func:`glm_mat3x2_zero`
  13. #. :c:func:`glm_mat3x2_make`
  14. #. :c:func:`glm_mat3x2_mul`
  15. #. :c:func:`glm_mat3x2_mulv`
  16. #. :c:func:`glm_mat3x2_transpose`
  17. #. :c:func:`glm_mat3x2_scale`
  18. Represented
  19. ~~~~~~~~~~~
  20. .. csv-table:: mat3x2
  21. :header: "", "column 1", "column 2", "column 3"
  22. "row 1", "m00", "m10", "m20"
  23. "row 2", "m01", "m11", "m21"
  24. Functions documentation
  25. ~~~~~~~~~~~~~~~~~~~~~~~
  26. .. c:function:: void glm_mat3x2_copy(mat3x2 src, mat3x2 dest)
  27. Copy mat3x2 (src) to mat3x2 (dest).
  28. Parameters:
  29. | *[in]* **src** mat3x2 (left)
  30. | *[out]* **dest** destination (result, mat3x2)
  31. .. csv-table:: mat3x2 **(src)**
  32. :header: "", "column 1", "column 2", "column 3"
  33. "row 1", "a00", "a10", "a20"
  34. "row 2", "a01", "a11", "a21"
  35. .. csv-table:: mat3x2 **(dest)**
  36. :header: "", "column 1", "column 2", "column 3"
  37. "row 1", "b00 = a00", "b10 = a10", "b20 = a20"
  38. "row 2", "b01 = a01", "b11 = a11", "b21 = a21"
  39. .. c:function:: void glm_mat3x2_zero(mat3x2 m)
  40. Zero out the mat3x2 (m).
  41. Parameters:
  42. | *[in, out]* **m** mat3x2 (src, dest)
  43. .. csv-table:: mat3x2 **(m)**
  44. :header: "", "column 1", "column 2", "column 3"
  45. "row 1", "0.00", "2.00", "15.00"
  46. "row 2", "5.00", "4.00", "6.00"
  47. .. csv-table:: mat3x2 **(m)**
  48. :header: "", "column 1", "column 2", "column 3"
  49. "row 1", "0.00", "0.00", "0.00"
  50. "row 2", "0.00", "0.00", "0.00"
  51. .. c:function:: void glm_mat3x2_make(const float * __restrict src, mat3x2 dest)
  52. Create mat3x2 (dest) from pointer (src).
  53. .. note:: **@src** must contain at least 6 elements.
  54. Parameters:
  55. | *[in]* **src** pointer to an array of floats (left)
  56. | *[out]* **dest** destination (result, mat3x2)
  57. .. csv-table:: float array (1x6) **(src)**
  58. :header: "", "column 1"
  59. "row 1", "v0"
  60. "row 2", "v1"
  61. "row 3", "v2"
  62. "row 4", "v3"
  63. "row 5", "v4"
  64. "row 6", "v5"
  65. .. csv-table:: mat3x2 **(dest)**
  66. :header: "", "column 1", "column 2", "column 3"
  67. "row 1", "v0", "v2", "v4"
  68. "row 2", "v1", "v3", "v5"
  69. .. c:function:: void glm_mat3x2_mul(mat3x2 m1, mat2x3 m2, mat2 dest)
  70. Multiply mat3x2 (m1) by mat2x3 (m2) and store in mat2 (dest).
  71. .. code-block:: c
  72. glm_mat3x2_mul(mat3x2, mat2x3, mat2);
  73. Parameters:
  74. | *[in]* **m1** mat3x2 (left)
  75. | *[in]* **m2** mat2x3 (right)
  76. | *[out]* **dest** destination (result, mat2)
  77. .. csv-table:: mat3x2 **(m1)**
  78. :header: "", "column 1", "column 2", "column 3"
  79. "row 1", "a00", "a10", "a20"
  80. "row 2", "a01", "a11", "a21"
  81. .. csv-table:: mat2x3 **(m2)**
  82. :header: "", "column 1", "column 2"
  83. "row 1", "b00", "b10"
  84. "row 2", "b01", "b11"
  85. "row 3", "b02", "b12"
  86. .. csv-table:: mat2x2 **(dest)**
  87. :header: "", "column 1", "column 2"
  88. "row 1", "a00 * b00 + a10 * b01 + a20 * b02", "a00 * b10 + a10 * b11 + a20 * b12"
  89. "row 2", "a01 * b00 + a11 * b01 + a21 * b02", "a01 * b10 + a11 * b11 + a21 * b12"
  90. .. c:function:: void glm_mat3x2_mulv(mat3x2 m, vec3 v, vec2 dest)
  91. Multiply mat3x2 (m) by vec3 (v) and store in vec2 (dest).
  92. Parameters:
  93. | *[in]* **m** mat3x2 (left)
  94. | *[in]* **v** vec3 (right, column vector)
  95. | *[out]* **dest** destination (result, column vector)
  96. .. csv-table:: mat3x2 **(m)**
  97. :header: "", "column 1", "column 2", "column 3"
  98. "row 1", "m00", "m10", "m20"
  99. "row 2", "m01", "m11", "m21"
  100. .. csv-table:: column vec3 (1x3) **(v)**
  101. :header: "", "column 1"
  102. "row 1", "v0"
  103. "row 2", "v1"
  104. "row 3", "v2"
  105. .. csv-table:: column vec2 (1x2) **(dest)**
  106. :header: "", "column 1"
  107. "row 1", "m00 * v0 + m10 * v1 + m20 * v2"
  108. "row 2", "m01 * v0 + m11 * v1 + m21 * v2"
  109. .. c:function:: void glm_mat3x2_transpose(mat3x2 src, mat2x3 dest)
  110. Transpose mat3x2 (src) and store in mat2x3 (dest).
  111. Parameters:
  112. | *[in]* **src** mat3x2 (left)
  113. | *[out]* **dest** destination (result, mat2x3)
  114. .. csv-table:: mat3x2 **(src)**
  115. :header: "", "column 1", "column 2", "column 3"
  116. "row 1", "a00", "a10", "a20"
  117. "row 2", "a01", "a11", "a21"
  118. .. csv-table:: mat2x3 **(dest)**
  119. :header: "", "column 1", "column 2"
  120. "row 1", "b00 = a00", "b10 = a01"
  121. "row 2", "b01 = a10", "b11 = a11"
  122. "row 3", "b02 = a20", "b12 = a21"
  123. .. c:function:: void glm_mat3x2_scale(mat3x2 m, float s)
  124. Multiply mat3x2 (m) by scalar constant (s).
  125. Parameters:
  126. | *[in, out]* **m** mat3x2 (src, dest)
  127. | *[in]* **s** float (scalar)
  128. .. csv-table:: mat3x2 **(m)**
  129. :header: "", "column 1", "column 2", "column 3"
  130. "row 1", "m00 = m00 * s", "m10 = m10 * s", "m20 = m20 * s"
  131. "row 2", "m01 = m01 * s", "m11 = m11 * s", "m21 = m21 * s"