Добавлены функции модуля для версоров и кватернионо / Functions of modulus have been added for versors and quaternions

This commit is contained in:
Andrey Pokidov 2024-11-25 19:47:45 +07:00
parent bef7ab98f4
commit 03e390c1d0
12 changed files with 246 additions and 211 deletions

View file

@ -57,7 +57,7 @@ void print_versor(const BgFP32Versor* versor)
void print_vector(const BgFP32Vector3* vector) 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() int main()
@ -120,7 +120,6 @@ int main()
} }
*/ */
/*
int main() int main()
{ {
const unsigned int amount = 1000000; const unsigned int amount = 1000000;
@ -130,7 +129,7 @@ int main()
now = GetTickCount64(); now = GetTickCount64();
srand((unsigned int)(now & 0xfffffff)); srand((unsigned int)(now & 0xfffffff));
#else #else
timespec now; struct timespec now;
clock_gettime(0, &now); clock_gettime(0, &now);
srand((unsigned int)(now.tv_nsec & 0xfffffff)); srand((unsigned int)(now.tv_nsec & 0xfffffff));
#endif // _WIN64 #endif // _WIN64
@ -191,14 +190,3 @@ int main()
free(versors1); free(versors1);
return 0; 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;
}

View file

Internal server error - Personal Git Server: Beyond coding. We Forge.

500

Internal server error

Forgejo version: 11.0.1+gitea-1.22.0

@ -18,20 +18,20 @@ const BgFP32Vector2 TEST_BG_FP32_VECTOR2_COMMON_2[] = {
{ 1.5f, -23.35f } { 1.5f, -23.35f }
}; };
// =============== Square module ================ // // =============== Square modulus =============== //