Переименование tangent в тангенсную пару
This commit is contained in:
parent
02bcb1bd33
commit
9864653787
18 changed files with 168 additions and 173 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
/*
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
@ -59,7 +60,7 @@ structure_fp32_t* make_structures(const unsigned int amount)
|
||||||
);
|
);
|
||||||
|
|
||||||
bgc_vector3_reset_fp32(&list[i].vector2);
|
bgc_vector3_reset_fp32(&list[i].vector2);
|
||||||
*/
|
*//*
|
||||||
}
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
|
|
@ -137,23 +138,16 @@ int main()
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
//#include <stdio.h>
|
|
||||||
//#include <basic-geometry.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <basic-geometry.h>
|
#include <basic-geometry.h>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
BgcVector3FP32 my_vector1, my_vector2;
|
BgcVector3FP32 my_vector;
|
||||||
|
|
||||||
bgc_vector3_set_values_fp32(-2, 7, 5, &my_vector1);
|
bgc_vector3_set_values_fp32(-2, 7, 10, &my_vector);
|
||||||
bgc_vector3_set_values_fp32(10, -1, -3, &my_vector2);
|
|
||||||
|
|
||||||
bgc_vector3_swap_fp32(&my_vector1, &my_vector2);
|
printf("x1 = %f, x2 = %f, x3 = %f\n", my_vector.x1, my_vector.x2, my_vector.x3);
|
||||||
|
|
||||||
printf("Vector #1: x1 = %f, x2 = %f, x3 = %f\n", my_vector1.x1, my_vector1.x2, my_vector1.x3);
|
|
||||||
printf("Vector #2: x1 = %f, x2 = %f, x3 = %f\n", my_vector2.x1, my_vector2.x2, my_vector2.x3);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
#include "matrix3x2.h"
|
#include "matrix3x2.h"
|
||||||
#include "matrix3x3.h"
|
#include "matrix3x3.h"
|
||||||
|
|
||||||
#include "tangent.h"
|
#include "tangent-pair.h"
|
||||||
|
|
||||||
#include "rotation3.h"
|
#include "rotation3.h"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@
|
||||||
<ClInclude Include="matrixes.h" />
|
<ClInclude Include="matrixes.h" />
|
||||||
<ClInclude Include="quaternion.h" />
|
<ClInclude Include="quaternion.h" />
|
||||||
<ClInclude Include="rotation3.h" />
|
<ClInclude Include="rotation3.h" />
|
||||||
<ClInclude Include="tangent.h" />
|
<ClInclude Include="tangent-pair.h" />
|
||||||
<ClInclude Include="utilities.h" />
|
<ClInclude Include="utilities.h" />
|
||||||
<ClInclude Include="versor.h" />
|
<ClInclude Include="versor.h" />
|
||||||
<ClInclude Include="vector2.h" />
|
<ClInclude Include="vector2.h" />
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
<ClCompile Include="matrixes.c" />
|
<ClCompile Include="matrixes.c" />
|
||||||
<ClCompile Include="quaternion.c" />
|
<ClCompile Include="quaternion.c" />
|
||||||
<ClCompile Include="rotation3.c" />
|
<ClCompile Include="rotation3.c" />
|
||||||
<ClCompile Include="tangent.c" />
|
<ClCompile Include="tangent-pair.c" />
|
||||||
<ClCompile Include="versor.c" />
|
<ClCompile Include="versor.c" />
|
||||||
<ClCompile Include="vector2.c" />
|
<ClCompile Include="vector2.c" />
|
||||||
<ClCompile Include="vector3.c" />
|
<ClCompile Include="vector3.c" />
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
<ClInclude Include="matrixes.h">
|
<ClInclude Include="matrixes.h">
|
||||||
<Filter>Файлы заголовков</Filter>
|
<Filter>Файлы заголовков</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="tangent.h">
|
<ClInclude Include="tangent-pair.h">
|
||||||
<Filter>Файлы заголовков</Filter>
|
<Filter>Файлы заголовков</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
<ClCompile Include="matrix3x2.c">
|
<ClCompile Include="matrix3x2.c">
|
||||||
<Filter>Исходные файлы</Filter>
|
<Filter>Исходные файлы</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="tangent.c">
|
<ClCompile Include="tangent-pair.c">
|
||||||
<Filter>Исходные файлы</Filter>
|
<Filter>Исходные файлы</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
||||||
82
basic-geometry/tangent-pair.c
Normal file
82
basic-geometry/tangent-pair.c
Normal file
|
|
@ -0,0 +1,82 @@
|
||||||
|
#include "tangent-pair.h"
|
||||||
|
|
||||||
|
const BgcTangentPairFP32 BGC_IDLE_TANGENT_PAIR_FP32 = { 1.0f, 0.0f };
|
||||||
|
|
||||||
|
const BgcTangentPairFP64 BGC_IDLE_TANGENT_PAIR_FP64 = { 1.0, 0.0 };
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_reset_fp32(BgcTangentPairFP32* tangent);
|
||||||
|
extern inline void bgc_tangent_pair_reset_fp64(BgcTangentPairFP64* tangent);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_set_values_fp32(const float x1, const float x2, BgcTangentPairFP32* tangent);
|
||||||
|
extern inline void bgc_tangent_pair_set_values_fp64(const double x1, const double x2, BgcTangentPairFP64* tangent);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_copy_fp32(const BgcTangentPairFP32* from, BgcTangentPairFP32* to);
|
||||||
|
extern inline void bgc_tangent_pair_copy_fp64(const BgcTangentPairFP64* from, BgcTangentPairFP64* to);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_swap_fp32(BgcTangentPairFP32* tangent1, BgcTangentPairFP32* tangent2);
|
||||||
|
extern inline void bgc_tangent_pair_swap_fp64(BgcTangentPairFP64* tangent1, BgcTangentPairFP64* tangent2);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_set_turn_fp32(const float angle, const BgcAngleUnitEnum unit, BgcTangentPairFP32* tangent);
|
||||||
|
extern inline void bgc_tangent_pair_set_turn_fp64(const double angle, const BgcAngleUnitEnum unit, BgcTangentPairFP64* tangent);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_convert_fp64_to_fp32(const BgcTangentPairFP64* from, BgcTangentPairFP32* to);
|
||||||
|
extern inline void bgc_tangent_pair_convert_fp32_to_fp64(const BgcTangentPairFP32* from, BgcTangentPairFP64* to);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_invert_fp32(BgcTangentPairFP32* tangent);
|
||||||
|
extern inline void bgc_tangent_pair_invert_fp64(BgcTangentPairFP64* tangent);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_set_inverted_fp32(const BgcTangentPairFP32* tangent, BgcTangentPairFP32* result);
|
||||||
|
extern inline void bgc_tangent_pair_set_inverted_fp64(const BgcTangentPairFP64* tangent, BgcTangentPairFP64* result);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_make_rotation_matrix_fp32(const BgcTangentPairFP32* tangent, BgcMatrix2x2FP32* matrix);
|
||||||
|
extern inline void bgc_tangent_pair_make_rotation_matrix_fp64(const BgcTangentPairFP64* tangent, BgcMatrix2x2FP64* matrix);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_make_reverse_matrix_fp32(const BgcTangentPairFP32* tangent, BgcMatrix2x2FP32* matrix);
|
||||||
|
extern inline void bgc_tangent_pair_make_reverse_matrix_fp64(const BgcTangentPairFP64* tangent, BgcMatrix2x2FP64* matrix);
|
||||||
|
|
||||||
|
extern inline float bgc_tangent_pair_get_angle_fp32(const BgcTangentPairFP32* tangent, const BgcAngleUnitEnum unit);
|
||||||
|
extern inline double bgc_tangent_pair_get_angle_fp64(const BgcTangentPairFP64* tangent, const BgcAngleUnitEnum unit);
|
||||||
|
|
||||||
|
extern inline void bgc_tangent_pair_combine_fp32(const BgcTangentPairFP32* tangent1, const BgcTangentPairFP32* tangent2, BgcTangentPairFP32* result);
|
||||||