Отказ от терминов Versor и Cotes Number в пользу Turn3 и Turn2, использование кватернионов внутри Turn3
This commit is contained in:
parent
38cff7e27d
commit
b470a3194b
27 changed files with 1815 additions and 2045 deletions
|
|
@ -40,7 +40,7 @@ BGC_FP32_Affine3* _create_bgc_affine3_random_list(int affine_amount)
|
|||
BGC_FP32_Position3 position;
|
||||
|
||||
for (int i = 0; i < affine_amount; i++) {
|
||||
bgc_fp32_versor_make(
|
||||
bgc_fp32_turn3_set_raw_values(
|
||||
&position.turn,
|
||||
get_random_value_fp32(),
|
||||
get_random_value_fp32(),
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#endif // _WINDOWS_
|
||||
|
||||
typedef struct {
|
||||
BGC_FP32_Versor versor1, versor2, result;
|
||||
BGC_FP32_Turn3 versor1, versor2, result;
|
||||
} structure_fp32_t;
|
||||
|
||||
structure_fp32_t* allocate_structures(const unsigned int amount)
|
||||
|
|
@ -29,7 +29,7 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
|||
const float multiplier = 2.0f / RAND_MAX;
|
||||
|
||||
for (unsigned int i = 0; i < amount; i++) {
|
||||
bgc_fp32_versor_make(
|
||||
bgc_fp32_turn3_set_raw_values(
|
||||
&list[i].versor1,
|
||||
rand() * multiplier - 1.0f,
|
||||
rand() * multiplier - 1.0f,
|
||||
|
|
@ -37,7 +37,7 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
|||
rand() * multiplier - 1.0f
|
||||
);
|
||||
|
||||
bgc_fp32_versor_make(
|
||||
bgc_fp32_turn3_set_raw_values(
|
||||
&list[i].versor2,
|
||||
rand() * multiplier - 1.0f,
|
||||
rand() * multiplier - 1.0f,
|
||||
|
|
@ -45,20 +45,20 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
|||
rand() * multiplier - 1.0f
|
||||
);
|
||||
|
||||
bgc_fp32_versor_reset(&list[i].result);
|
||||
bgc_fp32_turn3_reset(&list[i].result);
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
void print_versor_fp32(const BGC_FP32_Versor* versor)
|
||||
void print_quaternion_fp32(const BGC_FP32_Quaternion* quaternion)
|
||||
{
|
||||
printf("Versor (s0 = %0.12f, x1 = %0.12f, x2 = %0.12f, x3 = %0.12f)\n", versor->_s0, versor->_x1, versor->_x2, versor->_x3);
|
||||
printf("Quaternion FP32(s0 = %0.12f, x1 = %0.12f, x2 = %0.12f, x3 = %0.12f)\n", quaternion->s0, quaternion->x1, quaternion->x2, quaternion->x3);
|
||||
}
|
||||
|
||||
void print_versor_fp64(const BGC_FP64_Versor* versor)
|
||||
void print_quaternion_fp64(const BGC_FP64_Quaternion* quaternion)
|
||||
{
|
||||
printf("Versor (s0 = %0.20f, x1 = %0.20f, x2 = %0.20f, x3 = %0.20f)\n", versor->_s0, versor->_x1, versor->_x2, versor->_x3);
|
||||
printf("Quaternion FP64(s0 = %0.12f, x1 = %0.12f, x2 = %0.12f, x3 = %0.12f)\n", quaternion->s0, quaternion->x1, quaternion->x2, quaternion->x3);
|
||||
}
|
||||
|
||||
void print_vector_fp32(const BGC_FP32_Vector3* vector)
|
||||
|
|
@ -75,11 +75,11 @@ void list_work(const uint_fast32_t amount, structure_fp32_t* list)
|
|||
{
|
||||
for (uint_fast32_t j = 0; j < 1000; j++) {
|
||||
for (uint_fast32_t i = 0; i < amount; i++) {
|
||||