Завершение большого переименования
This commit is contained in:
parent
120e651517
commit
3805354611
31 changed files with 1213 additions and 1255 deletions
|
@ -1,9 +1,9 @@
|
|||
#ifndef _BASIC_GEOMETRY_TANGENT_H_
|
||||
#define _BASIC_GEOMETRY_TANGENT_H_
|
||||
#ifndef _BGC_TANGENT_H_
|
||||
#define _BGC_TANGENT_H_
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#include "basis.h"
|
||||
#include "utilities.h"
|
||||
#include "angle.h"
|
||||
#include "vector2.h"
|
||||
#include "matrix2x2.h"
|
||||
|
@ -13,41 +13,41 @@
|
|||
typedef struct
|
||||
{
|
||||
const float cos, sin;
|
||||
} tangent_fp32_t;
|
||||
} bgc_tangent_fp32_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
const double cos, sin;
|
||||
} tangent_fp64_t;
|
||||
} bgc_tangent_fp64_t;
|
||||
|
||||
// ================= Dark Twins ================= //
|
||||
|
||||
typedef struct {
|
||||
float cos, sin;
|
||||
} __BgFP32DarkTwinTangent;
|
||||
} _bgc_dark_twin_tangent_fp32_t;
|
||||
|
||||
typedef struct {
|
||||
double cos, sin;
|
||||
} __BgFP64DarkTwinTangent;
|
||||
} _bgc_dark_twin_tangent_fp64_t;
|
||||
|
||||
// ================= Constants ================== //
|
||||
|
||||
extern const tangent_fp32_t FP32_IDLE_TANGENT;
|
||||
extern const tangent_fp64_t FP64_IDLE_TANGENT;
|
||||
extern const bgc_tangent_fp32_t BGC_IDLE_TANGENT_FP32;
|
||||
extern const bgc_tangent_fp64_t BGC_IDLE_TANGENT_FP64;
|
||||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void tangent_reset_fp32(tangent_fp32_t* tangent)
|
||||
inline void bgc_tangent_reset_fp32(bgc_tangent_fp32_t* tangent)
|
||||
{
|
||||
__BgFP32DarkTwinTangent* twin = (__BgFP32DarkTwinTangent*)tangent;
|
||||
_bgc_dark_twin_tangent_fp32_t* twin = (_bgc_dark_twin_tangent_fp32_t*)tangent;
|
||||
|
||||
twin->cos = 1.0f;
|
||||
twin->sin = 0.0f;
|
||||
}
|
||||
|
||||
inline void tangent_reset_fp64(tangent_fp64_t* tangent)
|
||||
inline void bgc_tangent_reset_fp64(bgc_tangent_fp64_t* tangent)
|
||||
{
|
||||
__BgFP64DarkTwinTangent* twin = (__BgFP64DarkTwinTangent*)tangent;
|
||||
_bgc_dark_twin_tangent_fp64_t* twin = (_bgc_dark_twin_tangent_fp64_t*)tangent;
|
||||
|
||||
twin->cos = 1.0;
|
||||
twin->sin = 0.0;
|
||||
|
@ -55,20 +55,20 @@ inline void tangent_reset_fp64(tangent_fp64_t* tangent)
|
|||
|
||||
// ==================== Set ===================== //
|
||||
|
||||
inline void tangent_set_values_fp32(const float x1, const float x2, tangent_fp32_t* tangent)
|
||||
inline void bgc_tangent_set_values_fp32(const float x1, const float x2, bgc_tangent_fp32_t* tangent)
|
||||
{
|
||||
const float square_module = x1 * x1 + x2 * x2;
|
||||
|
||||
__BgFP32DarkTwinTangent* twin = (__BgFP32DarkTwinTangent*)tangent;
|
||||
_bgc_dark_twin_tangent_fp32_t* twin = (_bgc_dark_twin_tangent_fp32_t*)tangent;
|
||||
|
||||
twin->cos = x1;
|
||||
twin->sin = x2;
|
||||
|
||||
if (1.0f - FP32_TWO_EPSYLON <= square_module && square_module <= 1.0f + FP32_TWO_EPSYLON) {
|
||||
if (1.0f - BGC_TWO_EPSYLON_FP32 <= square_module && square_module <= 1.0f + BGC_TWO_EPSYLON_FP32) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (square_module <= FP32_SQUARE_EPSYLON) {
|
||||
if (square_module <= BGC_SQUARE_EPSYLON_FP32) {
|
||||
twin->cos = 1.0f;
|
||||
twin->sin = 0.0f;
|
||||
return;
|
||||
|
@ -80,20 +80,20 @@ inline void tangent_set_values_fp32(const float x1, const float x2, tangent_fp32
|
|||
twin->sin = x2 * multiplier;
|
||||
}
|
||||
|
||||
inline void tangent_set_values_fp64(const double x1, const double x2, tangent_fp64_t* tangent)
|
||||
inline void bgc_tangent_set_values_fp64(const double x1, const double x2, bgc_tangent_fp64_t* tangent)
|
||||
{
|
||||
const double square_module = x1 * x1 + x2 * x2;
|
||||
|
||||
__BgFP64DarkTwinTangent* twin = (__BgFP64DarkTwinTangent*)tangent;
|
||||
_bgc_dark_twin_tangent_fp64_t* twin = (_bgc_dark_twin_tangent_fp64_t*)tangent;
|
||||
|
||||
twin->cos = x1;
|
||||
twin->sin = x2;
|
||||
|
||||
if (1.0 - FP64_TWO_EPSYLON <= square_module && square_module <= 1.0 + FP64_TWO_EPSYLON) {
|
||||
if (1.0 - BGC_TWO_EPSYLON_FP64 <= square_module && square_module <= 1.0 + BGC_TWO_EPSYLON_FP64) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (square_module <= FP64_SQUARE_EPSYLON) {
|
||||
if (square_module <= BGC_SQUARE_EPSYLON_FP64) {
|
||||
twin->cos = 1.0;
|
||||
twin->sin = 0.0;
|
||||
return;
|
||||
|
@ -107,17 +107,17 @@ inline void tangent_set_values_fp64(const double x1, const double x2, tangent_fp
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void tangent_copy_fp32(const tangent_fp32_t* from, tangent_fp32_t* to)
|
||||
inline void bgc_tangent_copy_fp32(const bgc_tangent_fp32_t* from, bgc_tangent_fp32_t* to)
|
||||
{
|
||||
__BgFP32DarkTwinTangent* twin = (__BgFP32DarkTwinTangent*)to;
|
||||
_bgc_dark_twin_tangent_fp32_t* twin = (_bgc_dark_twin_tangent_fp32_t*)to;
|
||||
|
||||
twin->cos = from->cos;
|
||||
twin->sin = from->sin;
|
||||
}
|
||||
|
||||
inline void tangent_copy_fp64(const tangent_fp64_t* from, tangent_fp64_t* to)
|
||||
inline void bgc_tangent_copy_fp64(const bgc_tangent_fp64_t* from, bgc_tangent_fp64_t* to)
|
||||
{
|
||||
__BgFP64DarkTwinTangent* twin = (__BgFP64DarkTwinTangent*)to;
|
||||
_bgc_dark_twin_tangent_fp64_t* twin = (_bgc_dark_twin_tangent_fp64_t*)to;
|
||||
|
||||
twin->cos = from->cos;
|
||||
twin->sin = from->sin;
|
||||
|
@ -125,33 +125,33 @@ inline void tangent_copy_fp64(const tangent_fp64_t* from, tangent_fp64_t* to)
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void tangent_swap_fp32(tangent_fp32_t* tangent1, tangent_fp32_t* tangent2)
|
||||
inline void bgc_tangent_swap_fp32(bgc_tangent_fp32_t* tangent1, bgc_tangent_fp32_t* tangent2)
|
||||
{
|
||||
const float cos = tangent1->cos;
|
||||
const float sin = tangent1->sin;
|
||||
|
||||
__BgFP32DarkTwinTangent* twin1 = (__BgFP32DarkTwinTangent*)tangent1;
|
||||
_bgc_dark_twin_tangent_fp32_t* twin1 = (_bgc_dark_twin_tangent_fp32_t*)tangent1;
|
||||
|
||||
twin1->cos = tangent2->cos;
|
||||
twin1->sin = tangent2->sin;
|
||||
|
||||
__BgFP32DarkTwinTangent* twin2 = (__BgFP32DarkTwinTangent*)tangent2;
|
||||
_bgc_dark_twin_tangent_fp32_t* twin2 = (_bgc_dark_twin_tangent_fp32_t*)tangent2;
|
||||
|
||||
twin2->cos = cos;
|
||||
twin2->sin = sin;
|
||||
}
|
||||
|
||||
inline void tangent_swap_fp64(tangent_fp64_t* tangent1, tangent_fp64_t* tangent2)
|
||||
inline void bgc_tangent_swap_fp64(bgc_tangent_fp64_t* tangent1, bgc_tangent_fp64_t* tangent2)
|
||||
{
|
||||
const double cos = tangent1->cos;
|
||||
const double sin = tangent1->sin;
|
||||
|
||||
__BgFP64DarkTwinTangent* twin1 = (__BgFP64DarkTwinTangent*)tangent1;
|
||||
_bgc_dark_twin_tangent_fp64_t* twin1 = (_bgc_dark_twin_tangent_fp64_t*)tangent1;
|
||||
|
||||
twin1->cos = tangent2->cos;
|
||||
twin1->sin = tangent2->sin;
|
||||
|
||||
__BgFP64DarkTwinTangent* twin2 = (__BgFP64DarkTwinTangent*)tangent2;
|
||||
_bgc_dark_twin_tangent_fp64_t* twin2 = (_bgc_dark_twin_tangent_fp64_t*)tangent2;
|
||||
|
||||
twin2->cos = cos;
|
||||
twin2->sin = sin;
|
||||
|
@ -159,21 +159,21 @@ inline void tangent_swap_fp64(tangent_fp64_t* tangent1, tangent_fp64_t* tangent2
|
|||
|
||||
// ================== Set Turn ================== //
|
||||
|
||||
inline void tangent_fp32_set_turn(const float angle, const angle_unit_t unit, tangent_fp32_t* tangent)
|
||||
inline void bgc_tangent_set_turn_fp32(const float angle, const bgc_angle_unit_t unit, bgc_tangent_fp32_t* tangent)
|
||||
{
|
||||
const float radians = fp32_angle_to_radians(angle, unit);
|
||||
const float radians = bgc_angle_to_radians_fp32(angle, unit);
|
||||
|
||||
__BgFP32DarkTwinTangent* twin = (__BgFP32DarkTwinTangent*)tangent;
|
||||
_bgc_dark_twin_tangent_fp32_t* twin = (_bgc_dark_twin_tangent_fp32_t*)tangent;
|
||||
|
||||
twin->cos = cosf(radians);
|
||||
twin->sin = sinf(radians);
|
||||
}
|
||||
|
||||
inline void tangent_fp64_set_turn(const double angle, const angle_unit_t unit, tangent_fp64_t* tangent)
|
||||
inline void bgc_tangent_set_turn_fp64(const double angle, const bgc_angle_unit_t unit, bgc_tangent_fp64_t* tangent)
|
||||
{
|
||||
const double radians = fp64_angle_to_radians(angle, unit);
|
||||
const double radians = bgc_angle_to_radians_fp64(angle, unit);
|
||||
|
||||
__BgFP64DarkTwinTangent* twin = (__BgFP64DarkTwinTangent*)tangent;
|
||||
_bgc_dark_twin_tangent_fp64_t* twin = (_bgc_dark_twin_tangent_fp64_t*)tangent;
|
||||
|
||||
twin->cos = cos(radians);
|
||||
twin->sin = sin(radians);
|
||||
|
@ -181,41 +181,41 @@ inline void tangent_fp64_set_turn(const double angle, const angle_unit_t unit, t
|
|||
|
||||
// ============= Copy to twin type ============== //
|
||||
|
||||
inline void tangent_convert_fp64_to_fp32(const tangent_fp64_t* from, tangent_fp32_t* to)
|
||||
inline void bgc_tangent_convert_fp64_to_fp32(const bgc_tangent_fp64_t* from, bgc_tangent_fp32_t* to)
|
||||
{
|
||||
tangent_set_values_fp32((float)from->cos, (float)from->sin, to);
|
||||
bgc_tangent_set_values_fp32((float)from->cos, (float)from->sin, to);
|
||||
}
|
||||
|
||||
inline void tangent_convert_fp32_to_fp64(const tangent_fp32_t* from, tangent_fp64_t* to)
|
||||
inline void bgc_tangent_convert_fp32_to_fp64(const bgc_tangent_fp32_t* from, bgc_tangent_fp64_t* to)
|
||||
{
|
||||
tangent_set_values_fp64((double)from->cos, (double)from->sin, to);
|
||||
bgc_tangent_set_values_fp64((double)from->cos, (double)from->sin, to);
|
||||
}
|
||||
|
||||
// ================= Inversion ================== //
|
||||
|
||||
inline void tangent_invert_fp32(tangent_fp32_t* tangent)
|
||||
inline void bgc_tangent_invert_fp32(bgc_tangent_fp32_t* tangent)
|
||||
{
|
||||
((__BgFP32DarkTwinTangent*)tangent)->sin = -tangent->sin;
|
||||
((_bgc_dark_twin_tangent_fp32_t*)tangent)->sin = -tangent->sin;
|
||||
}
|
||||
|
||||
inline void tangent_invert_fp64(tangent_fp64_t* tangent)
|
||||
inline void bgc_tangent_invert_fp64(bgc_tangent_fp64_t* tangent)
|
||||
{
|
||||
((__BgFP64DarkTwinTangent*)tangent)->sin = -tangent->sin;
|
||||
((_bgc_dark_twin_tangent_fp64_t*)tangent)->sin = -tangent->sin;
|
||||
}
|
||||
|
||||
// ================ Set Inverted ================ //
|
||||
|
||||
inline void tangent_set_inverted_fp32(const tangent_fp32_t* tangent, tangent_fp32_t* result)
|
||||
inline void bgc_tangent_set_inverted_fp32(const bgc_tangent_fp32_t* tangent, bgc_tangent_fp32_t* result)
|
||||
{
|
||||
__BgFP32DarkTwinTangent* twin = (__BgFP32DarkTwinTangent*)result;
|
||||
_bgc_dark_twin_tangent_fp32_t* twin = (_bgc_dark_twin_tangent_fp32_t*)result;
|
||||
|
||||
twin->cos = tangent->cos;
|
||||
twin->sin = -tangent->sin;
|
||||
}
|
||||
|
||||
inline void tangent_set_inverted_fp64(const tangent_fp64_t* tangent, tangent_fp64_t* result)
|
||||
inline void bgc_tangent_set_inverted_fp64(const bgc_tangent_fp64_t* tangent, bgc_tangent_fp64_t* result)
|
||||
{
|
||||
__BgFP64DarkTwinTangent* twin = (__BgFP64DarkTwinTangent*)result;
|
||||
_bgc_dark_twin_tangent_fp64_t* twin = (_bgc_dark_twin_tangent_fp64_t*)result;
|
||||
|
||||
twin->cos = tangent->cos;
|
||||
twin->sin = -tangent->sin;
|
||||
|
@ -223,7 +223,7 @@ inline void tangent_set_inverted_fp64(const tangent_fp64_t* tangent, tangent_fp6
|
|||
|
||||
// ============== Rotation Matrix =============== //
|
||||
|
||||
inline void tangent_fp32_make_rotation_matrix(const tangent_fp32_t* tangent, matrix2x2_fp32_t* matrix)
|
||||
inline void bgc_tangent_make_rotation_matrix_fp32(const bgc_tangent_fp32_t* tangent, bgc_matrix2x2_fp32_t* matrix)
|
||||
{
|
||||
matrix->r1c1 = tangent->cos;
|
||||
matrix->r1c2 = -tangent->sin;
|
||||
|
@ -231,7 +231,7 @@ inline void tangent_fp32_make_rotation_matrix(const tangent_fp32_t* tangent, mat
|
|||
matrix->r2c2 = tangent->cos;
|
||||
}
|
||||
|
||||
inline void tangent_fp64_make_rotation_matrix(const tangent_fp64_t* tangent, matrix2x2_fp64_t* matrix)
|
||||
inline void bgc_tangent_make_rotation_matrix_fp64(const bgc_tangent_fp64_t* tangent, bgc_matrix2x2_fp64_t* matrix)
|
||||
{
|
||||
matrix->r1c1 = tangent->cos;
|
||||
matrix->r1c2 = -tangent->sin;
|
||||
|
@ -241,7 +241,7 @@ inline void tangent_fp64_make_rotation_matrix(const tangent_fp64_t* tangent, mat
|
|||
|
||||
// ============== Reverse Matrix ================ //
|
||||
|
||||
inline void tangent_fp32_make_reverse_matrix(const tangent_fp32_t* tangent, matrix2x2_fp32_t* matrix)
|
||||
inline void bgc_tangent_make_reverse_matrix_fp32(const bgc_tangent_fp32_t* tangent, bgc_matrix2x2_fp32_t* matrix)
|
||||
{
|
||||
matrix->r1c1 = tangent->cos;
|
||||
matrix->r1c2 = tangent->sin;
|
||||
|
@ -249,7 +249,7 @@ inline void tangent_fp32_make_reverse_matrix(const tangent_fp32_t* tangent, matr
|
|||
matrix->r2c2 = tangent->cos;
|
||||
}
|
||||
|
||||
inline void tangent_fp64_make_reverse_matrix(const tangent_fp64_t* tangent, matrix2x2_fp64_t* matrix)
|
||||
inline void bgc_tangent_make_reverse_matrix_fp64(const bgc_tangent_fp64_t* tangent, bgc_matrix2x2_fp64_t* matrix)
|
||||
{
|
||||
matrix->r1c1 = tangent->cos;
|
||||
matrix->r1c2 = tangent->sin;
|
||||
|
@ -259,62 +259,62 @@ inline void tangent_fp64_make_reverse_matrix(const tangent_fp64_t* tangent, matr
|
|||
|
||||
// =================== Angle =================== //
|
||||
|
||||
inline float tangent_get_angle_fp32(const tangent_fp32_t* tangent, const angle_unit_t unit)
|
||||
inline float bgc_tangent_get_angle_fp32(const bgc_tangent_fp32_t* tangent, const bgc_angle_unit_t unit)
|
||||
{
|
||||
if (tangent->cos >= 1.0f - FP32_TWO_EPSYLON) {
|
||||
if (tangent->cos >= 1.0f - BGC_TWO_EPSYLON_FP32) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
if (tangent->cos <= -1.0f + FP32_TWO_EPSYLON) {
|
||||
return fp32_angle_get_half_circle(unit);
|
||||
if (tangent->cos <= -1.0f + BGC_TWO_EPSYLON_FP32) {
|
||||
return bgc_angle_get_half_circle_fp32(unit);
|
||||
}
|
||||
|
||||
if (tangent->sin >= 1.0f - FP32_TWO_EPSYLON) {
|
||||
return fp32_angle_get_quater_circle(unit);
|
||||
if (tangent->sin >= 1.0f - BGC_TWO_EPSYLON_FP32) {
|
||||
return bgc_angle_get_quater_circle_fp32(unit);
|
||||
}
|
||||
|
||||
if (tangent->sin <= -1.0f + FP32_TWO_EPSYLON) {
|
||||
return 0.75f * fp32_angle_get_full_circle(unit);
|
||||
if (tangent->sin <= -1.0f + BGC_TWO_EPSYLON_FP32) {
|
||||
return 0.75f * bgc_angle_get_full_circle_fp32(unit);
|
||||
}
|
||||
|
||||
return fp32_radians_to_units(atan2f(tangent->cos, tangent->sin), unit);
|
||||
return bgc_radians_to_units_fp32(atan2f(tangent->cos, tangent->sin), unit);
|
||||
}
|
||||
|
||||
inline double tangent_get_angle_fp64(const tangent_fp64_t* tangent, const angle_unit_t unit)
|
||||
inline double bgc_tangent_get_angle_fp64(const bgc_tangent_fp64_t* tangent, const bgc_angle_unit_t unit)
|
||||
{
|
||||
if (tangent->cos >= 1.0 - FP64_TWO_EPSYLON) {
|
||||
if (tangent->cos >= 1.0 - BGC_TWO_EPSYLON_FP64) {
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
if (tangent->cos <= -1.0 + FP64_TWO_EPSYLON) {
|
||||
return fp64_angle_get_half_circle(unit);
|
||||
if (tangent->cos <= -1.0 + BGC_TWO_EPSYLON_FP64) {
|
||||
return bgc_angle_get_half_circle_fp64(unit);
|
||||
}
|
||||
|
||||
if (tangent->sin >= 1.0 - FP64_TWO_EPSYLON) {
|
||||
return fp64_angle_get_quater_circle(unit);
|
||||
if (tangent->sin >= 1.0 - BGC_TWO_EPSYLON_FP64) {
|
||||
return bgc_angle_get_quater_circle_fp64(unit);
|
||||
}
|
||||
|
||||
if (tangent->sin <= -1.0 + FP64_TWO_EPSYLON) {
|
||||
return 0.75 * fp64_angle_get_full_circle(unit);
|
||||
if (tangent->sin <= -1.0 + BGC_TWO_EPSYLON_FP64) {
|
||||
return 0.75 * bgc_angle_get_full_circle_fp64(unit);
|
||||
}
|
||||
|
||||
return fp64_radians_to_units(atan2(tangent->cos, tangent->sin), unit);
|
||||
return bgc_radians_to_units_fp64(atan2(tangent->cos, tangent->sin), unit);
|
||||
}
|
||||
|
||||
// ================ Combination ================= //
|
||||
|
||||
inline void tangent_fp32_combine(const tangent_fp32_t* tangent1, const tangent_fp32_t* tangent2, tangent_fp32_t* result)
|
||||
inline void bgc_tangent_combine_fp32(const bgc_tangent_fp32_t* tangent1, const bgc_tangent_fp32_t* tangent2, bgc_tangent_fp32_t* result)
|
||||
{
|
||||
tangent_set_values_fp32(
|
||||
bgc_tangent_set_values_fp32(
|
||||
tangent1->cos * tangent2->cos - tangent1->sin * tangent2->sin,
|
||||
tangent1->cos * tangent2->sin + tangent1->sin * tangent2->cos,
|
||||
result
|
||||
);
|
||||
}
|
||||
|
||||
inline void tangent_fp64_combine(const tangent_fp64_t* tangent1, const tangent_fp64_t* tangent2, tangent_fp64_t* result)
|
||||
inline void bgc_tangent_combine_fp64(const bgc_tangent_fp64_t* tangent1, const bgc_tangent_fp64_t* tangent2, bgc_tangent_fp64_t* result)
|
||||
{
|
||||
tangent_set_values_fp64(
|
||||
bgc_tangent_set_values_fp64(
|
||||
tangent1->cos * tangent2->cos - tangent1->sin * tangent2->sin,
|
||||
tangent1->cos * tangent2->sin + tangent1->sin * tangent2->cos,
|
||||
result
|
||||
|
@ -323,7 +323,7 @@ inline void tangent_fp64_combine(const tangent_fp64_t* tangent1, const tangent_f
|
|||
|
||||
// ================ Turn Vector ================= //
|
||||
|
||||
inline void tangent_fp32_turn(const tangent_fp32_t* tangent, const vector2_fp32_t* vector, vector2_fp32_t* result)
|
||||
inline void bgc_tangent_turn_vector_fp32(const bgc_tangent_fp32_t* tangent, const bgc_vector2_fp32_t* vector, bgc_vector2_fp32_t* result)
|
||||
{
|
||||
const float x1 = tangent->cos * vector->x1 - tangent->sin * vector->x2;
|
||||
const float x2 = tangent->sin * vector->x1 + tangent->cos * vector->x2;
|
||||
|
@ -332,7 +332,7 @@ inline void tangent_fp32_turn(const tangent_fp32_t* tangent, const vector2_fp32_
|
|||
result->x2 = x2;
|
||||
}
|
||||
|
||||
inline void tangent_fp64_turn(const tangent_fp64_t* tangent, const vector2_fp64_t* vector, vector2_fp64_t* result)
|
||||
inline void bgc_tangent_turn_vector_fp64(const bgc_tangent_fp64_t* tangent, const bgc_vector2_fp64_t* vector, bgc_vector2_fp64_t* result)
|
||||
{
|
||||
const double x1 = tangent->cos * vector->x1 - tangent->sin * vector->x2;
|
||||
const double x2 = tangent->sin * vector->x1 + tangent->cos * vector->x2;
|
||||
|
@ -343,7 +343,7 @@ inline void tangent_fp64_turn(const tangent_fp64_t* tangent, const vector2_fp64_
|
|||
|
||||
// ============ Turn Vector Backward ============ //
|
||||
|
||||
inline void tangent_fp32_turn_back(const tangent_fp32_t* tangent, const vector2_fp32_t* vector, vector2_fp32_t* result)
|
||||
inline void bgc_tangent_turn_vector_back_fp32(const bgc_tangent_fp32_t* tangent, const bgc_vector2_fp32_t* vector, bgc_vector2_fp32_t* result)
|
||||
{
|
||||
const float x1 = tangent->sin * vector->x2 + tangent->cos * vector->x1;
|
||||
const float x2 = tangent->cos * vector->x2 - tangent->sin * vector->x1;
|
||||
|
@ -352,7 +352,7 @@ inline void tangent_fp32_turn_back(const tangent_fp32_t* tangent, const vector2_
|
|||
result->x2 = x2;
|
||||
}
|
||||
|
||||
inline void tangent_fp64_turn_back(const tangent_fp64_t* tangent, const vector2_fp64_t* vector, vector2_fp64_t* result)
|
||||
inline void bgc_tangent_turn_vector_back_fp64(const bgc_tangent_fp64_t* tangent, const bgc_vector2_fp64_t* vector, bgc_vector2_fp64_t* result)
|
||||
{
|
||||
const double x1 = tangent->sin * vector->x2 + tangent->cos * vector->x1;
|
||||
const double x2 = tangent->cos * vector->x2 - tangent->sin * vector->x1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue