mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2025-01-19 13:18:32 +00:00
aux/math: Implement math_matrix_2x2_multiply.
This commit is contained in:
parent
f6839ee4bf
commit
bd68c0e5f5
|
@ -300,6 +300,17 @@ math_quat_rotate_derivative(const struct xrt_quat *rot,
|
|||
*
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Multiply Matrix2x2.
|
||||
*
|
||||
* @relates xrt_matrix_2x2
|
||||
* @ingroup aux_math
|
||||
*/
|
||||
void
|
||||
math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left,
|
||||
const struct xrt_matrix_2x2 *right,
|
||||
struct xrt_matrix_2x2 *result);
|
||||
|
||||
void
|
||||
math_matrix_3x3_transform_vec3(const struct xrt_matrix_3x3 *left,
|
||||
const struct xrt_vec3 *right,
|
||||
|
|
|
@ -293,6 +293,17 @@ math_quat_rotate_derivative(const struct xrt_quat *quat,
|
|||
*
|
||||
*/
|
||||
|
||||
void
|
||||
math_matrix_2x2_multiply(const struct xrt_matrix_2x2 *left,
|
||||
const struct xrt_matrix_2x2 *right,
|
||||
struct xrt_matrix_2x2 *result)
|
||||
{
|
||||
result->v[0] = left->v[0] * right->v[0] + left->v[1] * right->v[2];
|
||||
result->v[1] = left->v[0] * right->v[1] + left->v[1] * right->v[3];
|
||||
result->v[2] = left->v[2] * right->v[0] + left->v[3] * right->v[2];
|
||||
result->v[3] = left->v[2] * right->v[1] + left->v[3] * right->v[3];
|
||||
}
|
||||
|
||||
extern "C" void
|
||||
math_matrix_3x3_transform_vec3(const struct xrt_matrix_3x3 *left,
|
||||
const struct xrt_vec3 *right,
|
||||
|
|
Loading…
Reference in a new issue