Унификация названий
This commit is contained in:
parent
15b9e8a4a2
commit
08c1e6d148
20 changed files with 215 additions and 216 deletions
|
@ -81,10 +81,6 @@
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
<Unit filename="tests/quaternion/quaternion_set_values.h" />
|
<Unit filename="tests/quaternion/quaternion_set_values.h" />
|
||||||
<Unit filename="tests/quaternion/quaternion_square_modulus.c">
|
|
||||||
<Option compilerVar="CC" />
|
|
||||||
</Unit>
|
|
||||||
<Unit filename="tests/quaternion/quaternion_square_modulus.h" />
|
|
||||||
<Unit filename="tests/quaternion/quaternion_swap.c">
|
<Unit filename="tests/quaternion/quaternion_swap.c">
|
||||||
<Option compilerVar="CC" />
|
<Option compilerVar="CC" />
|
||||||
</Unit>
|
</Unit>
|
||||||
|
|
|
@ -45,11 +45,11 @@ extern inline void bgc_matrix2x2_set_column1_fp64(const double r1, const double
|
||||||
extern inline void bgc_matrix2x2_set_column2_fp32(const float r1, const float r2, BgcMatrix2x2FP32* matrix);
|
extern inline void bgc_matrix2x2_set_column2_fp32(const float r1, const float r2, BgcMatrix2x2FP32* matrix);
|
||||||
extern inline void bgc_matrix2x2_set_column2_fp64(const double r1, const double r2, BgcMatrix2x2FP64* matrix);
|
extern inline void bgc_matrix2x2_set_column2_fp64(const double r1, const double r2, BgcMatrix2x2FP64* matrix);
|
||||||
|
|
||||||
extern inline int bgc_matrix2x2_make_inverted_fp32(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP32* to);
|
extern inline int bgc_matrix2x2_get_inverted_fp32(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP32* to);
|
||||||
extern inline int bgc_matrix2x2_make_inverted_fp64(const BgcMatrix2x2FP64* from, BgcMatrix2x2FP64* to);
|
extern inline int bgc_matrix2x2_get_inverted_fp64(const BgcMatrix2x2FP64* from, BgcMatrix2x2FP64* to);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x2_make_transposed_fp32(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP32* to);
|
extern inline void bgc_matrix2x2_get_transposed_fp32(const BgcMatrix2x2FP32* from, BgcMatrix2x2FP32* to);
|
||||||
extern inline void bgc_matrix2x2_make_transposed_fp64(const BgcMatrix2x2FP64* from, BgcMatrix2x2FP64* to);
|
extern inline void bgc_matrix2x2_get_transposed_fp64(const BgcMatrix2x2FP64* from, BgcMatrix2x2FP64* to);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x2_add_fp32(const BgcMatrix2x2FP32* matrix1, const BgcMatrix2x2FP32* matrix2, BgcMatrix2x2FP32* sum);
|
extern inline void bgc_matrix2x2_add_fp32(const BgcMatrix2x2FP32* matrix1, const BgcMatrix2x2FP32* matrix2, BgcMatrix2x2FP32* sum);
|
||||||
extern inline void bgc_matrix2x2_add_fp64(const BgcMatrix2x2FP64* matrix1, const BgcMatrix2x2FP64* matrix2, BgcMatrix2x2FP64* sum);
|
extern inline void bgc_matrix2x2_add_fp64(const BgcMatrix2x2FP64* matrix1, const BgcMatrix2x2FP64* matrix2, BgcMatrix2x2FP64* sum);
|
||||||
|
@ -69,9 +69,9 @@ extern inline void bgc_matrix2x2_multiply_fp64(const BgcMatrix2x2FP64* multiplic
|
||||||
extern inline void bgc_matrix2x2_divide_fp32(const BgcMatrix2x2FP32* dividend, const float divisor, BgcMatrix2x2FP32* quotient);
|
extern inline void bgc_matrix2x2_divide_fp32(const BgcMatrix2x2FP32* dividend, const float divisor, BgcMatrix2x2FP32* quotient);
|
||||||
extern inline void bgc_matrix2x2_divide_fp64(const BgcMatrix2x2FP64* dividend, const double divisor, BgcMatrix2x2FP64* quotient);
|
extern inline void bgc_matrix2x2_divide_fp64(const BgcMatrix2x2FP64* dividend, const double divisor, BgcMatrix2x2FP64* quotient);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x2_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix2x2FP32* matrix, BgcVector2FP32* product);
|
extern inline void bgc_matrix2x2_get_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix2x2FP32* matrix, BgcVector2FP32* product);
|
||||||
extern inline void bgc_matrix2x2_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix2x2FP64* matrix, BgcVector2FP64* product);
|
extern inline void bgc_matrix2x2_get_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix2x2FP64* matrix, BgcVector2FP64* product);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x2_right_product_fp32(const BgcMatrix2x2FP32* matrix, const BgcVector2FP32* vector, BgcVector2FP32* product);
|
extern inline void bgc_matrix2x2_get_right_product_fp32(const BgcMatrix2x2FP32* matrix, const BgcVector2FP32* vector, BgcVector2FP32* product);
|
||||||
extern inline void bgc_matrix2x2_right_product_fp64(const BgcMatrix2x2FP64* matrix, const BgcVector2FP64* vector, BgcVector2FP64* product);
|
extern inline void bgc_matrix2x2_get_right_product_fp64(const BgcMatrix2x2FP64* matrix, const BgcVector2FP64* vector, BgcVector2FP64* product);
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ inline void bgc_matrix2x2_set_to_identity_fp64(BgcMatrix2x2FP64* matrix)
|
||||||
matrix->r2c2 = 1.0;
|
matrix->r2c2 = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================ Make Diagonal =============== //
|
// ================ Set Diagonal ================ //
|
||||||
|
|
||||||
inline void bgc_matrix2x2_set_to_diagonal_fp32(const float d1, const float d2, BgcMatrix2x2FP32* matrix)
|
inline void bgc_matrix2x2_set_to_diagonal_fp32(const float d1, const float d2, BgcMatrix2x2FP32* matrix)
|
||||||
{
|
{
|
||||||
|
@ -317,9 +317,9 @@ inline void bgc_matrix2x2_set_column2_fp64(const double r1, const double r2, Bgc
|
||||||
matrix->r2c2 = r2;
|
matrix->r2c2 = r2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Make Inverted ================ //
|
// ================ Get Inverted ================ //
|
||||||
|
|
||||||
inline int bgc_matrix2x2_make_inverted_fp32(const BgcMatrix2x2FP32* matrix, BgcMatrix2x2FP32* inverted)
|
inline int bgc_matrix2x2_get_inverted_fp32(const BgcMatrix2x2FP32* matrix, BgcMatrix2x2FP32* inverted)
|
||||||
{
|
{
|
||||||
const float determinant = bgc_matrix2x2_get_determinant_fp32(matrix);
|
const float determinant = bgc_matrix2x2_get_determinant_fp32(matrix);
|
||||||
|
|
||||||
|
@ -344,7 +344,7 @@ inline int bgc_matrix2x2_make_inverted_fp32(const BgcMatrix2x2FP32* matrix, BgcM
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int bgc_matrix2x2_make_inverted_fp64(const BgcMatrix2x2FP64* matrix, BgcMatrix2x2FP64* inverted)
|
inline int bgc_matrix2x2_get_inverted_fp64(const BgcMatrix2x2FP64* matrix, BgcMatrix2x2FP64* inverted)
|
||||||
{
|
{
|
||||||
const double determinant = bgc_matrix2x2_get_determinant_fp64(matrix);
|
const double determinant = bgc_matrix2x2_get_determinant_fp64(matrix);
|
||||||
|
|
||||||
|
@ -369,9 +369,9 @@ inline int bgc_matrix2x2_make_inverted_fp64(const BgcMatrix2x2FP64* matrix, BgcM
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============== Make Transposed =============== //
|
// =============== Get Transposed =============== //
|
||||||
|
|
||||||
inline void bgc_matrix2x2_make_transposed_fp32(const BgcMatrix2x2FP32* matrix, BgcMatrix2x2FP32* transposed)
|
inline void bgc_matrix2x2_get_transposed_fp32(const BgcMatrix2x2FP32* matrix, BgcMatrix2x2FP32* transposed)
|
||||||
{
|
{
|
||||||
float tmp = matrix->r1c2;
|
float tmp = matrix->r1c2;
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ inline void bgc_matrix2x2_make_transposed_fp32(const BgcMatrix2x2FP32* matrix, B
|
||||||
transposed->r2c2 = matrix->r2c2;
|
transposed->r2c2 = matrix->r2c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix2x2_make_transposed_fp64(const BgcMatrix2x2FP64* matrix, BgcMatrix2x2FP64* transposed)
|
inline void bgc_matrix2x2_get_transposed_fp64(const BgcMatrix2x2FP64* matrix, BgcMatrix2x2FP64* transposed)
|
||||||
{
|
{
|
||||||
double tmp = matrix->r1c2;
|
double tmp = matrix->r1c2;
|
||||||
|
|
||||||
|
@ -507,7 +507,7 @@ inline void bgc_matrix2x2_divide_fp64(const BgcMatrix2x2FP64* dividend, const do
|
||||||
|
|
||||||
// ============ Left Vector Product ============= //
|
// ============ Left Vector Product ============= //
|
||||||
|
|
||||||
inline void bgc_matrix2x2_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix2x2FP32* matrix, BgcVector2FP32* product)
|
inline void bgc_matrix2x2_get_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix2x2FP32* matrix, BgcVector2FP32* product)
|
||||||
{
|
{
|
||||||
const float x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
const float x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||||
const float x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
const float x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||||
|
@ -516,7 +516,7 @@ inline void bgc_matrix2x2_left_product_fp32(const BgcVector2FP32* vector, const
|
||||||
product->x2 = x2;
|
product->x2 = x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix2x2_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix2x2FP64* matrix, BgcVector2FP64* product)
|
inline void bgc_matrix2x2_get_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix2x2FP64* matrix, BgcVector2FP64* product)
|
||||||
{
|
{
|
||||||
const double x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
const double x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||||
const double x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
const double x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||||
|
@ -527,7 +527,7 @@ inline void bgc_matrix2x2_left_product_fp64(const BgcVector2FP64* vector, const
|
||||||
|
|
||||||
// ============ Right Vector Product ============ //
|
// ============ Right Vector Product ============ //
|
||||||
|
|
||||||
inline void bgc_matrix2x2_right_product_fp32(const BgcMatrix2x2FP32* matrix, const BgcVector2FP32* vector, BgcVector2FP32* product)
|
inline void bgc_matrix2x2_get_right_product_fp32(const BgcMatrix2x2FP32* matrix, const BgcVector2FP32* vector, BgcVector2FP32* product)
|
||||||
{
|
{
|
||||||
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||||
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||||
|
@ -536,7 +536,7 @@ inline void bgc_matrix2x2_right_product_fp32(const BgcMatrix2x2FP32* matrix, con
|
||||||
product->x2 = x2;
|
product->x2 = x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix2x2_right_product_fp64(const BgcMatrix2x2FP64* matrix, const BgcVector2FP64* vector, BgcVector2FP64* product)
|
inline void bgc_matrix2x2_get_right_product_fp64(const BgcMatrix2x2FP64* matrix, const BgcVector2FP64* vector, BgcVector2FP64* product)
|
||||||
{
|
{
|
||||||
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||||
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||||
|
|
|
@ -27,8 +27,8 @@ extern inline void bgc_matrix2x3_set_column1_fp64(const double r1, const double
|
||||||
extern inline void bgc_matrix2x3_set_column2_fp32(const float r1, const float r2, const float r3, BgcMatrix2x3FP32* matrix);
|
extern inline void bgc_matrix2x3_set_column2_fp32(const float r1, const float r2, const float r3, BgcMatrix2x3FP32* matrix);
|
||||||
extern inline void bgc_matrix2x3_set_column2_fp64(const double r1, const double r2, const double r3, BgcMatrix2x3FP64* matrix);
|
extern inline void bgc_matrix2x3_set_column2_fp64(const double r1, const double r2, const double r3, BgcMatrix2x3FP64* matrix);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x3_make_transposed_fp32(const BgcMatrix3x2FP32* from, BgcMatrix2x3FP32* to);
|
extern inline void bgc_matrix2x3_get_transposed_fp32(const BgcMatrix3x2FP32* from, BgcMatrix2x3FP32* to);
|
||||||
extern inline void bgc_matrix2x3_make_transposed_fp64(const BgcMatrix3x2FP64* from, BgcMatrix2x3FP64* to);
|
extern inline void bgc_matrix2x3_get_transposed_fp64(const BgcMatrix3x2FP64* from, BgcMatrix2x3FP64* to);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x3_add_fp32(const BgcMatrix2x3FP32* matrix1, const BgcMatrix2x3FP32* matrix2, BgcMatrix2x3FP32* sum);
|
extern inline void bgc_matrix2x3_add_fp32(const BgcMatrix2x3FP32* matrix1, const BgcMatrix2x3FP32* matrix2, BgcMatrix2x3FP32* sum);
|
||||||
extern inline void bgc_matrix2x3_add_fp64(const BgcMatrix2x3FP64* matrix1, const BgcMatrix2x3FP64* matrix2, BgcMatrix2x3FP64* sum);
|
extern inline void bgc_matrix2x3_add_fp64(const BgcMatrix2x3FP64* matrix1, const BgcMatrix2x3FP64* matrix2, BgcMatrix2x3FP64* sum);
|
||||||
|
@ -48,8 +48,8 @@ extern inline void bgc_matrix2x3_multiply_fp64(const BgcMatrix2x3FP64* multiplic
|
||||||
extern inline void bgc_matrix2x3_divide_fp32(const BgcMatrix2x3FP32* dividend, const float divisor, BgcMatrix2x3FP32* quotient);
|
extern inline void bgc_matrix2x3_divide_fp32(const BgcMatrix2x3FP32* dividend, const float divisor, BgcMatrix2x3FP32* quotient);
|
||||||
extern inline void bgc_matrix2x3_divide_fp64(const BgcMatrix2x3FP64* dividend, const double divisor, BgcMatrix2x3FP64* quotient);
|
extern inline void bgc_matrix2x3_divide_fp64(const BgcMatrix2x3FP64* dividend, const double divisor, BgcMatrix2x3FP64* quotient);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x3_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix2x3FP32* matrix, BgcVector2FP32* result);
|
extern inline void bgc_matrix2x3_get_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix2x3FP32* matrix, BgcVector2FP32* result);
|
||||||
extern inline void bgc_matrix2x3_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix2x3FP64* matrix, BgcVector2FP64* result);
|
extern inline void bgc_matrix2x3_get_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix2x3FP64* matrix, BgcVector2FP64* result);
|
||||||
|
|
||||||
extern inline void bgc_matrix2x3_right_product_fp32(const BgcMatrix2x3FP32* matrix, const BgcVector2FP32* vector, BgcVector3FP32* result);
|
extern inline void bgc_matrix2x3_get_right_product_fp32(const BgcMatrix2x3FP32* matrix, const BgcVector2FP32* vector, BgcVector3FP32* result);
|
||||||
extern inline void bgc_matrix2x3_right_product_fp64(const BgcMatrix2x3FP64* matrix, const BgcVector2FP64* vector, BgcVector3FP64* result);
|
extern inline void bgc_matrix2x3_get_right_product_fp64(const BgcMatrix2x3FP64* matrix, const BgcVector2FP64* vector, BgcVector3FP64* result);
|
||||||
|
|
|
@ -219,9 +219,9 @@ inline void bgc_matrix2x3_set_column2_fp64(const double r1, const double r2, con
|
||||||
matrix->r3c2 = r3;
|
matrix->r3c2 = r3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============== Make transposed =============== //
|
// =============== Get transposed =============== //
|
||||||
|
|
||||||
inline void bgc_matrix2x3_make_transposed_fp32(const BgcMatrix3x2FP32* matrix, BgcMatrix2x3FP32* transposed)
|
inline void bgc_matrix2x3_get_transposed_fp32(const BgcMatrix3x2FP32* matrix, BgcMatrix2x3FP32* transposed)
|
||||||
{
|
{
|
||||||
transposed->r1c1 = matrix->r1c1;
|
transposed->r1c1 = matrix->r1c1;
|
||||||
transposed->r1c2 = matrix->r2c1;
|
transposed->r1c2 = matrix->r2c1;
|
||||||
|
@ -233,7 +233,7 @@ inline void bgc_matrix2x3_make_transposed_fp32(const BgcMatrix3x2FP32* matrix, B
|
||||||
transposed->r3c2 = matrix->r2c3;
|
transposed->r3c2 = matrix->r2c3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix2x3_make_transposed_fp64(const BgcMatrix3x2FP64* matrix, BgcMatrix2x3FP64* transposed)
|
inline void bgc_matrix2x3_get_transposed_fp64(const BgcMatrix3x2FP64* matrix, BgcMatrix2x3FP64* transposed)
|
||||||
{
|
{
|
||||||
transposed->r1c1 = matrix->r1c1;
|
transposed->r1c1 = matrix->r1c1;
|
||||||
transposed->r1c2 = matrix->r2c1;
|
transposed->r1c2 = matrix->r2c1;
|
||||||
|
@ -390,13 +390,13 @@ inline void bgc_matrix2x3_divide_fp64(const BgcMatrix2x3FP64* dividend, const do
|
||||||
|
|
||||||
// ============ Left Vector Product ============= //
|
// ============ Left Vector Product ============= //
|
||||||
|
|
||||||
inline void bgc_matrix2x3_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix2x3FP32* matrix, BgcVector2FP32* result)
|
inline void bgc_matrix2x3_get_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix2x3FP32* matrix, BgcVector2FP32* result)
|
||||||
{
|
{
|
||||||
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
||||||
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix2x3_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix2x3FP64* matrix, BgcVector2FP64* result)
|
inline void bgc_matrix2x3_get_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix2x3FP64* matrix, BgcVector2FP64* result)
|
||||||
{
|
{
|
||||||
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
||||||
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
||||||
|
@ -404,14 +404,14 @@ inline void bgc_matrix2x3_left_product_fp64(const BgcVector3FP64* vector, const
|
||||||
|
|
||||||
// ============ Right Vector Product ============ //
|
// ============ Right Vector Product ============ //
|
||||||
|
|
||||||
inline void bgc_matrix2x3_right_product_fp32(const BgcMatrix2x3FP32* matrix, const BgcVector2FP32* vector, BgcVector3FP32* result)
|
inline void bgc_matrix2x3_get_right_product_fp32(const BgcMatrix2x3FP32* matrix, const BgcVector2FP32* vector, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||||
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||||
result->x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2;
|
result->x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix2x3_right_product_fp64(const BgcMatrix2x3FP64* matrix, const BgcVector2FP64* vector, BgcVector3FP64* result)
|
inline void bgc_matrix2x3_get_right_product_fp64(const BgcMatrix2x3FP64* matrix, const BgcVector2FP64* vector, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||||
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||||
|
|
|
@ -27,8 +27,8 @@ extern inline void bgc_matrix3x2_set_column2_fp64(const double r1, const double
|
||||||
extern inline void bgc_matrix3x2_set_column3_fp32(const float r1, const float r2, BgcMatrix3x2FP32* matrix);
|
extern inline void bgc_matrix3x2_set_column3_fp32(const float r1, const float r2, BgcMatrix3x2FP32* matrix);
|
||||||
extern inline void bgc_matrix3x2_set_column3_fp64(const double r1, const double r2, BgcMatrix3x2FP64* matrix);
|
extern inline void bgc_matrix3x2_set_column3_fp64(const double r1, const double r2, BgcMatrix3x2FP64* matrix);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x2_make_transposed_fp32(const BgcMatrix2x3FP32* from, BgcMatrix3x2FP32* to);
|
extern inline void bgc_matrix3x2_get_transposed_fp32(const BgcMatrix2x3FP32* from, BgcMatrix3x2FP32* to);
|
||||||
extern inline void bgc_matrix3x2_make_transposed_fp64(const BgcMatrix2x3FP64* from, BgcMatrix3x2FP64* to);
|
extern inline void bgc_matrix3x2_get_transposed_fp64(const BgcMatrix2x3FP64* from, BgcMatrix3x2FP64* to);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x2_add_fp32(const BgcMatrix3x2FP32* matrix1, const BgcMatrix3x2FP32* matrix2, BgcMatrix3x2FP32* sum);
|
extern inline void bgc_matrix3x2_add_fp32(const BgcMatrix3x2FP32* matrix1, const BgcMatrix3x2FP32* matrix2, BgcMatrix3x2FP32* sum);
|
||||||
extern inline void bgc_matrix3x2_add_fp64(const BgcMatrix3x2FP64* matrix1, const BgcMatrix3x2FP64* matrix2, BgcMatrix3x2FP64* sum);
|
extern inline void bgc_matrix3x2_add_fp64(const BgcMatrix3x2FP64* matrix1, const BgcMatrix3x2FP64* matrix2, BgcMatrix3x2FP64* sum);
|
||||||
|
@ -48,8 +48,8 @@ extern inline void bgc_matrix3x2_multiply_fp64(const BgcMatrix3x2FP64* multiplic
|
||||||
extern inline void bgc_matrix3x2_divide_fp32(const BgcMatrix3x2FP32* dividend, const float divisor, BgcMatrix3x2FP32* quotient);
|
extern inline void bgc_matrix3x2_divide_fp32(const BgcMatrix3x2FP32* dividend, const float divisor, BgcMatrix3x2FP32* quotient);
|
||||||
extern inline void bgc_matrix3x2_divide_fp64(const BgcMatrix3x2FP64* dividend, const double divisor, BgcMatrix3x2FP64* quotient);
|
extern inline void bgc_matrix3x2_divide_fp64(const BgcMatrix3x2FP64* dividend, const double divisor, BgcMatrix3x2FP64* quotient);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x2_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix3x2FP32* matrix, BgcVector3FP32* result);
|
extern inline void bgc_matrix3x2_get_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix3x2FP32* matrix, BgcVector3FP32* result);
|
||||||
extern inline void bgc_matrix3x2_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix3x2FP64* matrix, BgcVector3FP64* result);
|
extern inline void bgc_matrix3x2_get_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix3x2FP64* matrix, BgcVector3FP64* result);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x2_right_product_fp32(const BgcMatrix3x2FP32* matrix, const BgcVector3FP32* vector, BgcVector2FP32* result);
|
extern inline void bgc_matrix3x2_get_right_product_fp32(const BgcMatrix3x2FP32* matrix, const BgcVector3FP32* vector, BgcVector2FP32* result);
|
||||||
extern inline void bgc_matrix3x2_right_product_fp64(const BgcMatrix3x2FP64* matrix, const BgcVector3FP64* vector, BgcVector2FP64* result);
|
extern inline void bgc_matrix3x2_get_right_product_fp64(const BgcMatrix3x2FP64* matrix, const BgcVector3FP64* vector, BgcVector2FP64* result);
|
||||||
|
|
|
@ -207,9 +207,9 @@ inline void bgc_matrix3x2_set_column3_fp64(const double r1, const double r2, Bgc
|
||||||
matrix->r2c3 = r2;
|
matrix->r2c3 = r2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============== Make transposed =============== //
|
// =============== Get transposed =============== //
|
||||||
|
|
||||||
inline void bgc_matrix3x2_make_transposed_fp32(const BgcMatrix2x3FP32* from, BgcMatrix3x2FP32* to)
|
inline void bgc_matrix3x2_get_transposed_fp32(const BgcMatrix2x3FP32* from, BgcMatrix3x2FP32* to)
|
||||||
{
|
{
|
||||||
to->r1c1 = from->r1c1;
|
to->r1c1 = from->r1c1;
|
||||||
to->r1c2 = from->r2c1;
|
to->r1c2 = from->r2c1;
|
||||||
|
@ -220,7 +220,7 @@ inline void bgc_matrix3x2_make_transposed_fp32(const BgcMatrix2x3FP32* from, Bgc
|
||||||
to->r2c3 = from->r3c2;
|
to->r2c3 = from->r3c2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix3x2_make_transposed_fp64(const BgcMatrix2x3FP64* from, BgcMatrix3x2FP64* to)
|
inline void bgc_matrix3x2_get_transposed_fp64(const BgcMatrix2x3FP64* from, BgcMatrix3x2FP64* to)
|
||||||
{
|
{
|
||||||
to->r1c1 = from->r1c1;
|
to->r1c1 = from->r1c1;
|
||||||
to->r1c2 = from->r2c1;
|
to->r1c2 = from->r2c1;
|
||||||
|
@ -365,14 +365,14 @@ inline void bgc_matrix3x2_divide_fp64(const BgcMatrix3x2FP64* dividend, const do
|
||||||
|
|
||||||
// ============ Left Vector Product ============= //
|
// ============ Left Vector Product ============= //
|
||||||
|
|
||||||
inline void bgc_matrix3x2_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix3x2FP32* matrix, BgcVector3FP32* result)
|
inline void bgc_matrix3x2_get_left_product_fp32(const BgcVector2FP32* vector, const BgcMatrix3x2FP32* matrix, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||||
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||||
result->x3 = vector->x1 * matrix->r1c3 + vector->x2 * matrix->r2c3;
|
result->x3 = vector->x1 * matrix->r1c3 + vector->x2 * matrix->r2c3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix3x2_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix3x2FP64* matrix, BgcVector3FP64* result)
|
inline void bgc_matrix3x2_get_left_product_fp64(const BgcVector2FP64* vector, const BgcMatrix3x2FP64* matrix, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
result->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||||
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
result->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||||
|
@ -381,13 +381,13 @@ inline void bgc_matrix3x2_left_product_fp64(const BgcVector2FP64* vector, const
|
||||||
|
|
||||||
// ============ Right Vector Product ============ //
|
// ============ Right Vector Product ============ //
|
||||||
|
|
||||||
inline void bgc_matrix3x2_right_product_fp32(const BgcMatrix3x2FP32* matrix, const BgcVector3FP32* vector, BgcVector2FP32* result)
|
inline void bgc_matrix3x2_get_right_product_fp32(const BgcMatrix3x2FP32* matrix, const BgcVector3FP32* vector, BgcVector2FP32* result)
|
||||||
{
|
{
|
||||||
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||||
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix3x2_right_product_fp64(const BgcMatrix3x2FP64* matrix, const BgcVector3FP64* vector, BgcVector2FP64* result)
|
inline void bgc_matrix3x2_get_right_product_fp64(const BgcMatrix3x2FP64* matrix, const BgcVector3FP64* vector, BgcVector2FP64* result)
|
||||||
{
|
{
|
||||||
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
result->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||||
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
result->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||||
|
|
|
@ -45,8 +45,8 @@ extern inline void bgc_matrix3x3_set_column2_fp64(const double r1, const double
|
||||||
extern inline void bgc_matrix3x3_set_column3_fp32(const float r1, const float r2, const float r3, BgcMatrix3x3FP32* matrix);
|
extern inline void bgc_matrix3x3_set_column3_fp32(const float r1, const float r2, const float r3, BgcMatrix3x3FP32* matrix);
|
||||||
extern inline void bgc_matrix3x3_set_column3_fp64(const double r1, const double r2, const double r3, BgcMatrix3x3FP64* matrix);
|
extern inline void bgc_matrix3x3_set_column3_fp64(const double r1, const double r2, const double r3, BgcMatrix3x3FP64* matrix);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x3_make_transposed_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result);
|
extern inline void bgc_matrix3x3_get_transposed_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result);
|
||||||
extern inline void bgc_matrix3x3_make_transposed_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result);
|
extern inline void bgc_matrix3x3_get_transposed_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x3_add_fp32(const BgcMatrix3x3FP32* matrix1, const BgcMatrix3x3FP32* matrix2, BgcMatrix3x3FP32* sum);
|
extern inline void bgc_matrix3x3_add_fp32(const BgcMatrix3x3FP32* matrix1, const BgcMatrix3x3FP32* matrix2, BgcMatrix3x3FP32* sum);
|
||||||
extern inline void bgc_matrix3x3_add_fp64(const BgcMatrix3x3FP64* matrix1, const BgcMatrix3x3FP64* matrix2, BgcMatrix3x3FP64* sum);
|
extern inline void bgc_matrix3x3_add_fp64(const BgcMatrix3x3FP64* matrix1, const BgcMatrix3x3FP64* matrix2, BgcMatrix3x3FP64* sum);
|
||||||
|
@ -66,11 +66,11 @@ extern inline void bgc_matrix3x3_multiply_fp64(const BgcMatrix3x3FP64* multiplic
|
||||||
extern inline void bgc_matrix3x3_divide_fp32(const BgcMatrix3x3FP32* dividend, const float divisor, BgcMatrix3x3FP32* quotient);
|
extern inline void bgc_matrix3x3_divide_fp32(const BgcMatrix3x3FP32* dividend, const float divisor, BgcMatrix3x3FP32* quotient);
|
||||||
extern inline void bgc_matrix3x3_divide_fp64(const BgcMatrix3x3FP64* dividend, const double divisor, BgcMatrix3x3FP64* quotient);
|
extern inline void bgc_matrix3x3_divide_fp64(const BgcMatrix3x3FP64* dividend, const double divisor, BgcMatrix3x3FP64* quotient);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x3_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix3x3FP32* matrix, BgcVector3FP32* result);
|
extern inline void bgc_matrix3x3_get_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix3x3FP32* matrix, BgcVector3FP32* result);
|
||||||
extern inline void bgc_matrix3x3_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix3x3FP64* matrix, BgcVector3FP64* result);
|
extern inline void bgc_matrix3x3_get_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix3x3FP64* matrix, BgcVector3FP64* result);
|
||||||
|
|
||||||
extern inline void bgc_matrix3x3_right_product_fp32(const BgcMatrix3x3FP32* matrix, const BgcVector3FP32* vector, BgcVector3FP32* result);
|
extern inline void bgc_matrix3x3_get_right_product_fp32(const BgcMatrix3x3FP32* matrix, const BgcVector3FP32* vector, BgcVector3FP32* result);
|
||||||
extern inline void bgc_matrix3x3_right_product_fp64(const BgcMatrix3x3FP64* matrix, const BgcVector3FP64* vector, BgcVector3FP64* result);
|
extern inline void bgc_matrix3x3_get_right_product_fp64(const BgcMatrix3x3FP64* matrix, const BgcVector3FP64* vector, BgcVector3FP64* result);
|
||||||
|
|
||||||
// =================== Invert =================== //
|
// =================== Invert =================== //
|
||||||
|
|
||||||
|
@ -148,9 +148,9 @@ int bgc_matrix3x3_invert_fp64(BgcMatrix3x3FP64* matrix)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================ Make Inverted =============== //
|
// ================ Get Inverted ================ //
|
||||||
|
|
||||||
int bgc_matrix3x3_make_inverted_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result)
|
int bgc_matrix3x3_get_inverted_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result)
|
||||||
{
|
{
|
||||||
const float determinant = bgc_matrix3x3_get_determinant_fp32(matrix);
|
const float determinant = bgc_matrix3x3_get_determinant_fp32(matrix);
|
||||||
|
|
||||||
|
@ -187,7 +187,7 @@ int bgc_matrix3x3_make_inverted_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int bgc_matrix3x3_make_inverted_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result)
|
int bgc_matrix3x3_get_inverted_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result)
|
||||||
{
|
{
|
||||||
const double determinant = bgc_matrix3x3_get_determinant_fp64(matrix);
|
const double determinant = bgc_matrix3x3_get_determinant_fp64(matrix);
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ inline void bgc_matrix3x3_set_to_identity_fp64(BgcMatrix3x3FP64* matrix)
|
||||||
matrix->r3c3 = 1.0;
|
matrix->r3c3 = 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================ Make Diagonal =============== //
|
// ================ Set Diagonal ================ //
|
||||||
|
|
||||||
inline void bgc_matrix3x3_set_to_diagonal_fp32(const float d1, const float d2, const float d3, BgcMatrix3x3FP32* matrix)
|
inline void bgc_matrix3x3_set_to_diagonal_fp32(const float d1, const float d2, const float d3, BgcMatrix3x3FP32* matrix)
|
||||||
{
|
{
|
||||||
|
@ -406,15 +406,15 @@ inline void bgc_matrix3x3_set_column3_fp64(const double r1, const double r2, con
|
||||||
matrix->r3c3 = r3;
|
matrix->r3c3 = r3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================ Make Inverted =============== //
|
// ================ Get Inverted ================ //
|
||||||
|
|
||||||
int bgc_matrix3x3_make_inverted_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result);
|
int bgc_matrix3x3_get_inverted_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result);
|
||||||
|
|
||||||
int bgc_matrix3x3_make_inverted_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result);
|
int bgc_matrix3x3_get_inverted_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result);
|
||||||
|
|
||||||
// =============== Make Transposed ============== //
|
// =============== Get Transposed =============== //
|
||||||
|
|
||||||
inline void bgc_matrix3x3_make_transposed_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result)
|
inline void bgc_matrix3x3_get_transposed_fp32(const BgcMatrix3x3FP32* matrix, BgcMatrix3x3FP32* result)
|
||||||
{
|
{
|
||||||
if (matrix == result) {
|
if (matrix == result) {
|
||||||
bgc_matrix3x3_transpose_fp32(result);
|
bgc_matrix3x3_transpose_fp32(result);
|
||||||
|
@ -434,7 +434,7 @@ inline void bgc_matrix3x3_make_transposed_fp32(const BgcMatrix3x3FP32* matrix, B
|
||||||
result->r3c3 = matrix->r3c3;
|
result->r3c3 = matrix->r3c3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix3x3_make_transposed_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result)
|
inline void bgc_matrix3x3_get_transposed_fp64(const BgcMatrix3x3FP64* matrix, BgcMatrix3x3FP64* result)
|
||||||
{
|
{
|
||||||
if (matrix == result) {
|
if (matrix == result) {
|
||||||
bgc_matrix3x3_transpose_fp64(result);
|
bgc_matrix3x3_transpose_fp64(result);
|
||||||
|
@ -628,7 +628,7 @@ inline void bgc_matrix3x3_divide_fp64(const BgcMatrix3x3FP64* dividend, const do
|
||||||
|
|
||||||
// ============ Left Vector Product ============= //
|
// ============ Left Vector Product ============= //
|
||||||
|
|
||||||
inline void bgc_matrix3x3_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix3x3FP32* matrix, BgcVector3FP32* result)
|
inline void bgc_matrix3x3_get_left_product_fp32(const BgcVector3FP32* vector, const BgcMatrix3x3FP32* matrix, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
const float x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
const float x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
||||||
const float x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
const float x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
||||||
|
@ -639,7 +639,7 @@ inline void bgc_matrix3x3_left_product_fp32(const BgcVector3FP32* vector, const
|
||||||
result->x3 = x3;
|
result->x3 = x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix3x3_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix3x3FP64* matrix, BgcVector3FP64* result)
|
inline void bgc_matrix3x3_get_left_product_fp64(const BgcVector3FP64* vector, const BgcMatrix3x3FP64* matrix, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
const double x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
const double x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1 + vector->x3 * matrix->r3c1;
|
||||||
const double x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
const double x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2 + vector->x3 * matrix->r3c2;
|
||||||
|
@ -652,7 +652,7 @@ inline void bgc_matrix3x3_left_product_fp64(const BgcVector3FP64* vector, const
|
||||||
|
|
||||||
// ============ Right Vector Product ============ //
|
// ============ Right Vector Product ============ //
|
||||||
|
|
||||||
inline void bgc_matrix3x3_right_product_fp32(const BgcMatrix3x3FP32* matrix, const BgcVector3FP32* vector, BgcVector3FP32* result)
|
inline void bgc_matrix3x3_get_right_product_fp32(const BgcMatrix3x3FP32* matrix, const BgcVector3FP32* vector, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||||
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||||
|
@ -663,7 +663,7 @@ inline void bgc_matrix3x3_right_product_fp32(const BgcMatrix3x3FP32* matrix, con
|
||||||
result->x3 = x3;
|
result->x3 = x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_matrix3x3_right_product_fp64(const BgcMatrix3x3FP64* matrix, const BgcVector3FP64* vector, BgcVector3FP64* result)
|
inline void bgc_matrix3x3_get_right_product_fp64(const BgcMatrix3x3FP64* matrix, const BgcVector3FP64* vector, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||||
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||||
|
|
|
@ -36,20 +36,20 @@ extern inline void bgc_quaternion_conjugate_fp64(BgcQuaternionFP64* quaternion);
|
||||||
extern inline int bgc_quaternion_normalize_fp32(BgcQuaternionFP32* quaternion);
|
extern inline int bgc_quaternion_normalize_fp32(BgcQuaternionFP32* quaternion);
|
||||||
extern inline int bgc_quaternion_normalize_fp64(BgcQuaternionFP64* quaternion);
|
extern inline int bgc_quaternion_normalize_fp64(BgcQuaternionFP64* quaternion);
|
||||||
|
|
||||||
extern inline void bgc_quaternion_make_conjugate_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* conjugate);
|
extern inline void bgc_quaternion_get_conjugate_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* conjugate);
|
||||||
extern inline void bgc_quaternion_make_conjugate_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* conjugate);
|
extern inline void bgc_quaternion_get_conjugate_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* conjugate);
|
||||||
|
|
||||||
extern inline int bgc_quaternion_make_normalized_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* normalized);
|
extern inline int bgc_quaternion_get_normalized_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* normalized);
|
||||||
extern inline int bgc_quaternion_make_normalized_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* normalized);
|
extern inline int bgc_quaternion_get_normalized_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* normalized);
|
||||||
|
|
||||||
extern inline void bgc_quaternion_make_product_fp32(const BgcQuaternionFP32* left, const BgcQuaternionFP32* right, BgcQuaternionFP32* product);
|
extern inline void bgc_quaternion_get_product_fp32(const BgcQuaternionFP32* left, const BgcQuaternionFP32* right, BgcQuaternionFP32* product);
|
||||||
extern inline void bgc_quaternion_make_product_fp64(const BgcQuaternionFP64* left, const BgcQuaternionFP64* right, BgcQuaternionFP64* product);
|
extern inline void bgc_quaternion_get_product_fp64(const BgcQuaternionFP64* left, const BgcQuaternionFP64* right, BgcQuaternionFP64* product);
|
||||||
|
|
||||||
extern inline void bgc_quaternion_make_rotation_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* rotation);
|
extern inline void bgc_quaternion_get_rotation_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* rotation);
|
||||||
extern inline void bgc_quaternion_make_rotation_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* rotation);
|
extern inline void bgc_quaternion_get_rotation_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* rotation);
|
||||||
|
|
||||||
extern inline void bgc_quaternion_make_reverse_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* reverse);
|
extern inline void bgc_quaternion_get_reverse_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* reverse);
|
||||||
extern inline void bgc_quaternion_make_reverse_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* reverse);
|
extern inline void bgc_quaternion_get_reverse_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* reverse);
|
||||||
|
|
||||||
extern inline void bgc_quaternion_add_fp32(const BgcQuaternionFP32* quaternion1, const BgcQuaternionFP32* quaternion2, BgcQuaternionFP32* sum);
|
extern inline void bgc_quaternion_add_fp32(const BgcQuaternionFP32* quaternion1, const BgcQuaternionFP32* quaternion2, BgcQuaternionFP32* sum);
|
||||||
extern inline void bgc_quaternion_add_fp64(const BgcQuaternionFP64* quaternion1, const BgcQuaternionFP64* quaternion2, BgcQuaternionFP64* sum);
|
extern inline void bgc_quaternion_add_fp64(const BgcQuaternionFP64* quaternion1, const BgcQuaternionFP64* quaternion2, BgcQuaternionFP64* sum);
|
||||||
|
|
|
@ -255,9 +255,9 @@ inline int bgc_quaternion_normalize_fp64(BgcQuaternionFP64* quaternion)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Make Conjugate =============== //
|
// =============== Get Conjugate ================ //
|
||||||
|
|
||||||
inline void bgc_quaternion_make_conjugate_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* conjugate)
|
inline void bgc_quaternion_get_conjugate_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* conjugate)
|
||||||
{
|
{
|
||||||
conjugate->s0 = quaternion->s0;
|
conjugate->s0 = quaternion->s0;
|
||||||
conjugate->x1 = -quaternion->x1;
|
conjugate->x1 = -quaternion->x1;
|
||||||
|
@ -265,7 +265,7 @@ inline void bgc_quaternion_make_conjugate_fp32(const BgcQuaternionFP32* quaterni
|
||||||
conjugate->x3 = -quaternion->x3;
|
conjugate->x3 = -quaternion->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_quaternion_make_conjugate_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* conjugate)
|
inline void bgc_quaternion_get_conjugate_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* conjugate)
|
||||||
{
|
{
|
||||||
conjugate->s0 = quaternion->s0;
|
conjugate->s0 = quaternion->s0;
|
||||||
conjugate->x1 = -quaternion->x1;
|
conjugate->x1 = -quaternion->x1;
|
||||||
|
@ -273,15 +273,15 @@ inline void bgc_quaternion_make_conjugate_fp64(const BgcQuaternionFP64* quaterni
|
||||||
conjugate->x3 = -quaternion->x3;
|
conjugate->x3 = -quaternion->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============== Make Normalized =============== //
|
// =============== Get Normalized =============== //
|
||||||
|
|
||||||
inline int bgc_quaternion_make_normalized_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* normalized)
|
inline int bgc_quaternion_get_normalized_fp32(const BgcQuaternionFP32* quaternion, BgcQuaternionFP32* normalized)
|
||||||
{
|
{
|
||||||
bgc_quaternion_copy_fp32(quaternion, normalized);
|
bgc_quaternion_copy_fp32(quaternion, normalized);
|
||||||
return bgc_quaternion_normalize_fp32(normalized);
|
return bgc_quaternion_normalize_fp32(normalized);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int bgc_quaternion_make_normalized_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* normalized)
|
inline int bgc_quaternion_get_normalized_fp64(const BgcQuaternionFP64* quaternion, BgcQuaternionFP64* normalized)
|
||||||
{
|
{
|
||||||
bgc_quaternion_copy_fp64(quaternion, normalized);
|
bgc_quaternion_copy_fp64(quaternion, normalized);
|
||||||
return bgc_quaternion_normalize_fp64(normalized);
|
return bgc_quaternion_normalize_fp64(normalized);
|
||||||
|
@ -289,7 +289,7 @@ inline int bgc_quaternion_make_normalized_fp64(const BgcQuaternionFP64* quaterni
|
||||||
|
|
||||||
// ================== Product =================== //
|
// ================== Product =================== //
|
||||||
|
|
||||||
inline void bgc_quaternion_make_product_fp32(const BgcQuaternionFP32* left, const BgcQuaternionFP32* right, BgcQuaternionFP32* product)
|
inline void bgc_quaternion_get_product_fp32(const BgcQuaternionFP32* left, const BgcQuaternionFP32* right, BgcQuaternionFP32* product)
|
||||||
{
|
{
|
||||||
const float s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
const float s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||||
const float x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
const float x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
||||||
|
@ -302,7 +302,7 @@ inline void bgc_quaternion_make_product_fp32(const BgcQuaternionFP32* left, cons
|
||||||
product->x3 = x3;
|
product->x3 = x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_quaternion_make_product_fp64(const BgcQuaternionFP64* left, const BgcQuaternionFP64* right, BgcQuaternionFP64* product)
|
inline void bgc_quaternion_get_product_fp64(const BgcQuaternionFP64* left, const BgcQuaternionFP64* right, BgcQuaternionFP64* product)
|
||||||
{
|
{
|
||||||
const double s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
const double s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||||
const double x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
const double x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
||||||
|
@ -315,9 +315,9 @@ inline void bgc_quaternion_make_product_fp64(const BgcQuaternionFP64* left, cons
|
||||||
product->x3 = x3;
|
product->x3 = x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============ Make Rotation Matrix ============ //
|
// ============ Get Rotation Matrix ============= //
|
||||||
|
|
||||||
inline void bgc_quaternion_make_rotation_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* rotation)
|
inline void bgc_quaternion_get_rotation_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* rotation)
|
||||||
{
|
{
|
||||||
const float s0s0 = quaternion->s0 * quaternion->s0;
|
const float s0s0 = quaternion->s0 * quaternion->s0;
|
||||||
const float x1x1 = quaternion->x1 * quaternion->x1;
|
const float x1x1 = quaternion->x1 * quaternion->x1;
|
||||||
|
@ -356,7 +356,7 @@ inline void bgc_quaternion_make_rotation_matrix_fp32(const BgcQuaternionFP32* qu
|
||||||
rotation->r1c3 = corrector2 * (x1x3 + s0x2);
|
rotation->r1c3 = corrector2 * (x1x3 + s0x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_quaternion_make_rotation_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* rotation)
|
inline void bgc_quaternion_get_rotation_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* rotation)
|
||||||
{
|
{
|
||||||
const double s0s0 = quaternion->s0 * quaternion->s0;
|
const double s0s0 = quaternion->s0 * quaternion->s0;
|
||||||
const double x1x1 = quaternion->x1 * quaternion->x1;
|
const double x1x1 = quaternion->x1 * quaternion->x1;
|
||||||
|
@ -395,9 +395,9 @@ inline void bgc_quaternion_make_rotation_matrix_fp64(const BgcQuaternionFP64* qu
|
||||||
rotation->r1c3 = corrector2 * (x1x3 + s0x2);
|
rotation->r1c3 = corrector2 * (x1x3 + s0x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============ Make Reverse Matrix ============= //
|
// ============= Get Reverse Matrix ============= //
|
||||||
|
|
||||||
inline void bgc_quaternion_make_reverse_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* reverse)
|
inline void bgc_quaternion_get_reverse_matrix_fp32(const BgcQuaternionFP32* quaternion, BgcMatrix3x3FP32* reverse)
|
||||||
{
|
{
|
||||||
const float s0s0 = quaternion->s0 * quaternion->s0;
|
const float s0s0 = quaternion->s0 * quaternion->s0;
|
||||||
const float x1x1 = quaternion->x1 * quaternion->x1;
|
const float x1x1 = quaternion->x1 * quaternion->x1;
|
||||||
|
@ -436,7 +436,7 @@ inline void bgc_quaternion_make_reverse_matrix_fp32(const BgcQuaternionFP32* qua
|
||||||
reverse->r1c3 = corrector2 * (x1x3 - s0x2);
|
reverse->r1c3 = corrector2 * (x1x3 - s0x2);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_quaternion_make_reverse_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* reverse)
|
inline void bgc_quaternion_get_reverse_matrix_fp64(const BgcQuaternionFP64* quaternion, BgcMatrix3x3FP64* reverse)
|
||||||
{
|
{
|
||||||
const double s0s0 = quaternion->s0 * quaternion->s0;
|
const double s0s0 = quaternion->s0 * quaternion->s0;
|
||||||
const double x1x1 = quaternion->x1 * quaternion->x1;
|
const double x1x1 = quaternion->x1 * quaternion->x1;
|
||||||
|
|
|
@ -39,7 +39,7 @@ inline void bgc_rotation3_reset_fp64(BgcRotation3FP64* rotation)
|
||||||
rotation->radians = 0.0;
|
rotation->radians = 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== Make ==================== //
|
// ================= Set Values ================= //
|
||||||
|
|
||||||
inline void bgc_rotation3_set_values_fp32(const float x1, const float x2, const float x3, const float angle, const BgcAngleUnitEnum unit, BgcRotation3FP32* rotation)
|
inline void bgc_rotation3_set_values_fp32(const float x1, const float x2, const float x3, const float angle, const BgcAngleUnitEnum unit, BgcRotation3FP32* rotation)
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,14 +31,14 @@ extern inline void bgc_tangent_pair_invert_fp64(BgcTangentPairFP64* tangent);
|
||||||
extern inline void bgc_tangent_pair_combine_fp32(const BgcTangentPairFP32* tangent1, const BgcTangentPairFP32* tangent2, BgcTangentPairFP32* result);
|
extern inline void bgc_tangent_pair_combine_fp32(const BgcTangentPairFP32* tangent1, const BgcTangentPairFP32* tangent2, BgcTangentPairFP32* result);
|
||||||
extern inline void bgc_tangent_pair_combine_fp64(const BgcTangentPairFP64* tangent1, const BgcTangentPairFP64* tangent2, BgcTangentPairFP64* result);
|
extern inline void bgc_tangent_pair_combine_fp64(const BgcTangentPairFP64* tangent1, const BgcTangentPairFP64* tangent2, BgcTangentPairFP64* result);
|
||||||
|
|
||||||
extern inline void bgc_tangent_pair_make_inverted_fp32(const BgcTangentPairFP32* tangent, BgcTangentPairFP32* result);
|
extern inline void bgc_tangent_pair_get_inverted_fp32(const BgcTangentPairFP32* tangent, BgcTangentPairFP32* result);
|
||||||
extern inline void bgc_tangent_pair_make_inverted_fp64(const BgcTangentPairFP64* tangent, BgcTangentPairFP64* result);
|
extern inline void bgc_tangent_pair_get_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_get_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_get_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_get_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 void bgc_tangent_pair_get_reverse_matrix_fp64(const BgcTangentPairFP64* tangent, BgcMatrix2x2FP64* matrix);
|
||||||
|
|
||||||
extern inline void bgc_tangent_pair_turn_vector_fp32(const BgcTangentPairFP32* tangent, const BgcVector2FP32* vector, BgcVector2FP32* result);
|
extern inline void bgc_tangent_pair_turn_vector_fp32(const BgcTangentPairFP32* tangent, const BgcVector2FP32* vector, BgcVector2FP32* result);
|
||||||
extern inline void bgc_tangent_pair_turn_vector_fp64(const BgcTangentPairFP64* tangent, const BgcVector2FP64* vector, BgcVector2FP64* result);
|
extern inline void bgc_tangent_pair_turn_vector_fp64(const BgcTangentPairFP64* tangent, const BgcVector2FP64* vector, BgcVector2FP64* result);
|
||||||
|
|
|
@ -251,7 +251,7 @@ inline void bgc_tangent_pair_combine_fp64(const BgcTangentPairFP64* tangent1, co
|
||||||
|
|
||||||
// ================ Set Inverted ================ //
|
// ================ Set Inverted ================ //
|
||||||
|
|
||||||
inline void bgc_tangent_pair_make_inverted_fp32(const BgcTangentPairFP32* tangent, BgcTangentPairFP32* result)
|
inline void bgc_tangent_pair_get_inverted_fp32(const BgcTangentPairFP32* tangent, BgcTangentPairFP32* result)
|
||||||
{
|
{
|
||||||
_BgcTwinTangentPairFP32* twin = (_BgcTwinTangentPairFP32*)result;
|
_BgcTwinTangentPairFP32* twin = (_BgcTwinTangentPairFP32*)result;
|
||||||
|
|
||||||
|
@ -259,7 +259,7 @@ inline void bgc_tangent_pair_make_inverted_fp32(const BgcTangentPairFP32* tangen
|
||||||
twin->sin = -tangent->sin;
|
twin->sin = -tangent->sin;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_tangent_pair_make_inverted_fp64(const BgcTangentPairFP64* tangent, BgcTangentPairFP64* result)
|
inline void bgc_tangent_pair_get_inverted_fp64(const BgcTangentPairFP64* tangent, BgcTangentPairFP64* result)
|
||||||
{
|
{
|
||||||
_BgcTwinTangentPairFP64* twin = (_BgcTwinTangentPairFP64*)result;
|
_BgcTwinTangentPairFP64* twin = (_BgcTwinTangentPairFP64*)result;
|
||||||
|
|
||||||
|
@ -269,7 +269,7 @@ inline void bgc_tangent_pair_make_inverted_fp64(const BgcTangentPairFP64* tangen
|
||||||
|
|
||||||
// ============== Rotation Matrix =============== //
|
// ============== Rotation Matrix =============== //
|
||||||
|
|
||||||
inline void bgc_tangent_pair_make_rotation_matrix_fp32(const BgcTangentPairFP32* tangent, BgcMatrix2x2FP32* matrix)
|
inline void bgc_tangent_pair_get_rotation_matrix_fp32(const BgcTangentPairFP32* tangent, BgcMatrix2x2FP32* matrix)
|
||||||
{
|
{
|
||||||
matrix->r1c1 = tangent->cos;
|
matrix->r1c1 = tangent->cos;
|
||||||
matrix->r1c2 = -tangent->sin;
|
matrix->r1c2 = -tangent->sin;
|
||||||
|
@ -277,7 +277,7 @@ inline void bgc_tangent_pair_make_rotation_matrix_fp32(const BgcTangentPairFP32*
|
||||||
matrix->r2c2 = tangent->cos;
|
matrix->r2c2 = tangent->cos;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_tangent_pair_make_rotation_matrix_fp64(const BgcTangentPairFP64* tangent, BgcMatrix2x2FP64* matrix)
|
inline void bgc_tangent_pair_get_rotation_matrix_fp64(const BgcTangentPairFP64* tangent, BgcMatrix2x2FP64* matrix)
|
||||||
{
|
{
|
||||||
matrix->r1c1 = tangent->cos;
|
matrix->r1c1 = tangent->cos;
|
||||||
matrix->r1c2 = -tangent->sin;
|
matrix->r1c2 = -tangent->sin;
|
||||||
|
@ -287,7 +287,7 @@ inline void bgc_tangent_pair_make_rotation_matrix_fp64(const BgcTangentPairFP64*
|
||||||
|
|
||||||
// ============== Reverse Matrix ================ //
|
// ============== Reverse Matrix ================ //
|
||||||
|
|
||||||
inline void bgc_tangent_pair_make_reverse_matrix_fp32(const BgcTangentPairFP32* tangent, BgcMatrix2x2FP32* matrix)
|
inline void bgc_tangent_pair_get_reverse_matrix_fp32(const BgcTangentPairFP32* tangent, BgcMatrix2x2FP32* matrix)
|
||||||
{
|
{
|
||||||
matrix->r1c1 = tangent->cos;
|
matrix->r1c1 = tangent->cos;
|
||||||
matrix->r1c2 = tangent->sin;
|
matrix->r1c2 = tangent->sin;
|
||||||
|
@ -295,7 +295,7 @@ inline void bgc_tangent_pair_make_reverse_matrix_fp32(const BgcTangentPairFP32*
|
||||||
matrix->r2c2 = tangent->cos;
|
matrix->r2c2 = tangent->cos;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_tangent_pair_make_reverse_matrix_fp64(const BgcTangentPairFP64* tangent, BgcMatrix2x2FP64* matrix)
|
inline void bgc_tangent_pair_get_reverse_matrix_fp64(const BgcTangentPairFP64* tangent, BgcMatrix2x2FP64* matrix)
|
||||||
{
|
{
|
||||||
matrix->r1c1 = tangent->cos;
|
matrix->r1c1 = tangent->cos;
|
||||||
matrix->r1c2 = tangent->sin;
|
matrix->r1c2 = tangent->sin;
|
||||||
|
|
|
@ -33,11 +33,14 @@ extern inline void bgc_vector2_reverse_fp64(BgcVector2FP64* vector);
|
||||||
extern inline int bgc_vector2_normalize_fp32(BgcVector2FP32* vector);
|
extern inline int bgc_vector2_normalize_fp32(BgcVector2FP32* vector);
|
||||||
extern inline int bgc_vector2_normalize_fp64(BgcVector2FP64* vector);
|
extern inline int bgc_vector2_normalize_fp64(BgcVector2FP64* vector);
|
||||||
|
|
||||||
extern inline void bgc_vector2_make_reverse_fp32(const BgcVector2FP32* vector, BgcVector2FP32* reverse);
|
extern inline void bgc_vector2_get_reverse_fp32(const BgcVector2FP32* vector, BgcVector2FP32* reverse);
|
||||||
extern inline void bgc_vector2_make_reverse_fp64(const BgcVector2FP64* vector, BgcVector2FP64* reverse);
|
extern inline void bgc_vector2_get_reverse_fp64(const BgcVector2FP64* vector, BgcVector2FP64* reverse);
|
||||||
|
|
||||||
extern inline int bgc_vector2_make_normalized_fp32(const BgcVector2FP32* vector, BgcVector2FP32* result);
|
extern inline int bgc_vector2_get_normalized_fp32(const BgcVector2FP32* vector, BgcVector2FP32* result);
|
||||||
extern inline int bgc_vector2_make_normalized_fp64(const BgcVector2FP64* vector, BgcVector2FP64* result);
|
extern inline int bgc_vector2_get_normalized_fp64(const BgcVector2FP64* vector, BgcVector2FP64* result);
|
||||||
|
|
||||||
|
extern inline void bgc_vector2_get_complex_conjugate_fp32(const BgcVector2FP32* vector, BgcVector2FP32* conjugate);
|
||||||
|
extern inline void bgc_vector2_get_complex_conjugate_fp64(const BgcVector2FP64* vector, BgcVector2FP64* conjugate);
|
||||||
|
|
||||||
extern inline void bgc_vector2_add_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* sum);
|
extern inline void bgc_vector2_add_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* sum);
|
||||||
extern inline void bgc_vector2_add_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* sum);
|
extern inline void bgc_vector2_add_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* sum);
|
||||||
|
@ -57,11 +60,11 @@ extern inline void bgc_vector2_multiply_fp64(const BgcVector2FP64* multiplicand,
|
||||||
extern inline void bgc_vector2_divide_fp32(const BgcVector2FP32* dividend, const float divisor, BgcVector2FP32* quotient);
|
extern inline void bgc_vector2_divide_fp32(const BgcVector2FP32* dividend, const float divisor, BgcVector2FP32* quotient);
|
||||||
extern inline void bgc_vector2_divide_fp64(const BgcVector2FP64* dividend, const double divisor, BgcVector2FP64* quotient);
|
extern inline void bgc_vector2_divide_fp64(const BgcVector2FP64* dividend, const double divisor, BgcVector2FP64* quotient);
|
||||||
|
|
||||||
extern inline void bgc_vector2_mean_of_two_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* mean);
|
extern inline void bgc_vector2_get_mean_of_two_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* mean);
|
||||||
extern inline void bgc_vector2_mean_of_two_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* mean);
|
extern inline void bgc_vector2_get_mean_of_two_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* mean);
|
||||||
|
|
||||||
extern inline void bgc_vector2_mean_of_three_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, const BgcVector2FP32* vector3, BgcVector2FP32* mean);
|
extern inline void bgc_vector2_get_mean_of_three_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, const BgcVector2FP32* vector3, BgcVector2FP32* mean);
|
||||||
extern inline void bgc_vector2_mean_of_three_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, const BgcVector2FP64* vector3, BgcVector2FP64* mean);
|
extern inline void bgc_vector2_get_mean_of_three_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, const BgcVector2FP64* vector3, BgcVector2FP64* mean);
|
||||||
|
|
||||||
extern inline void bgc_vector2_minimize_fp32(const BgcVector2FP32* vector, BgcVector2FP32* minimal);
|
extern inline void bgc_vector2_minimize_fp32(const BgcVector2FP32* vector, BgcVector2FP32* minimal);
|
||||||
extern inline void bgc_vector2_minimize_fp64(const BgcVector2FP64* vector, BgcVector2FP64* minimal);
|
extern inline void bgc_vector2_minimize_fp64(const BgcVector2FP64* vector, BgcVector2FP64* minimal);
|
||||||
|
@ -69,14 +72,14 @@ extern inline void bgc_vector2_minimize_fp64(const BgcVector2FP64* vector, BgcVe
|
||||||
extern inline void bgc_vector2_maximize_fp32(const BgcVector2FP32* vector, BgcVector2FP32* maximal);
|
extern inline void bgc_vector2_maximize_fp32(const BgcVector2FP32* vector, BgcVector2FP32* maximal);
|
||||||
extern inline void bgc_vector2_maximize_fp64(const BgcVector2FP64* vector, BgcVector2FP64* maximal);
|
extern inline void bgc_vector2_maximize_fp64(const BgcVector2FP64* vector, BgcVector2FP64* maximal);
|
||||||
|
|
||||||
extern inline float bgc_vector2_scalar_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2);
|
extern inline float bgc_vector2_get_scalar_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2);
|
||||||
extern inline double bgc_vector2_scalar_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2);
|
extern inline double bgc_vector2_get_scalar_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2);
|
||||||
|
|
||||||
extern inline float bgc_vector2_cross_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2);
|
extern inline float bgc_vector2_get_cross_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2);
|
||||||
extern inline double bgc_vector2_cross_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2);
|
extern inline double bgc_vector2_get_cross_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2);
|
||||||
|
|
||||||
extern inline void bgc_vector2_complex_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* product);
|
extern inline void bgc_vector2_get_complex_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* product);
|
||||||
extern inline void bgc_vector2_complex_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* product);
|
extern inline void bgc_vector2_get_complex_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* product);
|
||||||
|
|
||||||
extern inline float bgc_vector2_get_square_distance_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2);
|
extern inline float bgc_vector2_get_square_distance_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2);
|
||||||
extern inline double bgc_vector2_get_square_distance_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2);
|
extern inline double bgc_vector2_get_square_distance_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2);
|
||||||
|
@ -106,7 +109,7 @@ float bgc_vector2_get_angle_fp32(const BgcVector2FP32* vector1, const BgcVector2
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float cosine = bgc_vector2_scalar_product_fp32(vector1, vector2) / sqrtf(square_modulus1 * square_modulus2);
|
const float cosine = bgc_vector2_get_scalar_product_fp32(vector1, vector2) / sqrtf(square_modulus1 * square_modulus2);
|
||||||
|
|
||||||
if (cosine >= 1.0f - BGC_EPSYLON_FP32) {
|
if (cosine >= 1.0f - BGC_EPSYLON_FP32) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
|
@ -133,7 +136,7 @@ double bgc_vector2_get_angle_fp64(const BgcVector2FP64* vector1, const BgcVector
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const double cosine = bgc_vector2_scalar_product_fp64(vector1, vector2) / sqrt(square_modulus1 * square_modulus2);
|
const double cosine = bgc_vector2_get_scalar_product_fp64(vector1, vector2) / sqrt(square_modulus1 * square_modulus2);
|
||||||
|
|
||||||
if (cosine >= 1.0 - BGC_EPSYLON_FP64) {
|
if (cosine >= 1.0 - BGC_EPSYLON_FP64) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
|
|
@ -214,43 +214,43 @@ inline void bgc_vector2_complex_conjugate_fp64(BgcVector2FP64* vector)
|
||||||
vector->x2 = -vector->x2;
|
vector->x2 = -vector->x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================ Make Reverse ================ //
|
// ================ Get Reverse ================= //
|
||||||
|
|
||||||
inline void bgc_vector2_make_reverse_fp32(const BgcVector2FP32* vector, BgcVector2FP32* reverse)
|
inline void bgc_vector2_get_reverse_fp32(const BgcVector2FP32* vector, BgcVector2FP32* reverse)
|
||||||
{
|
{
|
||||||
reverse->x1 = -vector->x1;
|
reverse->x1 = -vector->x1;
|
||||||
reverse->x2 = -vector->x2;
|
reverse->x2 = -vector->x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector2_make_reverse_fp64(const BgcVector2FP64* vector, BgcVector2FP64* reverse)
|
inline void bgc_vector2_get_reverse_fp64(const BgcVector2FP64* vector, BgcVector2FP64* reverse)
|
||||||
{
|
{
|
||||||
reverse->x1 = -vector->x1;
|
reverse->x1 = -vector->x1;
|
||||||
reverse->x2 = -vector->x2;
|
reverse->x2 = -vector->x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============== Make Normalized =============== //
|
// =============== Get Normalized =============== //
|
||||||
|
|
||||||
inline int bgc_vector2_make_normalized_fp32(const BgcVector2FP32* vector, BgcVector2FP32* normalized)
|
inline int bgc_vector2_get_normalized_fp32(const BgcVector2FP32* vector, BgcVector2FP32* normalized)
|
||||||
{
|
{
|
||||||
bgc_vector2_copy_fp32(vector, normalized);
|
bgc_vector2_copy_fp32(vector, normalized);
|
||||||
return bgc_vector2_normalize_fp32(normalized);
|
return bgc_vector2_normalize_fp32(normalized);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int bgc_vector2_make_normalized_fp64(const BgcVector2FP64* vector, BgcVector2FP64* normalized)
|
inline int bgc_vector2_get_normalized_fp64(const BgcVector2FP64* vector, BgcVector2FP64* normalized)
|
||||||
{
|
{
|
||||||
bgc_vector2_copy_fp64(vector, normalized);
|
bgc_vector2_copy_fp64(vector, normalized);
|
||||||
return bgc_vector2_normalize_fp64(normalized);
|
return bgc_vector2_normalize_fp64(normalized);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========== Make Complex Conjugate =========== //
|
// =========== Get Complex Conjugate ============ //
|
||||||
|
|
||||||
inline void bgc_vector2_make_complex_conjugate_fp32(const BgcVector2FP32* vector, BgcVector2FP32* conjugate)
|
inline void bgc_vector2_get_complex_conjugate_fp32(const BgcVector2FP32* vector, BgcVector2FP32* conjugate)
|
||||||
{
|
{
|
||||||
conjugate->x1 = vector->x1;
|
conjugate->x1 = vector->x1;
|
||||||
conjugate->x2 = -vector->x2;
|
conjugate->x2 = -vector->x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector2_make_complex_conjugate_fp64(const BgcVector2FP64* vector, BgcVector2FP64* conjugate)
|
inline void bgc_vector2_get_complex_conjugate_fp64(const BgcVector2FP64* vector, BgcVector2FP64* conjugate)
|
||||||
{
|
{
|
||||||
conjugate->x1 = vector->x1;
|
conjugate->x1 = vector->x1;
|
||||||
conjugate->x2 = -vector->x2;
|
conjugate->x2 = -vector->x2;
|
||||||
|
@ -340,13 +340,13 @@ inline void bgc_vector2_divide_fp64(const BgcVector2FP64* dividend, const double
|
||||||
|
|
||||||
// ================== Average2 ================== //
|
// ================== Average2 ================== //
|
||||||
|
|
||||||
inline void bgc_vector2_mean_of_two_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* mean)
|
inline void bgc_vector2_get_mean_of_two_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* mean)
|
||||||
{
|
{
|
||||||
mean->x1 = (vector1->x1 + vector2->x1) * 0.5f;
|
mean->x1 = (vector1->x1 + vector2->x1) * 0.5f;
|
||||||
mean->x2 = (vector1->x2 + vector2->x2) * 0.5f;
|
mean->x2 = (vector1->x2 + vector2->x2) * 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector2_mean_of_two_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* mean)
|
inline void bgc_vector2_get_mean_of_two_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* mean)
|
||||||
{
|
{
|
||||||
mean->x1 = (vector1->x1 + vector2->x1) * 0.5;
|
mean->x1 = (vector1->x1 + vector2->x1) * 0.5;
|
||||||
mean->x2 = (vector1->x2 + vector2->x2) * 0.5;
|
mean->x2 = (vector1->x2 + vector2->x2) * 0.5;
|
||||||
|
@ -354,13 +354,13 @@ inline void bgc_vector2_mean_of_two_fp64(const BgcVector2FP64* vector1, const Bg
|
||||||
|
|
||||||
// ================== Average3 ================== //
|
// ================== Average3 ================== //
|
||||||
|
|
||||||
inline void bgc_vector2_mean_of_three_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, const BgcVector2FP32* vector3, BgcVector2FP32* mean)
|
inline void bgc_vector2_get_mean_of_three_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, const BgcVector2FP32* vector3, BgcVector2FP32* mean)
|
||||||
{
|
{
|
||||||
mean->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP32;
|
mean->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP32;
|
||||||
mean->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP32;
|
mean->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP32;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector2_mean_of_three_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, const BgcVector2FP64* vector3, BgcVector2FP64* mean)
|
inline void bgc_vector2_get_mean_of_three_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, const BgcVector2FP64* vector3, BgcVector2FP64* mean)
|
||||||
{
|
{
|
||||||
mean->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP64;
|
mean->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP64;
|
||||||
mean->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP64;
|
mean->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP64;
|
||||||
|
@ -416,31 +416,31 @@ inline void bgc_vector2_maximize_fp64(const BgcVector2FP64* vector, BgcVector2FP
|
||||||
|
|
||||||
// =============== Scalar Product =============== //
|
// =============== Scalar Product =============== //
|
||||||
|
|
||||||
inline float bgc_vector2_scalar_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2)
|
inline float bgc_vector2_get_scalar_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2)
|
||||||
{
|
{
|
||||||
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2;
|
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double bgc_vector2_scalar_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2)
|
inline double bgc_vector2_get_scalar_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2)
|
||||||
{
|
{
|
||||||
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2;
|
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Cross Product ================ //
|
// =============== Cross Product ================ //
|
||||||
|
|
||||||
inline float bgc_vector2_cross_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2)
|
inline float bgc_vector2_get_cross_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2)
|
||||||
{
|
{
|
||||||
return vector1->x1 * vector2->x2 - vector1->x2 * vector2->x1;
|
return vector1->x1 * vector2->x2 - vector1->x2 * vector2->x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double bgc_vector2_cross_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2)
|
inline double bgc_vector2_get_cross_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2)
|
||||||
{
|
{
|
||||||
return vector1->x1 * vector2->x2 - vector1->x2 * vector2->x1;
|
return vector1->x1 * vector2->x2 - vector1->x2 * vector2->x1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============== Complex Product =============== //
|
// ============== Complex Product =============== //
|
||||||
|
|
||||||
inline void bgc_vector2_complex_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* result)
|
inline void bgc_vector2_get_complex_product_fp32(const BgcVector2FP32* vector1, const BgcVector2FP32* vector2, BgcVector2FP32* result)
|
||||||
{
|
{
|
||||||
const float x1 = vector1->x1 * vector2->x1 - vector1->x2 * vector2->x2;
|
const float x1 = vector1->x1 * vector2->x1 - vector1->x2 * vector2->x2;
|
||||||
const float x2 = vector1->x1 * vector2->x2 + vector1->x2 * vector2->x1;
|
const float x2 = vector1->x1 * vector2->x2 + vector1->x2 * vector2->x1;
|
||||||
|
@ -449,7 +449,7 @@ inline void bgc_vector2_complex_product_fp32(const BgcVector2FP32* vector1, cons
|
||||||
result->x2 = x2;
|
result->x2 = x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector2_complex_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* result)
|
inline void bgc_vector2_get_complex_product_fp64(const BgcVector2FP64* vector1, const BgcVector2FP64* vector2, BgcVector2FP64* result)
|
||||||
{
|
{
|
||||||
const double x1 = vector1->x1 * vector2->x1 - vector1->x2 * vector2->x2;
|
const double x1 = vector1->x1 * vector2->x1 - vector1->x2 * vector2->x2;
|
||||||
const double x2 = vector1->x1 * vector2->x2 + vector1->x2 * vector2->x1;
|
const double x2 = vector1->x1 * vector2->x2 + vector1->x2 * vector2->x1;
|
||||||
|
|
|
@ -33,11 +33,11 @@ extern inline void bgc_vector3_reverse_fp64(BgcVector3FP64* vector);
|
||||||
extern inline int bgc_vector3_normalize_fp32(BgcVector3FP32* vector);
|
extern inline int bgc_vector3_normalize_fp32(BgcVector3FP32* vector);
|
||||||
extern inline int bgc_vector3_normalize_fp64(BgcVector3FP64* vector);
|
extern inline int bgc_vector3_normalize_fp64(BgcVector3FP64* vector);
|
||||||
|
|
||||||
extern inline void bgc_vector3_make_reverse_fp32(const BgcVector3FP32* vector, BgcVector3FP32* reverse);
|
extern inline void bgc_vector3_get_reverse_fp32(const BgcVector3FP32* vector, BgcVector3FP32* reverse);
|
||||||
extern inline void bgc_vector3_make_reverse_fp64(const BgcVector3FP64* vector, BgcVector3FP64* reverse);
|
extern inline void bgc_vector3_get_reverse_fp64(const BgcVector3FP64* vector, BgcVector3FP64* reverse);
|
||||||
|
|
||||||
extern inline int bgc_vector3_make_normalized_fp32(const BgcVector3FP32* vector, BgcVector3FP32* normalized);
|
extern inline int bgc_vector3_get_normalized_fp32(const BgcVector3FP32* vector, BgcVector3FP32* normalized);
|
||||||
extern inline int bgc_vector3_make_normalized_fp64(const BgcVector3FP64* vector, BgcVector3FP64* normalized);
|
extern inline int bgc_vector3_get_normalized_fp64(const BgcVector3FP64* vector, BgcVector3FP64* normalized);
|
||||||
|
|
||||||
extern inline void bgc_vector3_add_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* sum);
|
extern inline void bgc_vector3_add_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* sum);
|
||||||
extern inline void bgc_vector3_add_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* sum);
|
extern inline void bgc_vector3_add_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* sum);
|
||||||
|
@ -57,11 +57,11 @@ extern inline void bgc_vector3_multiply_fp64(const BgcVector3FP64* multiplicand,
|
||||||
extern inline void bgc_vector3_divide_fp32(const BgcVector3FP32* dividend, const float divisor, BgcVector3FP32* quotient);
|
extern inline void bgc_vector3_divide_fp32(const BgcVector3FP32* dividend, const float divisor, BgcVector3FP32* quotient);
|
||||||
extern inline void bgc_vector3_divide_fp64(const BgcVector3FP64* dividend, const double divisor, BgcVector3FP64* quotient);
|
extern inline void bgc_vector3_divide_fp64(const BgcVector3FP64* dividend, const double divisor, BgcVector3FP64* quotient);
|
||||||
|
|
||||||
extern inline void bgc_vector3_mean_of_two_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result);
|
extern inline void bgc_vector3_get_mean_of_two_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result);
|
||||||
extern inline void bgc_vector3_mean_of_two_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result);
|
extern inline void bgc_vector3_get_mean_of_two_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result);
|
||||||
|
|
||||||
extern inline void bgc_vector3_mean_of_three_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result);
|
extern inline void bgc_vector3_get_mean_of_three_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result);
|
||||||
extern inline void bgc_vector3_mean_of_three_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result);
|
extern inline void bgc_vector3_get_mean_of_three_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result);
|
||||||
|
|
||||||
extern inline void bgc_vector3_minimize_fp32(const BgcVector3FP32* vector, BgcVector3FP32* minimal);
|
extern inline void bgc_vector3_minimize_fp32(const BgcVector3FP32* vector, BgcVector3FP32* minimal);
|
||||||
extern inline void bgc_vector3_minimize_fp64(const BgcVector3FP64* vector, BgcVector3FP64* minimal);
|
extern inline void bgc_vector3_minimize_fp64(const BgcVector3FP64* vector, BgcVector3FP64* minimal);
|
||||||
|
@ -69,17 +69,17 @@ extern inline void bgc_vector3_minimize_fp64(const BgcVector3FP64* vector, BgcVe
|
||||||
extern inline void bgc_vector3_maximize_fp32(const BgcVector3FP32* vector, BgcVector3FP32* maximal);
|
extern inline void bgc_vector3_maximize_fp32(const BgcVector3FP32* vector, BgcVector3FP32* maximal);
|
||||||
extern inline void bgc_vector3_maximize_fp64(const BgcVector3FP64* vector, BgcVector3FP64* maximal);
|
extern inline void bgc_vector3_maximize_fp64(const BgcVector3FP64* vector, BgcVector3FP64* maximal);
|
||||||
|
|
||||||
extern inline float bgc_vector3_scalar_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2);
|
extern inline float bgc_vector3_get_scalar_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2);
|
||||||
extern inline double bgc_vector3_scalar_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2);
|
extern inline double bgc_vector3_get_scalar_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2);
|
||||||
|
|
||||||
extern inline float bgc_vector3_triple_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3);
|
extern inline float bgc_vector3_get_triple_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3);
|
||||||
extern inline double bgc_vector3_triple_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3);
|
extern inline double bgc_vector3_get_triple_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3);
|
||||||
|
|
||||||
extern inline void bgc_vector3_cross_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result);
|
extern inline void bgc_vector3_get_cross_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result);
|
||||||
extern inline void bgc_vector3_cross_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result);
|
extern inline void bgc_vector3_get_cross_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result);
|
||||||
|
|
||||||
extern inline void bgc_vector3_double_cross_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result);
|
extern inline void bgc_vector3_get_double_cross_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result);
|
||||||
extern inline void bgc_vector3_double_cross_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result);
|
extern inline void bgc_vector3_get_double_cross_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result);
|
||||||
|
|
||||||
extern inline float bgc_vector3_get_square_distance_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2);
|
extern inline float bgc_vector3_get_square_distance_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2);
|
||||||
extern inline double bgc_vector3_get_square_distance_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2);
|
extern inline double bgc_vector3_get_square_distance_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2);
|
||||||
|
@ -109,7 +109,7 @@ float bgc_vector3_get_angle_fp32(const BgcVector3FP32* vector1, const BgcVector3
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
const float cosine = bgc_vector3_scalar_product_fp32(vector1, vector2) / sqrtf(square_modulus1 * square_modulus2);
|
const float cosine = bgc_vector3_get_scalar_product_fp32(vector1, vector2) / sqrtf(square_modulus1 * square_modulus2);
|
||||||
|
|
||||||
if (cosine >= 1.0f - BGC_EPSYLON_FP32) {
|
if (cosine >= 1.0f - BGC_EPSYLON_FP32) {
|
||||||
return 0.0f;
|
return 0.0f;
|
||||||
|
@ -136,7 +136,7 @@ double bgc_vector3_get_angle_fp64(const BgcVector3FP64* vector1, const BgcVector
|
||||||
return 0.0;
|
return 0.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const double cosine = bgc_vector3_scalar_product_fp64(vector1, vector2) / sqrt(square_modulus1 * square_modulus2);
|
const double cosine = bgc_vector3_get_scalar_product_fp64(vector1, vector2) / sqrt(square_modulus1 * square_modulus2);
|
||||||
|
|
||||||
if (cosine >= 1.0 - BGC_EPSYLON_FP64) {
|
if (cosine >= 1.0 - BGC_EPSYLON_FP64) {
|
||||||
return 0.0;
|
return 0.0;
|
||||||
|
|
|
@ -224,31 +224,31 @@ inline int bgc_vector3_normalize_fp64(BgcVector3FP64* vector)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================ Make Reverse ================ //
|
// ================ Get Reverse ================= //
|
||||||
|
|
||||||
inline void bgc_vector3_make_reverse_fp32(const BgcVector3FP32* vector, BgcVector3FP32* reverse)
|
inline void bgc_vector3_get_reverse_fp32(const BgcVector3FP32* vector, BgcVector3FP32* reverse)
|
||||||
{
|
{
|
||||||
reverse->x1 = -vector->x1;
|
reverse->x1 = -vector->x1;
|
||||||
reverse->x2 = -vector->x2;
|
reverse->x2 = -vector->x2;
|
||||||
reverse->x3 = -vector->x3;
|
reverse->x3 = -vector->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector3_make_reverse_fp64(const BgcVector3FP64* vector, BgcVector3FP64* reverse)
|
inline void bgc_vector3_get_reverse_fp64(const BgcVector3FP64* vector, BgcVector3FP64* reverse)
|
||||||
{
|
{
|
||||||
reverse->x1 = -vector->x1;
|
reverse->x1 = -vector->x1;
|
||||||
reverse->x2 = -vector->x2;
|
reverse->x2 = -vector->x2;
|
||||||
reverse->x3 = -vector->x3;
|
reverse->x3 = -vector->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============== Make Normalized =============== //
|
// =============== Get Normalized =============== //
|
||||||
|
|
||||||
inline int bgc_vector3_make_normalized_fp32(const BgcVector3FP32* vector, BgcVector3FP32* normalized)
|
inline int bgc_vector3_get_normalized_fp32(const BgcVector3FP32* vector, BgcVector3FP32* normalized)
|
||||||
{
|
{
|
||||||
bgc_vector3_copy_fp32(vector, normalized);
|
bgc_vector3_copy_fp32(vector, normalized);
|
||||||
return bgc_vector3_normalize_fp32(normalized);
|
return bgc_vector3_normalize_fp32(normalized);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int bgc_vector3_make_normalized_fp64(const BgcVector3FP64* vector, BgcVector3FP64* normalized)
|
inline int bgc_vector3_get_normalized_fp64(const BgcVector3FP64* vector, BgcVector3FP64* normalized)
|
||||||
{
|
{
|
||||||
bgc_vector3_copy_fp64(vector, normalized);
|
bgc_vector3_copy_fp64(vector, normalized);
|
||||||
return bgc_vector3_normalize_fp64(normalized);
|
return bgc_vector3_normalize_fp64(normalized);
|
||||||
|
@ -348,14 +348,14 @@ inline void bgc_vector3_divide_fp64(const BgcVector3FP64* dividend, const double
|
||||||
|
|
||||||
// ================== Average2 ================== //
|
// ================== Average2 ================== //
|
||||||
|
|
||||||
inline void bgc_vector3_mean_of_two_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result)
|
inline void bgc_vector3_get_mean_of_two_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
result->x1 = (vector1->x1 + vector2->x1) * 0.5f;
|
result->x1 = (vector1->x1 + vector2->x1) * 0.5f;
|
||||||
result->x2 = (vector1->x2 + vector2->x2) * 0.5f;
|
result->x2 = (vector1->x2 + vector2->x2) * 0.5f;
|
||||||
result->x3 = (vector1->x3 + vector2->x3) * 0.5f;
|
result->x3 = (vector1->x3 + vector2->x3) * 0.5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector3_mean_of_two_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result)
|
inline void bgc_vector3_get_mean_of_two_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
result->x1 = (vector1->x1 + vector2->x1) * 0.5;
|
result->x1 = (vector1->x1 + vector2->x1) * 0.5;
|
||||||
result->x2 = (vector1->x2 + vector2->x2) * 0.5;
|
result->x2 = (vector1->x2 + vector2->x2) * 0.5;
|
||||||
|
@ -364,14 +364,14 @@ inline void bgc_vector3_mean_of_two_fp64(const BgcVector3FP64* vector1, const Bg
|
||||||
|
|
||||||
// ================== Average3 ================== //
|
// ================== Average3 ================== //
|
||||||
|
|
||||||
inline void bgc_vector3_mean_of_three_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result)
|
inline void bgc_vector3_get_mean_of_three_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
result->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP32;
|
result->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP32;
|
||||||
result->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP32;
|
result->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP32;
|
||||||
result->x3 = (vector1->x3 + vector2->x3 + vector3->x3) * BGC_ONE_THIRD_FP32;
|
result->x3 = (vector1->x3 + vector2->x3 + vector3->x3) * BGC_ONE_THIRD_FP32;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector3_mean_of_three_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result)
|
inline void bgc_vector3_get_mean_of_three_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
result->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP64;
|
result->x1 = (vector1->x1 + vector2->x1 + vector3->x1) * BGC_ONE_THIRD_FP64;
|
||||||
result->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP64;
|
result->x2 = (vector1->x2 + vector2->x2 + vector3->x2) * BGC_ONE_THIRD_FP64;
|
||||||
|
@ -444,26 +444,26 @@ inline void bgc_vector3_maximize_fp64(const BgcVector3FP64* vector, BgcVector3FP
|
||||||
|
|
||||||
// =============== Scalar Product =============== //
|
// =============== Scalar Product =============== //
|
||||||
|
|
||||||
inline float bgc_vector3_scalar_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2)
|
inline float bgc_vector3_get_scalar_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2)
|
||||||
{
|
{
|
||||||
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2 + vector1->x3 * vector2->x3;
|
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2 + vector1->x3 * vector2->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double bgc_vector3_scalar_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2)
|
inline double bgc_vector3_get_scalar_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2)
|
||||||
{
|
{
|
||||||
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2 + vector1->x3 * vector2->x3;
|
return vector1->x1 * vector2->x1 + vector1->x2 * vector2->x2 + vector1->x3 * vector2->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Triple Product =============== //
|
// =============== Triple Product =============== //
|
||||||
|
|
||||||
inline float bgc_vector3_triple_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3)
|
inline float bgc_vector3_get_triple_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3)
|
||||||
{
|
{
|
||||||
return vector1->x1 * (vector2->x2 * vector3->x3 - vector2->x3 * vector3->x2)
|
return vector1->x1 * (vector2->x2 * vector3->x3 - vector2->x3 * vector3->x2)
|
||||||
+ vector1->x2 * (vector2->x3 * vector3->x1 - vector2->x1 * vector3->x3)
|
+ vector1->x2 * (vector2->x3 * vector3->x1 - vector2->x1 * vector3->x3)
|
||||||
+ vector1->x3 * (vector2->x1 * vector3->x2 - vector2->x2 * vector3->x1);
|
+ vector1->x3 * (vector2->x1 * vector3->x2 - vector2->x2 * vector3->x1);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline double bgc_vector3_triple_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3)
|
inline double bgc_vector3_get_triple_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3)
|
||||||
{
|
{
|
||||||
return vector1->x1 * (vector2->x2 * vector3->x3 - vector2->x3 * vector3->x2)
|
return vector1->x1 * (vector2->x2 * vector3->x3 - vector2->x3 * vector3->x2)
|
||||||
+ vector1->x2 * (vector2->x3 * vector3->x1 - vector2->x1 * vector3->x3)
|
+ vector1->x2 * (vector2->x3 * vector3->x1 - vector2->x1 * vector3->x3)
|
||||||
|
@ -472,7 +472,7 @@ inline double bgc_vector3_triple_product_fp64(const BgcVector3FP64* vector1, con
|
||||||
|
|
||||||
// =============== Cross Product ================ //
|
// =============== Cross Product ================ //
|
||||||
|
|
||||||
inline void bgc_vector3_cross_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result)
|
inline void bgc_vector3_get_cross_product_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
const float x1 = vector1->x2 * vector2->x3 - vector1->x3 * vector2->x2;
|
const float x1 = vector1->x2 * vector2->x3 - vector1->x3 * vector2->x2;
|
||||||
const float x2 = vector1->x3 * vector2->x1 - vector1->x1 * vector2->x3;
|
const float x2 = vector1->x3 * vector2->x1 - vector1->x1 * vector2->x3;
|
||||||
|
@ -483,7 +483,7 @@ inline void bgc_vector3_cross_product_fp32(const BgcVector3FP32* vector1, const
|
||||||
result->x3 = x3;
|
result->x3 = x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector3_cross_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result)
|
inline void bgc_vector3_get_cross_product_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
const double x1 = vector1->x2 * vector2->x3 - vector1->x3 * vector2->x2;
|
const double x1 = vector1->x2 * vector2->x3 - vector1->x3 * vector2->x2;
|
||||||
const double x2 = vector1->x3 * vector2->x1 - vector1->x1 * vector2->x3;
|
const double x2 = vector1->x3 * vector2->x1 - vector1->x1 * vector2->x3;
|
||||||
|
@ -496,20 +496,20 @@ inline void bgc_vector3_cross_product_fp64(const BgcVector3FP64* vector1, const
|
||||||
|
|
||||||
// ============ Double Cross Product ============ //
|
// ============ Double Cross Product ============ //
|
||||||
|
|
||||||
inline void bgc_vector3_double_cross_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result)
|
inline void bgc_vector3_get_double_cross_fp32(const BgcVector3FP32* vector1, const BgcVector3FP32* vector2, const BgcVector3FP32* vector3, BgcVector3FP32* result)
|
||||||
{
|
{
|
||||||
const float ac = bgc_vector3_scalar_product_fp32(vector1, vector3);
|
const float ac = bgc_vector3_get_scalar_product_fp32(vector1, vector3);
|
||||||
const float ab = bgc_vector3_scalar_product_fp32(vector1, vector2);
|
const float ab = bgc_vector3_get_scalar_product_fp32(vector1, vector2);
|
||||||
|
|
||||||
result->x1 = vector2->x1 * ac - vector3->x1 * ab;
|
result->x1 = vector2->x1 * ac - vector3->x1 * ab;
|
||||||
result->x2 = vector2->x2 * ac - vector3->x2 * ab;
|
result->x2 = vector2->x2 * ac - vector3->x2 * ab;
|
||||||
result->x3 = vector2->x3 * ac - vector3->x3 * ab;
|
result->x3 = vector2->x3 * ac - vector3->x3 * ab;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_vector3_double_cross_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result)
|
inline void bgc_vector3_get_double_cross_fp64(const BgcVector3FP64* vector1, const BgcVector3FP64* vector2, const BgcVector3FP64* vector3, BgcVector3FP64* result)
|
||||||
{
|
{
|
||||||
const double ac = bgc_vector3_scalar_product_fp64(vector1, vector3);
|
const double ac = bgc_vector3_get_scalar_product_fp64(vector1, vector3);
|
||||||
const double ab = bgc_vector3_scalar_product_fp64(vector1, vector2);
|
const double ab = bgc_vector3_get_scalar_product_fp64(vector1, vector2);
|
||||||
|
|
||||||
result->x1 = vector2->x1 * ac - vector3->x1 * ab;
|
result->x1 = vector2->x1 * ac - vector3->x1 * ab;
|
||||||
result->x2 = vector2->x2 * ac - vector3->x2 * ab;
|
result->x2 = vector2->x2 * ac - vector3->x2 * ab;
|
||||||
|
|
|
@ -40,20 +40,20 @@ extern inline void bgc_versor_combine_fp64(const BgcVersorFP64* second, const Bg
|
||||||
extern inline void bgc_versor_combine3_fp32(const BgcVersorFP32* third, const BgcVersorFP32* second, const BgcVersorFP32* first, BgcVersorFP32* result);
|
extern inline void bgc_versor_combine3_fp32(const BgcVersorFP32* third, const BgcVersorFP32* second, const BgcVersorFP32* first, BgcVersorFP32* result);
|
||||||
extern inline void bgc_versor_combine3_fp64(const BgcVersorFP64* third, const BgcVersorFP64* second, const BgcVersorFP64* first, BgcVersorFP64* result);
|
extern inline void bgc_versor_combine3_fp64(const BgcVersorFP64* third, const BgcVersorFP64* second, const BgcVersorFP64* first, BgcVersorFP64* result);
|
||||||
|
|
||||||
extern inline void bgc_versor_make_shortened_fp32(const BgcVersorFP32* versor, BgcVersorFP32* shortened);
|
extern inline void bgc_versor_get_shortened_fp32(const BgcVersorFP32* versor, BgcVersorFP32* shortened);
|
||||||
extern inline void bgc_versor_make_shortened_fp64(const BgcVersorFP64* versor, BgcVersorFP64* shortened);
|
extern inline void bgc_versor_get_shortened_fp64(const BgcVersorFP64* versor, BgcVersorFP64* shortened);
|
||||||
|
|
||||||
extern inline void bgc_versor_make_inverted_fp32(const BgcVersorFP32* versor, BgcVersorFP32* to);
|
extern inline void bgc_versor_get_inverted_fp32(const BgcVersorFP32* versor, BgcVersorFP32* to);
|
||||||
extern inline void bgc_versor_make_inverted_fp64(const BgcVersorFP64* versor, BgcVersorFP64* to);
|
extern inline void bgc_versor_get_inverted_fp64(const BgcVersorFP64* versor, BgcVersorFP64* to);
|
||||||
|
|
||||||
extern inline void bgc_versor_make_rotation_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix);
|
extern inline void bgc_versor_get_rotation_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix);
|
||||||
extern inline void bgc_versor_make_rotation_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix);
|
extern inline void bgc_versor_get_rotation_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix);
|
||||||
|
|
||||||
extern inline void bgc_versor_make_reverse_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix);
|
extern inline void bgc_versor_get_reverse_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix);
|
||||||
extern inline void bgc_versor_make_reverse_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix);
|
extern inline void bgc_versor_get_reverse_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix);
|
||||||
|
|
||||||
extern inline void bgc_versor_make_both_matrixes_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* rotation, BgcMatrix3x3FP32* reverse);
|
extern inline void bgc_versor_get_both_matrixes_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* rotation, BgcMatrix3x3FP32* reverse);
|
||||||
extern inline void bgc_versor_make_both_matrixes_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* rotation, BgcMatrix3x3FP64* reverse);
|
extern inline void bgc_versor_get_both_matrixes_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* rotation, BgcMatrix3x3FP64* reverse);
|
||||||
|
|
||||||
extern inline void bgc_versor_turn_vector_fp32(const BgcVersorFP32* versor, const BgcVector3FP32* vector, BgcVector3FP32* result);
|
extern inline void bgc_versor_turn_vector_fp32(const BgcVersorFP32* versor, const BgcVector3FP32* vector, BgcVector3FP32* result);
|
||||||
extern inline void bgc_versor_turn_vector_fp64(const BgcVersorFP64* versor, const BgcVector3FP64* vector, BgcVector3FP64* result);
|
extern inline void bgc_versor_turn_vector_fp64(const BgcVersorFP64* versor, const BgcVector3FP64* vector, BgcVector3FP64* result);
|
||||||
|
@ -155,9 +155,9 @@ void bgc_versor_set_turn_fp64(const double x1, const double x2, const double x3,
|
||||||
bgc_versor_set_values_fp64(cos(half_angle), x1 * multiplier, x2 * multiplier, x3 * multiplier, result);
|
bgc_versor_set_values_fp64(cos(half_angle), x1 * multiplier, x2 * multiplier, x3 * multiplier, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Make Rotation3 =============== //
|
// ================ Get Rotation ================ //
|
||||||
|
|
||||||
void bgc_versor_make_rotation_fp32(const BgcVersorFP32* versor, BgcRotation3FP32* result)
|
void bgc_versor_get_rotation_fp32(const BgcVersorFP32* versor, BgcRotation3FP32* result)
|
||||||
{
|
{
|
||||||
if (versor->s0 <= -(1.0f - BGC_EPSYLON_FP32) || 1.0f - BGC_EPSYLON_FP32 <= versor->s0) {
|
if (versor->s0 <= -(1.0f - BGC_EPSYLON_FP32) || 1.0f - BGC_EPSYLON_FP32 <= versor->s0) {
|
||||||
bgc_rotation3_reset_fp32(result);
|
bgc_rotation3_reset_fp32(result);
|
||||||
|
@ -181,7 +181,7 @@ void bgc_versor_make_rotation_fp32(const BgcVersorFP32* versor, BgcRotation3FP32
|
||||||
result->axis.x3 = versor->x3 * multiplier;
|
result->axis.x3 = versor->x3 * multiplier;
|
||||||
}
|
}
|
||||||
|
|
||||||
void bgc_versor_make_rotation_fp64(const BgcVersorFP64* versor, BgcRotation3FP64* result)
|
void bgc_versor_get_rotation_fp64(const BgcVersorFP64* versor, BgcRotation3FP64* result)
|
||||||
{
|
{
|
||||||
if (versor->s0 <= -(1.0 - BGC_EPSYLON_FP64) || 1.0 - BGC_EPSYLON_FP64 <= versor->s0) {
|
if (versor->s0 <= -(1.0 - BGC_EPSYLON_FP64) || 1.0 - BGC_EPSYLON_FP64 <= versor->s0) {
|
||||||
bgc_rotation3_reset_fp64(result);
|
bgc_rotation3_reset_fp64(result);
|
||||||
|
|
|
@ -320,15 +320,15 @@ inline void bgc_versor_combine3_fp64(const BgcVersorFP64* third, const BgcVersor
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Make Rotation3 =============== //
|
// ================ Get Rotation ================ //
|
||||||
|
|
||||||
void bgc_versor_make_rotation_fp32(const BgcVersorFP32* versor, BgcRotation3FP32* result);
|
void bgc_versor_get_rotation_fp32(const BgcVersorFP32* versor, BgcRotation3FP32* result);
|
||||||
|
|
||||||
void bgc_versor_make_rotation_fp64(const BgcVersorFP64* versor, BgcRotation3FP64* result);
|
void bgc_versor_get_rotation_fp64(const BgcVersorFP64* versor, BgcRotation3FP64* result);
|
||||||
|
|
||||||
// =============== Make Shortened =============== //
|
// =============== Get Shortened ================ //
|
||||||
|
|
||||||
inline void bgc_versor_make_shortened_fp32(const BgcVersorFP32* versor, BgcVersorFP32* shortened)
|
inline void bgc_versor_get_shortened_fp32(const BgcVersorFP32* versor, BgcVersorFP32* shortened)
|
||||||
{
|
{
|
||||||
_BgcDarkTwinVersorFP32* twin = (_BgcDarkTwinVersorFP32*)shortened;
|
_BgcDarkTwinVersorFP32* twin = (_BgcDarkTwinVersorFP32*)shortened;
|
||||||
|
|
||||||
|
@ -346,7 +346,7 @@ inline void bgc_versor_make_shortened_fp32(const BgcVersorFP32* versor, BgcVerso
|
||||||
twin->x3 = -versor->x3;
|
twin->x3 = -versor->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_versor_make_shortened_fp64(const BgcVersorFP64* versor, BgcVersorFP64* shortened)
|
inline void bgc_versor_get_shortened_fp64(const BgcVersorFP64* versor, BgcVersorFP64* shortened)
|
||||||
{
|
{
|
||||||
_BgcDarkTwinVersorFP64* twin = (_BgcDarkTwinVersorFP64*)shortened;
|
_BgcDarkTwinVersorFP64* twin = (_BgcDarkTwinVersorFP64*)shortened;
|
||||||
|
|
||||||
|
@ -364,9 +364,9 @@ inline void bgc_versor_make_shortened_fp64(const BgcVersorFP64* versor, BgcVerso
|
||||||
twin->x3 = -versor->x3;
|
twin->x3 = -versor->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============== Make Inverted ================ //
|
// ================ Get Inverted ================ //
|
||||||
|
|
||||||
inline void bgc_versor_make_inverted_fp32(const BgcVersorFP32* versor, BgcVersorFP32* to)
|
inline void bgc_versor_get_inverted_fp32(const BgcVersorFP32* versor, BgcVersorFP32* to)
|
||||||
{
|
{
|
||||||
_BgcDarkTwinVersorFP32* twin = (_BgcDarkTwinVersorFP32*)to;
|
_BgcDarkTwinVersorFP32* twin = (_BgcDarkTwinVersorFP32*)to;
|
||||||
twin->s0 = versor->s0;
|
twin->s0 = versor->s0;
|
||||||
|
@ -375,7 +375,7 @@ inline void bgc_versor_make_inverted_fp32(const BgcVersorFP32* versor, BgcVersor
|
||||||
twin->x3 = -versor->x3;
|
twin->x3 = -versor->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_versor_make_inverted_fp64(const BgcVersorFP64* versor, BgcVersorFP64* to)
|
inline void bgc_versor_get_inverted_fp64(const BgcVersorFP64* versor, BgcVersorFP64* to)
|
||||||
{
|
{
|
||||||
_BgcDarkTwinVersorFP64* twin = (_BgcDarkTwinVersorFP64*)to;
|
_BgcDarkTwinVersorFP64* twin = (_BgcDarkTwinVersorFP64*)to;
|
||||||
twin->s0 = versor->s0;
|
twin->s0 = versor->s0;
|
||||||
|
@ -384,9 +384,9 @@ inline void bgc_versor_make_inverted_fp64(const BgcVersorFP64* versor, BgcVersor
|
||||||
twin->x3 = -versor->x3;
|
twin->x3 = -versor->x3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========== Make Rotation Matrix3x3 ========== //
|
// ============ Get Rotation Matrix ============= //
|
||||||
|
|
||||||
inline void bgc_versor_make_rotation_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix)
|
inline void bgc_versor_get_rotation_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix)
|
||||||
{
|
{
|
||||||
const float s0s0 = versor->s0 * versor->s0;
|
const float s0s0 = versor->s0 * versor->s0;
|
||||||
const float x1x1 = versor->x1 * versor->x1;
|
const float x1x1 = versor->x1 * versor->x1;
|
||||||
|
@ -414,7 +414,7 @@ inline void bgc_versor_make_rotation_matrix_fp32(const BgcVersorFP32* versor, Bg
|
||||||
matrix->r1c3 = x1x3 + s0x2;
|
matrix->r1c3 = x1x3 + s0x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_versor_make_rotation_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix)
|
inline void bgc_versor_get_rotation_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix)
|
||||||
{
|
{
|
||||||
const double s0s0 = versor->s0 * versor->s0;
|
const double s0s0 = versor->s0 * versor->s0;
|
||||||
const double x1x1 = versor->x1 * versor->x1;
|
const double x1x1 = versor->x1 * versor->x1;
|
||||||
|
@ -442,9 +442,9 @@ inline void bgc_versor_make_rotation_matrix_fp64(const BgcVersorFP64* versor, Bg
|
||||||
matrix->r1c3 = x1x3 + s0x2;
|
matrix->r1c3 = x1x3 + s0x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// =========== Make Reverse Matrix3x3 =========== //
|
// ============= Get Reverse Matrix ============= //
|
||||||
|
|
||||||
inline void bgc_versor_make_reverse_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix)
|
inline void bgc_versor_get_reverse_matrix_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* matrix)
|
||||||
{
|
{
|
||||||
const float s0s0 = versor->s0 * versor->s0;
|
const float s0s0 = versor->s0 * versor->s0;
|
||||||
const float x1x1 = versor->x1 * versor->x1;
|
const float x1x1 = versor->x1 * versor->x1;
|
||||||
|
@ -472,7 +472,7 @@ inline void bgc_versor_make_reverse_matrix_fp32(const BgcVersorFP32* versor, Bgc
|
||||||
matrix->r1c3 = x1x3 - s0x2;
|
matrix->r1c3 = x1x3 - s0x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_versor_make_reverse_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix)
|
inline void bgc_versor_get_reverse_matrix_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* matrix)
|
||||||
{
|
{
|
||||||
const double s0s0 = versor->s0 * versor->s0;
|
const double s0s0 = versor->s0 * versor->s0;
|
||||||
const double x1x1 = versor->x1 * versor->x1;
|
const double x1x1 = versor->x1 * versor->x1;
|
||||||
|
@ -500,18 +500,18 @@ inline void bgc_versor_make_reverse_matrix_fp64(const BgcVersorFP64* versor, Bgc
|
||||||
matrix->r1c3 = x1x3 - s0x2;
|
matrix->r1c3 = x1x3 - s0x2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ============= Make Both Matrixes ============= //
|
// ============= Get Both Matrixes ============== //
|
||||||
|
|
||||||
inline void bgc_versor_make_both_matrixes_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* rotation, BgcMatrix3x3FP32* reverse)
|
inline void bgc_versor_get_both_matrixes_fp32(const BgcVersorFP32* versor, BgcMatrix3x3FP32* rotation, BgcMatrix3x3FP32* reverse)
|
||||||
{
|
{
|
||||||
bgc_versor_make_reverse_matrix_fp32(versor, reverse);
|
bgc_versor_get_reverse_matrix_fp32(versor, reverse);
|
||||||
bgc_matrix3x3_make_transposed_fp32(reverse, rotation);
|
bgc_matrix3x3_get_transposed_fp32(reverse, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void bgc_versor_make_both_matrixes_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* rotation, BgcMatrix3x3FP64* reverse)
|
inline void bgc_versor_get_both_matrixes_fp64(const BgcVersorFP64* versor, BgcMatrix3x3FP64* rotation, BgcMatrix3x3FP64* reverse)
|
||||||
{
|
{
|
||||||
bgc_versor_make_reverse_matrix_fp64(versor, reverse);
|
bgc_versor_get_reverse_matrix_fp64(versor, reverse);
|
||||||
bgc_matrix3x3_make_transposed_fp64(reverse, rotation);
|
bgc_matrix3x3_get_transposed_fp64(reverse, rotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ================ Turn Vector ================= //
|
// ================ Turn Vector ================= //
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue