Приаведение тангенса (tangent) к единому виду с другими сущностями, добавлено комплексное произведение двумерных векторов
This commit is contained in:
parent
896c8615f5
commit
fcbec62024
5 changed files with 182 additions and 114 deletions
|
|
@ -93,7 +93,7 @@ BgFP32Versor * make_random_versors(const unsigned int amount)
|
||||||
|
|
||||||
void print_versor(const BgFP32Versor* versor)
|
void print_versor(const BgFP32Versor* versor)
|
||||||
{
|
{
|
||||||
printf("Versor (%f, %f, %f, %f); Delta = %e\n", versor->s0, versor->x1, versor->x2, versor->x3, bg_fp32_versor_get_modulus(versor) - 1.0f);
|
printf("Versor (%f, %f, %f, %f)\n", versor->s0, versor->x1, versor->x2, versor->x3);
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_vector(const BgFP32Vector3* vector)
|
void print_vector(const BgFP32Vector3* vector)
|
||||||
|
|
|
||||||
|
|
@ -74,6 +74,10 @@
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
<Unit filename="rotation3.h" />
|
<Unit filename="rotation3.h" />
|
||||||
|
<Unit filename="tangent.c">
|
||||||
|
<Option compilerVar="CC" />
|
||||||
|
</Unit>
|
||||||
|
<Unit filename="tangent.h" />
|
||||||
<Unit filename="vector2.c">
|
<Unit filename="vector2.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
|
|
|
||||||
|
|
@ -8,16 +8,30 @@
|
||||||
#include "vector2.h"
|
#include "vector2.h"
|
||||||
#include "matrix2x2.h"
|
#include "matrix2x2.h"
|
||||||
|
|
||||||
|
// =================== Types ==================== //
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
float _cos, _sin;
|
const float cos, sin;
|
||||||
} BgFP32Tangent;
|
} BgFP32Tangent;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
double _cos, _sin;
|
const double cos, sin;
|
||||||
} BgFP64Tangent;
|
} BgFP64Tangent;
|
||||||
|
|
||||||
|
// ================= Dark Twins ================= //
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
float cos, sin;
|
||||||
|
} __BgFP32DarkTwinTangent;
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
double cos, sin;
|
||||||
|
} __BgFP64DarkTwinTangent;
|
||||||
|
|
||||||
|
// ================= Constants ================== //
|
||||||
|
|
||||||
extern const BgFP32Tangent BG_FP32_IDLE_TANGENT;
|
extern const BgFP32Tangent BG_FP32_IDLE_TANGENT;
|
||||||
extern const BgFP64Tangent BG_FP64_IDLE_TANGENT;
|
extern const BgFP64Tangent BG_FP64_IDLE_TANGENT;
|
||||||
|
|
||||||
|
|
@ -25,212 +39,266 @@ extern const BgFP64Tangent BG_FP64_IDLE_TANGENT;
|
||||||
|
|
||||||