Добавлены функции модуля для версоров и кватернионо / Functions of modulus have been added for versors and quaternions
This commit is contained in:
parent
bef7ab98f4
commit
03e390c1d0
12 changed files with 246 additions and 211 deletions
|
|
@ -57,7 +57,7 @@ void print_versor(const BgFP32Versor* versor)
|
|||
|
||||
void print_vector(const BgFP32Vector3* vector)
|
||||
{
|
||||
printf("(%f, %f, %f) / %f\n", vector->x1, vector->x2, vector->x3, bg_fp32_vector3_get_module(vector));
|
||||
printf("(%f, %f, %f) / %f\n", vector->x1, vector->x2, vector->x3, bg_fp32_vector3_get_modulus(vector));
|
||||
}
|
||||
/*
|
||||
int main()
|
||||
|
|
@ -120,7 +120,6 @@ int main()
|
|||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
int main()
|
||||
{
|
||||
const unsigned int amount = 1000000;
|
||||
|
|
@ -130,7 +129,7 @@ int main()
|
|||
now = GetTickCount64();
|
||||
srand((unsigned int)(now & 0xfffffff));
|
||||
#else
|
||||
timespec now;
|
||||
struct timespec now;
|
||||
clock_gettime(0, &now);
|
||||
srand((unsigned int)(now.tv_nsec & 0xfffffff));
|
||||
#endif // _WIN64
|
||||
|
|
@ -191,14 +190,3 @@ int main()
|
|||
free(versors1);
|
||||
return 0;
|
||||
}
|
||||
*/
|
||||
|
||||
int main() {
|
||||
BgFP32Versor versor;
|
||||
|
||||
bg_fp32_versor_reset(&versor);
|
||||
|
||||
printf("Versor: (%f, %f, %f, %f)\n", versor.s0, versor.x1, versor.x2, versor.x3);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,20 +18,20 @@ const BgFP32Vector2 TEST_BG_FP32_VECTOR2_COMMON_2[] = {
|
|||
{ 1.5f, -23.35f }
|
||||
};
|
||||
|
||||
// =============== Square module ================ //
|
||||
// =============== Square modulus =============== //
|
||||
|
||||
const float BG_FP32_VECTOR2_SQUARE_MODULE_1[] = { 25.0f, 25.0f, 500000000.0f, 100.01f, 15266.150221f };
|
||||
const float BG_FP32_VECTOR2_SQUARE_MODULUS_1[] = { 25.0f, 25.0f, 500000000.0f, 100.01f, 15266.150221f };
|
||||
|
||||
int test_bg_fp32_vector2_square_module()
|
||||
int test_bg_fp32_vector2_square_modulus()
|
||||
{
|
||||
print_test_name("BgFP32Vector2 square module");
|
||||
print_test_name("BgFP32Vector2 square modulus");
|
||||
|
||||
float square_module;
|
||||