Развитие дуальный чисел, векторов и кватернионов, а также гомогенных векторов и матриц
This commit is contained in:
parent
3f96b661a9
commit
b87518cd3f
21 changed files with 1787 additions and 1511 deletions
|
|
@ -460,17 +460,17 @@ inline void bgc_fp32_versor_get_rotation_matrix(BGC_FP32_Matrix3x3* matrix, cons
|
|||
const float x1x3 = versor->_x1 * versor->_x3;
|
||||
const float x2x3 = versor->_x2 * versor->_x3;
|
||||
|
||||
matrix->row1_col1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->row2_col2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->row3_col3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
matrix->r1c1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->r2c2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->r3c3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
|
||||
matrix->row1_col2 = 2.0f * (x1x2 - s0x3);
|
||||
matrix->row2_col3 = 2.0f * (x2x3 - s0x1);
|
||||
matrix->row3_col1 = 2.0f * (x1x3 - s0x2);
|
||||
matrix->r1c2 = 2.0f * (x1x2 - s0x3);
|
||||
matrix->r2c3 = 2.0f * (x2x3 - s0x1);
|
||||
matrix->r3c1 = 2.0f * (x1x3 - s0x2);
|
||||
|
||||
matrix->row2_col1 = 2.0f * (x1x2 + s0x3);
|
||||
matrix->row3_col2 = 2.0f * (x2x3 + s0x1);
|
||||
matrix->row1_col3 = 2.0f * (x1x3 + s0x2);
|
||||
matrix->r2c1 = 2.0f * (x1x2 + s0x3);
|
||||
matrix->r3c2 = 2.0f * (x2x3 + s0x1);
|
||||
matrix->r1c3 = 2.0f * (x1x3 + s0x2);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_versor_get_rotation_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Versor* versor)
|
||||
|
|
@ -487,17 +487,17 @@ inline void bgc_fp64_versor_get_rotation_matrix(BGC_FP64_Matrix3x3* matrix, cons
|
|||
const double x1x3 = versor->_x1 * versor->_x3;
|
||||
const double x2x3 = versor->_x2 * versor->_x3;
|
||||
|
||||
matrix->row1_col1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->row2_col2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->row3_col3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
matrix->r1c1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->r2c2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->r3c3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
|
||||
matrix->row1_col2 = 2.0 * (x1x2 - s0x3);
|
||||
matrix->row2_col3 = 2.0 * (x2x3 - s0x1);
|
||||
matrix->row3_col1 = 2.0 * (x1x3 - s0x2);
|
||||
matrix->r1c2 = 2.0 * (x1x2 - s0x3);
|
||||
matrix->r2c3 = 2.0 * (x2x3 - s0x1);
|
||||
matrix->r3c1 = 2.0 * (x1x3 - s0x2);
|
||||
|
||||
matrix->row2_col1 = 2.0 * (x1x2 + s0x3);
|
||||
matrix->row3_col2 = 2.0 * (x2x3 + s0x1);
|
||||
matrix->row1_col3 = 2.0 * (x1x3 + s0x2);
|
||||
matrix->r2c1 = 2.0 * (x1x2 + s0x3);
|
||||
matrix->r3c2 = 2.0 * (x2x3 + s0x1);
|
||||
matrix->r1c3 = 2.0 * (x1x3 + s0x2);
|
||||
}
|
||||
|
||||
// ============= Get Reverse Matrix ============= //
|
||||
|
|
@ -516,17 +516,17 @@ inline void bgc_fp32_versor_get_reverse_matrix(BGC_FP32_Matrix3x3* matrix, const
|
|||
const float x1x3 = versor->_x1 * versor->_x3;
|
||||
const float x2x3 = versor->_x2 * versor->_x3;
|
||||
|
||||
matrix->row1_col1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->row2_col2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->row3_col3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
matrix->r1c1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->r2c2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->r3c3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
|
||||
matrix->row1_col2 = 2.0f * (x1x2 + s0x3);
|
||||
matrix->row2_col3 = 2.0f * (x2x3 + s0x1);
|
||||
matrix->row3_col1 = 2.0f * (x1x3 + s0x2);
|
||||
matrix->r1c2 = 2.0f * (x1x2 + s0x3);
|
||||
matrix->r2c3 = 2.0f * (x2x3 + s0x1);
|
||||
matrix->r3c1 = 2.0f * (x1x3 + s0x2);
|
||||
|
||||
matrix->row2_col1 = 2.0f * (x1x2 - s0x3);
|
||||
matrix->row3_col2 = 2.0f * (x2x3 - s0x1);
|
||||
matrix->row1_col3 = 2.0f * (x1x3 - s0x2);
|
||||
matrix->r2c1 = 2.0f * (x1x2 - s0x3);
|
||||
matrix->r3c2 = 2.0f * (x2x3 - s0x1);
|
||||
matrix->r1c3 = 2.0f * (x1x3 - s0x2);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_versor_get_reverse_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Versor* versor)
|
||||
|
|
@ -543,17 +543,17 @@ inline void bgc_fp64_versor_get_reverse_matrix(BGC_FP64_Matrix3x3* matrix, const
|
|||
const double x1x3 = versor->_x1 * versor->_x3;
|
||||
const double x2x3 = versor->_x2 * versor->_x3;
|
||||
|
||||
matrix->row1_col1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->row2_col2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->row3_col3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
matrix->r1c1 = (s0s0 + x1x1) - (x2x2 + x3x3);
|
||||
matrix->r2c2 = (s0s0 + x2x2) - (x1x1 + x3x3);
|
||||
matrix->r3c3 = (s0s0 + x3x3) - (x1x1 + x2x2);
|
||||
|
||||
matrix->row1_col2 = 2.0 * (x1x2 + s0x3);
|
||||
matrix->row2_col3 = 2.0 * (x2x3 + s0x1);
|
||||
matrix->row3_col1 = 2.0 * (x1x3 + s0x2);
|
||||
matrix->r1c2 = 2.0 * (x1x2 + s0x3);
|
||||
matrix->r2c3 = 2.0 * (x2x3 + s0x1);
|
||||
matrix->r3c1 = 2.0 * (x1x3 + s0x2);
|
||||
|
||||
matrix->row2_col1 = 2.0 * (x1x2 - s0x3);
|
||||
matrix->row3_col2 = 2.0 * (x2x3 - s0x1);
|
||||
matrix->row1_col3 = 2.0 * (x1x3 - s0x2);
|
||||
matrix->r2c1 = 2.0 * (x1x2 - s0x3);
|
||||
matrix->r3c2 = 2.0 * (x2x3 - s0x1);
|
||||
matrix->r1c3 = 2.0 * (x1x3 - s0x2);
|
||||
}
|
||||
|
||||
// ============= Get Both Matrixes ============== //
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue