71 lines
1.8 KiB
C
71 lines
1.8 KiB
C
#include <stdio.h>
|
|
#include <math.h>
|
|
#include <basic-geometry.h>
|
|
|
|
#include "printing_utils.h"
|
|
#include "vector3_pair_difference.h"
|
|
#include "turn3_combination.h"
|
|
#include "affine3.h"
|
|
|
|
/*
|
|
int main() {
|
|
BGC_FP32_Turn3 start = { 1.0f, 0.0f, 0.0f, 0.0f };
|
|
BGC_FP32_Turn3 end = { 0.0f, 1.0f, 0.0f, 0.0f };
|
|
BGC_FP32_Turn3 result;
|
|
bgc_fp32_turn3_spherical_interpolation(&start, &end, 0.5f, &result);
|
|
printf("Result: %0.12f, %0.12f, %0.12f, %0.12f\n", result.s0, result.x1, result.x2, result.x3);
|
|
return 0;
|
|
}
|
|
*/
|
|
|
|
void test_fp32_quaternion_set_matrix()
|
|
{
|
|
BGC_FP32_Turn3 turn;
|
|
BGC_FP32_Matrix3x3 rotation;
|
|
BGC_FP32_Quaternion quaternion;
|
|
|
|
bgc_fp32_turn3_set_rotation(&turn, 1.0f, 1.0f, 1.0f, 120.0f, BGC_ANGLE_UNIT_DEGREES);
|
|
|
|
bgc_fp32_turn3_get_rotation_matrix(&rotation, &turn);
|
|
|
|
if (bgc_fp32_quaternion_set_rotation_matrix(&quaternion, &rotation) == BGC_FAILURE) {
|
|
printf("Failed\n");
|
|
return;
|
|
}
|
|
|
|
print_fp32_quaternion(&quaternion);
|
|
print_fp32_quaternion(&turn._versor);
|
|
}
|
|
|
|
void test_fp64_quaternion_set_matrix()
|
|
{
|
|
BGC_FP64_Turn3 turn;
|
|
BGC_FP64_Matrix3x3 rotation;
|
|
BGC_FP64_Quaternion quaternion;
|
|
|
|
bgc_fp64_turn3_set_rotation(&turn, 1.0, 1.0, 1.0, 120.0, BGC_ANGLE_UNIT_DEGREES);
|
|
|
|
bgc_fp64_turn3_get_rotation_matrix(&rotation, &turn);
|
|
|
|
if (bgc_fp64_quaternion_set_rotation_matrix(&quaternion, &rotation) == BGC_FAILURE) {
|
|
printf("Failed\n");
|
|
return;
|
|
}
|
|
|
|
print_fp64_quaternion(&quaternion);
|
|
print_fp64_quaternion(&turn._versor);
|
|
}
|
|
|
|
int main()
|
|
{
|
|
//test_fp32_pair_difference();
|
|
//test_fp64_pair_difference();
|
|
|
|
//test_fp32_quaternion_set_matrix();
|
|
//test_fp64_quaternion_set_matrix();
|
|
|
|
//test_fp32_turn3_combination();
|
|
//test_fp64_turn3_combination();
|
|
|
|
return 0;
|
|
}
|