Добавление дополнительных операций умножения кватернионов, переименование функций для единообразия названий
This commit is contained in:
parent
078512c3d5
commit
d83ab7160d
18 changed files with 379 additions and 177 deletions
|
|
@ -45,23 +45,23 @@ extern inline void bgc_fp64_dual_number_subtract(BGC_FP64_DualNumber* const diff
|
|||
extern inline void bgc_fp32_dual_number_subtract_scaled(BGC_FP32_DualNumber* const difference, const BGC_FP32_DualNumber* const base_number, const BGC_FP32_DualNumber* const scalable_number, const float scale);
|
||||
extern inline void bgc_fp64_dual_number_subtract_scaled(BGC_FP64_DualNumber* const difference, const BGC_FP64_DualNumber* const base_number, const BGC_FP64_DualNumber* const scalable_number, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_dual_number_multiply_by_real(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_dual_number_multiply_by_real(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const double multiplier);
|
||||
extern inline void bgc_fp32_dual_number_multiply_by_real_number(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_dual_number_multiply_by_real_number(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_dual_number_multiply_by_dual(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier);
|
||||
extern inline void bgc_fp64_dual_number_multiply_by_dual(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier);
|
||||
extern inline void bgc_fp32_dual_number_multiply_by_dual_number(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier);
|
||||
extern inline void bgc_fp64_dual_number_multiply_by_dual_number(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier);
|
||||
|
||||
extern inline void bgc_fp32_dual_number_multiply_by_conjugate(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier_to_conjugate);
|
||||
extern inline void bgc_fp64_dual_number_multiply_by_conjugate(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier_to_conjugate);
|
||||
extern inline void bgc_fp32_dual_number_multiply_by_conjugate_dual_number(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier_to_conjugate);
|
||||
extern inline void bgc_fp64_dual_number_multiply_by_conjugate_dual_number(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier_to_conjugate);
|
||||
|
||||
extern inline int bgc_fp32_dual_number_divide_by_real(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_dual_number_divide_by_real(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const double divisor);
|
||||
extern inline int bgc_fp32_dual_number_divide_by_real_number(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_dual_number_divide_by_real_number(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const double divisor);
|
||||
|
||||
extern inline int bgc_fp32_dual_number_divide_by_dual(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor);
|
||||
extern inline int bgc_fp64_dual_number_divide_by_dual(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor);
|
||||
extern inline int bgc_fp32_dual_number_divide_by_dual_number(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor);
|
||||
extern inline int bgc_fp64_dual_number_divide_by_dual_number(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor);
|
||||
|
||||
extern inline int bgc_fp32_dual_number_divide_by_conjugate(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor_to_conjugate);
|
||||
extern inline int bgc_fp64_dual_number_divide_by_conjugate(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor_to_conjugate);
|
||||
extern inline int bgc_fp32_dual_number_divide_by_conjugate_dual_number(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor_to_conjugate);
|
||||
extern inline int bgc_fp64_dual_number_divide_by_conjugate_dual_number(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor_to_conjugate);
|
||||
|
||||
extern inline void bgc_fp32_dual_number_get_mean2(BGC_FP32_DualNumber* const mean, const BGC_FP32_DualNumber* const first, const BGC_FP32_DualNumber* const second);
|
||||
extern inline void bgc_fp64_dual_number_get_mean2(BGC_FP64_DualNumber* const mean, const BGC_FP64_DualNumber* const first, const BGC_FP64_DualNumber* const second);
|
||||
|
|
|
|||
|
|
@ -264,19 +264,19 @@ inline void bgc_fp64_dual_number_subtract_scaled(BGC_FP64_DualNumber* const diff
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_dual_number_multiply_by_real(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_dual_number_multiply_by_real_number(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const float multiplier)
|
||||
{
|
||||
product->real_part = multiplicand->real_part * multiplier;
|
||||
product->dual_part = multiplicand->dual_part * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_number_multiply_by_real(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_dual_number_multiply_by_real_number(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->real_part = multiplicand->real_part * multiplier;
|
||||
product->dual_part = multiplicand->dual_part * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_dual_number_multiply_by_dual(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier)
|
||||
inline void bgc_fp32_dual_number_multiply_by_dual_number(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier)
|
||||
{
|
||||
const float real_part = multiplicand->real_part * multiplier->real_part;
|
||||
const float dual_part = multiplicand->dual_part * multiplier->real_part + multiplicand->real_part * multiplier->dual_part;
|
||||
|
|
@ -285,7 +285,7 @@ inline void bgc_fp32_dual_number_multiply_by_dual(BGC_FP32_DualNumber* const pro
|
|||
product->dual_part = dual_part;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_number_multiply_by_dual(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier)
|
||||
inline void bgc_fp64_dual_number_multiply_by_dual_number(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier)
|
||||
{
|
||||
const double real_part = multiplicand->real_part * multiplier->real_part;
|
||||
const double dual_part = multiplicand->dual_part * multiplier->real_part + multiplicand->real_part * multiplier->dual_part;
|
||||
|
|
@ -294,7 +294,7 @@ inline void bgc_fp64_dual_number_multiply_by_dual(BGC_FP64_DualNumber* const pro
|
|||
product->dual_part = dual_part;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_dual_number_multiply_by_conjugate(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier_to_conjugate)
|
||||
inline void bgc_fp32_dual_number_multiply_by_conjugate_dual_number(BGC_FP32_DualNumber* const product, const BGC_FP32_DualNumber* const multiplicand, const BGC_FP32_DualNumber* const multiplier_to_conjugate)
|
||||
{
|
||||
const float real_part = multiplicand->real_part * multiplier_to_conjugate->real_part;
|
||||
const float dual_part = multiplicand->dual_part * multiplier_to_conjugate->real_part - multiplicand->real_part * multiplier_to_conjugate->dual_part;
|
||||
|
|
@ -303,7 +303,7 @@ inline void bgc_fp32_dual_number_multiply_by_conjugate(BGC_FP32_DualNumber* cons
|
|||
product->dual_part = dual_part;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_number_multiply_by_conjugate(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier_to_conjugate)
|
||||
inline void bgc_fp64_dual_number_multiply_by_conjugate_dual_number(BGC_FP64_DualNumber* const product, const BGC_FP64_DualNumber* const multiplicand, const BGC_FP64_DualNumber* const multiplier_to_conjugate)
|
||||
{
|
||||
const double real_part = multiplicand->real_part * multiplier_to_conjugate->real_part;
|
||||
const double dual_part = multiplicand->dual_part * multiplier_to_conjugate->real_part - multiplicand->real_part * multiplier_to_conjugate->dual_part;
|
||||
|
|
@ -314,27 +314,27 @@ inline void bgc_fp64_dual_number_multiply_by_conjugate(BGC_FP64_DualNumber* cons
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_dual_number_divide_by_real(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const float divisor)
|
||||
inline int bgc_fp32_dual_number_divide_by_real_number(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp32_dual_number_multiply_by_real(quotient, dividend, 1.0f / divisor);
|
||||
bgc_fp32_dual_number_multiply_by_real_number(quotient, dividend, 1.0f / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_dual_number_divide_by_real(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const double divisor)
|
||||
inline int bgc_fp64_dual_number_divide_by_real_number(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp64_dual_number_multiply_by_real(quotient, dividend, 1.0 / divisor);
|
||||
bgc_fp64_dual_number_multiply_by_real_number(quotient, dividend, 1.0 / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp32_dual_number_divide_by_dual(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor)
|
||||
inline int bgc_fp32_dual_number_divide_by_dual_number(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor->real_part)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -351,7 +351,7 @@ inline int bgc_fp32_dual_number_divide_by_dual(BGC_FP32_DualNumber* const quotie
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_dual_number_divide_by_dual(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor)
|
||||
inline int bgc_fp64_dual_number_divide_by_dual_number(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor->real_part)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -368,7 +368,7 @@ inline int bgc_fp64_dual_number_divide_by_dual(BGC_FP64_DualNumber* const quotie
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp32_dual_number_divide_by_conjugate(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor_to_conjugate)
|
||||
inline int bgc_fp32_dual_number_divide_by_conjugate_dual_number(BGC_FP32_DualNumber* const quotient, const BGC_FP32_DualNumber* const dividend, const BGC_FP32_DualNumber* const divisor_to_conjugate)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor_to_conjugate->real_part)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -385,7 +385,7 @@ inline int bgc_fp32_dual_number_divide_by_conjugate(BGC_FP32_DualNumber* const q
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_dual_number_divide_by_conjugate(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor_to_conjugate)
|
||||
inline int bgc_fp64_dual_number_divide_by_conjugate_dual_number(BGC_FP64_DualNumber* const quotient, const BGC_FP64_DualNumber* const dividend, const BGC_FP64_DualNumber* const divisor_to_conjugate)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor_to_conjugate->real_part)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
|
|||
|
|
@ -39,6 +39,12 @@ extern inline void bgc_fp64_dual_vector3_multiply_by_dual_number(BGC_FP64_DualVe
|
|||
extern inline void bgc_fp32_dual_vector3_multiply_by_conjugate_dual_number(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const multiplicand, const BGC_FP32_DualNumber* const multiplier_to_conjugate);
|
||||
extern inline void bgc_fp64_dual_vector3_multiply_by_conjugate_dual_number(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const multiplicand, const BGC_FP64_DualNumber* const multiplier_to_conjugate);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_multiply_by_matrix3x3(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const vector, const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline void bgc_fp64_dual_vector3_multiply_by_matrix3x3(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const vector, const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline void _bgc_fp32_restrict_dual_vector3_multiply_by_matrix3x3(BGC_FP32_DualVector3* restrict const product, const BGC_FP32_DualVector3* const vector, const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline void _bgc_fp64_restrict_dual_vector3_multiply_by_matrix3x3(BGC_FP64_DualVector3* restrict const product, const BGC_FP64_DualVector3* const vector, const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_dual_vector3_divide_by_real_number(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_dual_vector3_divide_by_real_number(BGC_FP64_DualVector3* const quotient, const BGC_FP64_DualVector3* const dividend, const double divisor);
|
||||
|
||||
|
|
|
|||
|
|
@ -206,6 +206,70 @@ inline void bgc_fp64_dual_vector3_multiply_by_conjugate_dual_number(BGC_FP64_Dua
|
|||
bgc_fp64_vector3_copy(&product->dual_part, &dual_part);
|
||||
}
|
||||
|
||||
// ========== Left Dual Vector Product ========== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_multiply_by_matrix3x3(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const vector, const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
const float real_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
const float real_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
const float real_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
|
||||
const float dual_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
const float dual_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
const float dual_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_multiply_by_matrix3x3(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const vector, const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
const double real_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
const double real_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
const double real_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
|
||||
const double dual_x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
const double dual_x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
const double dual_x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
}
|
||||
|
||||
// ===== Restrict Left Dual Vector Product ====== //
|
||||
|
||||
inline void _bgc_fp32_restrict_dual_vector3_multiply_by_matrix3x3(BGC_FP32_DualVector3* restrict const product, const BGC_FP32_DualVector3* const vector, const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
|
||||
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_restrict_dual_vector3_multiply_by_matrix3x3(BGC_FP64_DualVector3* restrict const product, const BGC_FP64_DualVector3* const vector, const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
|
||||
product->real_part.x1 = vector->real_part.x1 * matrix->r1c1 + vector->real_part.x2 * matrix->r2c1 + vector->real_part.x3 * matrix->r3c1;
|
||||
product->real_part.x2 = vector->real_part.x1 * matrix->r1c2 + vector->real_part.x2 * matrix->r2c2 + vector->real_part.x3 * matrix->r3c2;
|
||||
product->real_part.x3 = vector->real_part.x1 * matrix->r1c3 + vector->real_part.x2 * matrix->r2c3 + vector->real_part.x3 * matrix->r3c3;
|
||||
}
|
||||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_dual_vector3_divide_by_real_number(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const float divisor)
|
||||
|
|
|
|||
|
|
@ -69,8 +69,8 @@ extern inline void bgc_fp64_matrix2x2_subtract(BGC_FP64_Matrix2x2* const differe
|
|||
extern inline void bgc_fp32_matrix2x2_subtract_scaled(BGC_FP32_Matrix2x2* const difference, const BGC_FP32_Matrix2x2* const basic_matrix, const BGC_FP32_Matrix2x2* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x2_subtract_scaled(BGC_FP64_Matrix2x2* const difference, const BGC_FP64_Matrix2x2* const basic_matrix, const BGC_FP64_Matrix2x2* const scalable_matrix, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_real(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_real(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const multiplicand, const double multiplier);
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_real_number(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_real_number(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_vector2(BGC_FP32_Vector2* const product, const BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Vector2* const vector);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* const product, const BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Vector2* const vector);
|
||||
|
|
@ -84,8 +84,8 @@ extern inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2*
|
|||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x2_divide_by_real(BGC_FP32_Matrix2x2* const quotient, const BGC_FP32_Matrix2x2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x2_divide_by_real(BGC_FP64_Matrix2x2* const quotient, const BGC_FP64_Matrix2x2* const dividend, const double divisor);
|
||||
extern inline int bgc_fp32_matrix2x2_divide_by_real_number(BGC_FP32_Matrix2x2* const quotient, const BGC_FP32_Matrix2x2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x2_divide_by_real_number(BGC_FP64_Matrix2x2* const quotient, const BGC_FP64_Matrix2x2* const dividend, const double divisor);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_get_mean2(BGC_FP32_Matrix2x2* const mean, const BGC_FP32_Matrix2x2* const term1, const BGC_FP32_Matrix2x2* const term2);
|
||||
extern inline void bgc_fp64_matrix2x2_get_mean2(BGC_FP64_Matrix2x2* const mean, const BGC_FP64_Matrix2x2* const term1, const BGC_FP64_Matrix2x2* const term2);
|
||||
|
|
|
|||
|
|
@ -559,7 +559,7 @@ inline void bgc_fp64_matrix2x2_subtract_scaled(BGC_FP64_Matrix2x2* const differe
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_real(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_real_number(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const multiplicand, const float multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -568,7 +568,7 @@ inline void bgc_fp32_matrix2x2_multiply_by_real(BGC_FP32_Matrix2x2* const produc
|
|||
product->r2c2 = multiplicand->r2c2 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_real(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_real_number(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -685,23 +685,23 @@ inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* const p
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_divide_by_real(BGC_FP32_Matrix2x2* const quotient, const BGC_FP32_Matrix2x2* const dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix2x2_divide_by_real_number(BGC_FP32_Matrix2x2* const quotient, const BGC_FP32_Matrix2x2* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp32_matrix2x2_multiply_by_real(quotient, dividend, 1.0f / divisor);
|
||||
bgc_fp32_matrix2x2_multiply_by_real_number(quotient, dividend, 1.0f / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x2_divide_by_real(BGC_FP64_Matrix2x2* const quotient, const BGC_FP64_Matrix2x2* const dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix2x2_divide_by_real_number(BGC_FP64_Matrix2x2* const quotient, const BGC_FP64_Matrix2x2* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp64_matrix2x2_multiply_by_real(quotient, dividend, 1.0 / divisor);
|
||||
bgc_fp64_matrix2x2_multiply_by_real_number(quotient, dividend, 1.0 / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ extern inline void bgc_fp64_matrix2x3_subtract(BGC_FP64_Matrix2x3* const differe
|
|||
extern inline void bgc_fp32_matrix2x3_subtract_scaled(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const basic_matrix, const BGC_FP32_Matrix2x3* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x3_subtract_scaled(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const basic_matrix, const BGC_FP64_Matrix2x3* const scalable_matrix, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_real(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_real(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const multiplicand, const double multiplier);
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_real_number(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_real_number(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_vector2(BGC_FP32_Vector3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Vector2* const vector);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_vector2(BGC_FP64_Vector3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Vector2* const vector);
|
||||
|
|
@ -51,8 +51,8 @@ extern inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3*
|
|||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix3x2* const matrix2);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x3_divide_by_real(BGC_FP32_Matrix2x3* const quotient, const BGC_FP32_Matrix2x3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x3_divide_by_real(BGC_FP64_Matrix2x3* const quotient, const BGC_FP64_Matrix2x3* const dividend, const double divisor);
|
||||
extern inline int bgc_fp32_matrix2x3_divide_by_real_number(BGC_FP32_Matrix2x3* const quotient, const BGC_FP32_Matrix2x3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x3_divide_by_real_number(BGC_FP64_Matrix2x3* const quotient, const BGC_FP64_Matrix2x3* const dividend, const double divisor);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_get_mean2(BGC_FP32_Matrix2x3* const mean, const BGC_FP32_Matrix2x3* const term1, const BGC_FP32_Matrix2x3* const term2);
|
||||
extern inline void bgc_fp64_matrix2x3_get_mean2(BGC_FP64_Matrix2x3* const mean, const BGC_FP64_Matrix2x3* const term1, const BGC_FP64_Matrix2x3* const term2);
|
||||
|
|
|
|||
|
|
@ -438,7 +438,7 @@ inline void bgc_fp64_matrix2x3_subtract_scaled(BGC_FP64_Matrix2x3* const sum, co
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_real(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_real_number(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const multiplicand, const float multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -450,7 +450,7 @@ inline void bgc_fp32_matrix2x3_multiply_by_real(BGC_FP32_Matrix2x3* const produc
|
|||
product->r3c2 = multiplicand->r3c2 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_real(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_real_number(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -557,23 +557,23 @@ inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* const p
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix2x3_divide_by_real(BGC_FP32_Matrix2x3* const quotient, const BGC_FP32_Matrix2x3* const dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix2x3_divide_by_real_number(BGC_FP32_Matrix2x3* const quotient, const BGC_FP32_Matrix2x3* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp32_matrix2x3_multiply_by_real(quotient, dividend, 1.0f / divisor);
|
||||
bgc_fp32_matrix2x3_multiply_by_real_number(quotient, dividend, 1.0f / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x3_divide_by_real(BGC_FP64_Matrix2x3* const quotient, const BGC_FP64_Matrix2x3* const dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix2x3_divide_by_real_number(BGC_FP64_Matrix2x3* const quotient, const BGC_FP64_Matrix2x3* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp64_matrix2x3_multiply_by_real(quotient, dividend, 1.0 / divisor);
|
||||
bgc_fp64_matrix2x3_multiply_by_real_number(quotient, dividend, 1.0 / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ extern inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* const differe
|
|||
extern inline void bgc_fp32_matrix3x2_subtract_scaled(BGC_FP32_Matrix3x2* const difference, const BGC_FP32_Matrix3x2* const basic_matrix, const BGC_FP32_Matrix3x2* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* const difference, const BGC_FP64_Matrix3x2* const basic_matrix, const BGC_FP64_Matrix3x2* const scalable_matrix, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_real(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const multiplicand, const double multiplier);
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_real_number(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_real_number(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_vector3(BGC_FP32_Vector2* const product, const BGC_FP32_Matrix3x2* const matrix, const BGC_FP32_Vector3* const vector);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* const product, const BGC_FP64_Matrix3x2* const matrix, const BGC_FP64_Vector3* const vector);
|
||||
|
|
@ -51,8 +51,8 @@ extern inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2*
|
|||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x3* const matrix2);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* const quotient, const BGC_FP32_Matrix3x2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* const quotient, const BGC_FP64_Matrix3x2* const dividend, const double divisor);
|
||||
extern inline int bgc_fp32_matrix3x2_divide_by_real_number(BGC_FP32_Matrix3x2* const quotient, const BGC_FP32_Matrix3x2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x2_divide_by_real_number(BGC_FP64_Matrix3x2* const quotient, const BGC_FP64_Matrix3x2* const dividend, const double divisor);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* const mean, const BGC_FP32_Matrix3x2* const term1, const BGC_FP32_Matrix3x2* const term2);
|
||||
extern inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* const mean, const BGC_FP64_Matrix3x2* const term1, const BGC_FP64_Matrix3x2* const term2);
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* const differe
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_real(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_real_number(BGC_FP32_Matrix3x2* const product, const BGC_FP32_Matrix3x2* const multiplicand, const float multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -457,7 +457,7 @@ inline void bgc_fp32_matrix3x2_multiply_by_real(BGC_FP32_Matrix3x2* const produc
|
|||
product->r2c3 = multiplicand->r2c3 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_real_number(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -544,23 +544,23 @@ inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* const p
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* const quotient, const BGC_FP32_Matrix3x2* const dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix3x2_divide_by_real_number(BGC_FP32_Matrix3x2* const quotient, const BGC_FP32_Matrix3x2* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp32_matrix3x2_multiply_by_real(quotient, dividend, 1.0f / divisor);
|
||||
bgc_fp32_matrix3x2_multiply_by_real_number(quotient, dividend, 1.0f / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* const quotient, const BGC_FP64_Matrix3x2* const dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix3x2_divide_by_real_number(BGC_FP64_Matrix3x2* const quotient, const BGC_FP64_Matrix3x2* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp64_matrix3x2_multiply_by_real(quotient, dividend, 1.0 / divisor);
|
||||
bgc_fp64_matrix3x2_multiply_by_real_number(quotient, dividend, 1.0 / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,23 +63,29 @@ extern inline void bgc_fp64_matrix3x3_subtract(BGC_FP64_Matrix3x3* const differe
|
|||
extern inline void bgc_fp32_matrix3x3_subtract_scaled(BGC_FP32_Matrix3x3* const difference, const BGC_FP32_Matrix3x3* const basic_matrix, const BGC_FP32_Matrix3x3* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x3_subtract_scaled(BGC_FP64_Matrix3x3* const difference, const BGC_FP64_Matrix3x3* const basic_matrix, const BGC_FP64_Matrix3x3* const scalable_matrix, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_real(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix3x3* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_real(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const multiplicand, const double multiplier);
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_real_number(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix3x3* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_real_number(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_vector3(BGC_FP32_Vector3* const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Vector3* const vector);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Vector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_dual_vector3(BGC_FP32_DualVector3* const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_DualVector3* const vector);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_dual_vector3(BGC_FP64_DualVector3* const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_DualVector3* const vector);
|
||||
|
||||
extern inline void _bgc_fp32_restrict_matrix3x3_multiply_by_vector3(BGC_FP32_Vector3* restrict const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Vector3* const vector);
|
||||
extern inline void _bgc_fp64_restrict_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* restrict const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Vector3* const vector);
|
||||
|
||||
extern inline void _bgc_fp32_restrict_matrix3x3_multiply_by_dual_vector3(BGC_FP32_DualVector3* restrict const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_DualVector3* const vector);
|
||||
extern inline void _bgc_fp64_restrict_matrix3x3_multiply_by_dual_vector3(BGC_FP64_DualVector3* restrict const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_DualVector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_matrix2x3(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix2x3(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix2x3* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_multiply_by_matrix3x3(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix3x3(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix3x3* const matrix2);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x3_divide_by_real(BGC_FP32_Matrix3x3* const quotient, const BGC_FP32_Matrix3x3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x3_divide_by_real(BGC_FP64_Matrix3x3* const quotient, const BGC_FP64_Matrix3x3* const dividend, const double divisor);
|
||||
extern inline int bgc_fp32_matrix3x3_divide_by_real_number(BGC_FP32_Matrix3x3* const quotient, const BGC_FP32_Matrix3x3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x3_divide_by_real_number(BGC_FP64_Matrix3x3* const quotient, const BGC_FP64_Matrix3x3* const dividend, const double divisor);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_get_mean2(BGC_FP32_Matrix3x3* const mean, const BGC_FP32_Matrix3x3* const term1, const BGC_FP32_Matrix3x3* const term2);
|
||||
extern inline void bgc_fp64_matrix3x3_get_mean2(BGC_FP64_Matrix3x3* const mean, const BGC_FP64_Matrix3x3* const term1, const BGC_FP64_Matrix3x3* const term2);
|
||||
|
|
|
|||
|
|
@ -786,7 +786,7 @@ inline void bgc_fp64_matrix3x3_subtract_scaled(BGC_FP64_Matrix3x3* const differe
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_real(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix3x3* const multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_real_number(BGC_FP32_Matrix3x3* const product, const BGC_FP32_Matrix3x3* const multiplicand, const float multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -801,7 +801,7 @@ inline void bgc_fp32_matrix3x3_multiply_by_real(BGC_FP32_Matrix3x3* const produc
|
|||
product->r3c3 = multiplicand->r3c3 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_real(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_real_number(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -840,6 +840,46 @@ inline void bgc_fp64_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* const produ
|
|||
product->x3 = x3;
|
||||
}
|
||||
|
||||
// ========= Right Dual Vector Product ========== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_dual_vector3(BGC_FP32_DualVector3* const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_DualVector3* const vector)
|
||||
{
|
||||
const float real_x1 = matrix->r1c1 * vector->real_part.x1 + matrix->r1c2 * vector->real_part.x2 + matrix->r1c3 * vector->real_part.x3;
|
||||
const float real_x2 = matrix->r2c1 * vector->real_part.x1 + matrix->r2c2 * vector->real_part.x2 + matrix->r2c3 * vector->real_part.x3;
|
||||
const float real_x3 = matrix->r3c1 * vector->real_part.x1 + matrix->r3c2 * vector->real_part.x2 + matrix->r3c3 * vector->real_part.x3;
|
||||
|
||||
const float dual_x1 = matrix->r1c1 * vector->dual_part.x1 + matrix->r1c2 * vector->dual_part.x2 + matrix->r1c3 * vector->dual_part.x3;
|
||||
const float dual_x2 = matrix->r2c1 * vector->dual_part.x1 + matrix->r2c2 * vector->dual_part.x2 + matrix->r2c3 * vector->dual_part.x3;
|
||||
const float dual_x3 = matrix->r3c1 * vector->dual_part.x1 + matrix->r3c2 * vector->dual_part.x2 + matrix->r3c3 * vector->dual_part.x3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_dual_vector3(BGC_FP64_DualVector3* const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_DualVector3* const vector)
|
||||
{
|
||||
const double real_x1 = matrix->r1c1 * vector->real_part.x1 + matrix->r1c2 * vector->real_part.x2 + matrix->r1c3 * vector->real_part.x3;
|
||||
const double real_x2 = matrix->r2c1 * vector->real_part.x1 + matrix->r2c2 * vector->real_part.x2 + matrix->r2c3 * vector->real_part.x3;
|
||||
const double real_x3 = matrix->r3c1 * vector->real_part.x1 + matrix->r3c2 * vector->real_part.x2 + matrix->r3c3 * vector->real_part.x3;
|
||||
|
||||
const double dual_x1 = matrix->r1c1 * vector->dual_part.x1 + matrix->r1c2 * vector->dual_part.x2 + matrix->r1c3 * vector->dual_part.x3;
|
||||
const double dual_x2 = matrix->r2c1 * vector->dual_part.x1 + matrix->r2c2 * vector->dual_part.x2 + matrix->r2c3 * vector->dual_part.x3;
|
||||
const double dual_x3 = matrix->r3c1 * vector->dual_part.x1 + matrix->r3c2 * vector->dual_part.x2 + matrix->r3c3 * vector->dual_part.x3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
|
||||
product->real_part.x1 = real_x1;
|
||||
product->real_part.x2 = real_x2;
|
||||
product->real_part.x3 = real_x3;
|
||||
}
|
||||
|
||||
// ======= Restrict Right Vector Product ======== //
|
||||
|
||||
inline void _bgc_fp32_restrict_matrix3x3_multiply_by_vector3(BGC_FP32_Vector3* restrict const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Vector3* const vector)
|
||||
|
|
@ -856,6 +896,30 @@ inline void _bgc_fp64_restrict_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* r
|
|||
product->x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2 + matrix->r3c3 * vector->x3;
|
||||
}
|
||||
|
||||
// ========= Right Dual Vector Product ========== //
|
||||
|
||||
inline void _bgc_fp32_restrict_matrix3x3_multiply_by_dual_vector3(BGC_FP32_DualVector3* restrict const product, const BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_DualVector3* const vector)
|
||||
{
|
||||
product->real_part.x1 = matrix->r1c1 * vector->real_part.x1 + matrix->r1c2 * vector->real_part.x2 + matrix->r1c3 * vector->real_part.x3;
|
||||
product->real_part.x2 = matrix->r2c1 * vector->real_part.x1 + matrix->r2c2 * vector->real_part.x2 + matrix->r2c3 * vector->real_part.x3;
|
||||
product->real_part.x3 = matrix->r3c1 * vector->real_part.x1 + matrix->r3c2 * vector->real_part.x2 + matrix->r3c3 * vector->real_part.x3;
|
||||
|
||||
product->real_part.x1 = matrix->r1c1 * vector->dual_part.x1 + matrix->r1c2 * vector->dual_part.x2 + matrix->r1c3 * vector->dual_part.x3;
|
||||
product->real_part.x2 = matrix->r2c1 * vector->dual_part.x1 + matrix->r2c2 * vector->dual_part.x2 + matrix->r2c3 * vector->dual_part.x3;
|
||||
product->real_part.x3 = matrix->r3c1 * vector->dual_part.x1 + matrix->r3c2 * vector->dual_part.x2 + matrix->r3c3 * vector->dual_part.x3;
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_restrict_matrix3x3_multiply_by_dual_vector3(BGC_FP64_DualVector3* restrict const product, const BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_DualVector3* const vector)
|
||||
{
|
||||
product->real_part.x1 = matrix->r1c1 * vector->real_part.x1 + matrix->r1c2 * vector->real_part.x2 + matrix->r1c3 * vector->real_part.x3;
|
||||
product->real_part.x2 = matrix->r2c1 * vector->real_part.x1 + matrix->r2c2 * vector->real_part.x2 + matrix->r2c3 * vector->real_part.x3;
|
||||
product->real_part.x3 = matrix->r3c1 * vector->real_part.x1 + matrix->r3c2 * vector->real_part.x2 + matrix->r3c3 * vector->real_part.x3;
|
||||
|
||||
product->real_part.x1 = matrix->r1c1 * vector->dual_part.x1 + matrix->r1c2 * vector->dual_part.x2 + matrix->r1c3 * vector->dual_part.x3;
|
||||
product->real_part.x2 = matrix->r2c1 * vector->dual_part.x1 + matrix->r2c2 * vector->dual_part.x2 + matrix->r2c3 * vector->dual_part.x3;
|
||||
product->real_part.x3 = matrix->r3c1 * vector->dual_part.x1 + matrix->r3c2 * vector->dual_part.x2 + matrix->r3c3 * vector->dual_part.x3;
|
||||
}
|
||||
|
||||
// ========== Matrix Product 3x3 at 2x3 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_matrix2x3(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix2x3* const matrix2)
|
||||
|
|
@ -958,23 +1022,23 @@ inline void bgc_fp64_matrix3x3_multiply_by_matrix3x3(BGC_FP64_Matrix3x3* const p
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix3x3_divide_by_real(BGC_FP32_Matrix3x3* const quotient, const BGC_FP32_Matrix3x3* const dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix3x3_divide_by_real_number(BGC_FP32_Matrix3x3* const quotient, const BGC_FP32_Matrix3x3* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp32_matrix3x3_multiply_by_real(quotient, dividend, 1.0f / divisor);
|
||||
bgc_fp32_matrix3x3_multiply_by_real_number(quotient, dividend, 1.0f / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x3_divide_by_real(BGC_FP64_Matrix3x3* const quotient, const BGC_FP64_Matrix3x3* const dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix3x3_divide_by_real_number(BGC_FP64_Matrix3x3* const quotient, const BGC_FP64_Matrix3x3* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp64_matrix3x3_multiply_by_real(quotient, dividend, 1.0 / divisor);
|
||||
bgc_fp64_matrix3x3_multiply_by_real_number(quotient, dividend, 1.0 / divisor);
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,21 +52,27 @@ extern inline void bgc_fp64_quaternion_subtract_scaled(BGC_FP64_Quaternion* cons
|
|||
extern inline void bgc_fp32_quaternion_multiply_by_real_number(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_quaternion_multiply_by_real_number(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right);
|
||||
extern inline void bgc_fp64_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right);
|
||||
|
||||
extern inline void bgc_fp32_quaternion_multiply_by_dual_number(BGC_FP32_DualQuaternion* const product, const BGC_FP32_Quaternion* const multiplicand, const BGC_FP32_DualNumber* const multiplier);
|
||||
extern inline void bgc_fp64_quaternion_multiply_by_dual_number(BGC_FP64_DualQuaternion* const product, const BGC_FP64_Quaternion* const multiplicand, const BGC_FP64_DualNumber* const multiplier);
|
||||
|
||||
extern inline void _bgc_fp32_restrict_quaternion_multiply_by_dual_number(BGC_FP32_DualQuaternion* restrict const product, const BGC_FP32_Quaternion* const multiplicand, const BGC_FP32_DualNumber* const multiplier);
|
||||
extern inline void _bgc_fp64_restrict_quaternion_multiply_by_dual_number(BGC_FP64_DualQuaternion* restrict const product, const BGC_FP64_Quaternion* const multiplicand, const BGC_FP64_DualNumber* const multiplier);
|
||||
|
||||
extern inline void bgc_fp32_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right);
|
||||
extern inline void bgc_fp64_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right);
|
||||
|
||||
extern inline void bgc_fp32_quaternion_multiply_by_dual_quaternion(BGC_FP32_DualQuaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_DualQuaternion* const right);
|
||||
extern inline void bgc_fp64_quaternion_multiply_by_dual_quaternion(BGC_FP64_DualQuaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_DualQuaternion* const right);
|
||||
|
||||
extern inline void bgc_fp32_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right);
|
||||
extern inline void bgc_fp64_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right);
|
||||
|
||||
extern inline void bgc_fp32_conjugate_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right);
|
||||
extern inline void bgc_fp64_conjugate_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right);
|
||||
|
||||
extern inline void bgc_fp32_conjugate_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right);
|
||||
extern inline void bgc_fp64_conjugate_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right);
|
||||
|
||||
extern inline void _bgc_fp32_restrict_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* restrict const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right);
|
||||
extern inline void _bgc_fp64_restrict_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* restrict const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right);
|
||||
|
||||
|
|
|
|||
|
|
@ -298,98 +298,6 @@ inline void bgc_fp64_quaternion_multiply_by_real_number(BGC_FP64_Quaternion* con
|
|||
product->x3 = multiplicand->x3 * multiplier;
|
||||
}
|
||||
|
||||
// =========== Multiply By Quaternion =========== //
|
||||
|
||||
inline void bgc_fp32_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
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 x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
const float x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
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 x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
const double x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
// ====== Multiply By Conjugate Quaternion ====== //
|
||||
|
||||
inline void bgc_fp32_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
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->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
const float x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
const float x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
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->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
const double x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
const double x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
// ====== Restrict Multiply By Quaternion ======= //
|
||||
|
||||
inline void _bgc_fp32_restrict_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* restrict const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_restrict_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* restrict const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
}
|
||||
|
||||
// = Restrict Multiply By Conjugate Quaternion == //
|
||||
|
||||
inline void _bgc_fp32_restrict_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* restrict const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 + left->x1 * right->x1) + (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_restrict_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* restrict const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 + left->x1 * right->x1) + (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
}
|
||||
|
||||
// ========== Multiply By Dual Number =========== //
|
||||
|
||||
inline void bgc_fp32_quaternion_multiply_by_dual_number(BGC_FP32_DualQuaternion* const product, const BGC_FP32_Quaternion* const multiplicand, const BGC_FP32_DualNumber* const multiplier)
|
||||
|
|
@ -466,6 +374,154 @@ inline void _bgc_fp64_restrict_quaternion_multiply_by_dual_number(BGC_FP64_DualQ
|
|||
product->dual_part.x3 = multiplicand->x3 * multiplier->dual_part;
|
||||
}
|
||||
|
||||
// =========== Multiply By Quaternion =========== //
|
||||
|
||||
inline void bgc_fp32_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
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 x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
const float x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
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 x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
const double x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
// ====== Multiply By Conjugate Quaternion ====== //
|
||||
|
||||
inline void bgc_fp32_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
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->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
const float x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
const float x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
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->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
const double x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
const double x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
// ====== Multiply Conjugate By Quaternion ====== //
|
||||
|
||||
inline void bgc_fp32_conjugate_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
const float s0 = (left->s0 * right->s0 + left->x1 * right->x1) + (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
const float x1 = (left->s0 * right->x1 - left->x1 * right->s0) + (left->x3 * right->x2 - left->x2 * right->x3);
|
||||
const float x2 = (left->s0 * right->x2 - left->x2 * right->s0) + (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
const float x3 = (left->s0 * right->x3 - left->x3 * right->s0) + (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_conjugate_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
const double s0 = (left->s0 * right->s0 + left->x1 * right->x1) + (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
const double x1 = (left->s0 * right->x1 - left->x1 * right->s0) + (left->x3 * right->x2 - left->x2 * right->x3);
|
||||
const double x2 = (left->s0 * right->x2 - left->x2 * right->s0) + (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
const double x3 = (left->s0 * right->x3 - left->x3 * right->s0) + (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
// ====== Multiply Conjugate By Conjugate ======= //
|
||||
|
||||
inline void bgc_fp32_conjugate_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
const float s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
const float x1 = (left->x2 * right->x3 - left->x3 * right->x2) - (left->x1 * right->s0 + left->s0 * right->x1);
|
||||
const float x2 = (left->x3 * right->x1 - left->x1 * right->x3) - (left->x2 * right->s0 + left->s0 * right->x2);
|
||||
const float x3 = (left->x1 * right->x2 - left->x2 * right->x1) - (left->x3 * right->s0 + left->s0 * right->x3);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_conjugate_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
const double s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
const double x1 = (left->x2 * right->x3 - left->x3 * right->x2) - (left->x1 * right->s0 + left->s0 * right->x1);
|
||||
const double x2 = (left->x3 * right->x1 - left->x1 * right->x3) - (left->x2 * right->s0 + left->s0 * right->x2);
|
||||
const double x3 = (left->x1 * right->x2 - left->x2 * right->x1) - (left->x3 * right->s0 + left->s0 * right->x3);
|
||||
|
||||
product->s0 = s0;
|
||||
product->x1 = x1;
|
||||
product->x2 = x2;
|
||||
product->x3 = x3;
|
||||
}
|
||||
|
||||
// ====== Restrict Multiply By Quaternion ======= //
|
||||
|
||||
inline void _bgc_fp32_restrict_quaternion_multiply_by_quaternion(BGC_FP32_Quaternion* restrict const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_restrict_quaternion_multiply_by_quaternion(BGC_FP64_Quaternion* restrict const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 - left->x1 * right->x1) - (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->s0 * right->x1) - (left->x3 * right->x2 - left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->s0 * right->x2) - (left->x1 * right->x3 - left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->s0 * right->x3) - (left->x2 * right->x1 - left->x1 * right->x2);
|
||||
}
|
||||
|
||||
// = Restrict Multiply By Conjugate Quaternion == //
|
||||
|
||||
inline void _bgc_fp32_restrict_quaternion_multiply_by_conjugate(BGC_FP32_Quaternion* restrict const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 + left->x1 * right->x1) + (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
}
|
||||
|
||||
inline void _bgc_fp64_restrict_quaternion_multiply_by_conjugate(BGC_FP64_Quaternion* restrict const product, const BGC_FP64_Quaternion* const left, const BGC_FP64_Quaternion* const right)
|
||||
{
|
||||
product->s0 = (left->s0 * right->s0 + left->x1 * right->x1) + (left->x2 * right->x2 + left->x3 * right->x3);
|
||||
product->x1 = (left->x1 * right->s0 + left->x3 * right->x2) - (left->s0 * right->x1 + left->x2 * right->x3);
|
||||
product->x2 = (left->x2 * right->s0 + left->x1 * right->x3) - (left->s0 * right->x2 + left->x3 * right->x1);
|
||||
product->x3 = (left->x3 * right->s0 + left->x2 * right->x1) - (left->s0 * right->x3 + left->x1 * right->x2);
|
||||
}
|
||||
|
||||
// ======== Multiply By Dual Quaternion ========= //
|
||||
|
||||
inline void bgc_fp32_quaternion_multiply_by_dual_quaternion(BGC_FP32_DualQuaternion* const product, const BGC_FP32_Quaternion* const left, const BGC_FP32_DualQuaternion* const right)
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ extern inline void bgc_fp64_vector2_subtract(BGC_FP64_Vector2* const difference,
|
|||
extern inline void bgc_fp32_vector2_subtract_scaled(BGC_FP32_Vector2* const difference, const BGC_FP32_Vector2* const basic_vector, const BGC_FP32_Vector2* const scalable_vector, const float scale);
|
||||
extern inline void bgc_fp64_vector2_subtract_scaled(BGC_FP64_Vector2* const difference, const BGC_FP64_Vector2* const basic_vector, const BGC_FP64_Vector2* const scalable_vector, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_vector2_multiply_by_real(BGC_FP32_Vector2* const product, const BGC_FP32_Vector2* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_vector2_multiply_by_real(BGC_FP64_Vector2* const product, const BGC_FP64_Vector2* const multiplicand, const double multiplier);
|
||||
extern inline void bgc_fp32_vector2_multiply_by_real_number(BGC_FP32_Vector2* const product, const BGC_FP32_Vector2* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_vector2_multiply_by_real_number(BGC_FP64_Vector2* const product, const BGC_FP64_Vector2* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_vector2_multiply_by_matrix2x2(BGC_FP32_Vector2* const product, const BGC_FP32_Vector2* const vector, const BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline void bgc_fp64_vector2_multiply_by_matrix2x2(BGC_FP64_Vector2* const product, const BGC_FP64_Vector2* const vector, const BGC_FP64_Matrix2x2* const matrix);
|
||||
|
|
@ -48,8 +48,8 @@ extern inline void bgc_fp64_vector2_multiply_by_matrix2x2(BGC_FP64_Vector2* cons
|
|||
extern inline void bgc_fp32_vector2_multiply_by_matrix3x2(BGC_FP32_Vector3* const product, const BGC_FP32_Vector2* const vector, const BGC_FP32_Matrix3x2* const matrix);
|
||||
extern inline void bgc_fp64_vector2_multiply_by_matrix3x2(BGC_FP64_Vector3* const product, const BGC_FP64_Vector2* const vector, const BGC_FP64_Matrix3x2* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_vector2_divide_by_real(BGC_FP32_Vector2* const quotient, const BGC_FP32_Vector2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_vector2_divide_by_real(BGC_FP64_Vector2* const quotient, const BGC_FP64_Vector2* const dividend, const double divisor);
|
||||
extern inline int bgc_fp32_vector2_divide_by_real_number(BGC_FP32_Vector2* const quotient, const BGC_FP32_Vector2* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_vector2_divide_by_real_number(BGC_FP64_Vector2* const quotient, const BGC_FP64_Vector2* const dividend, const double divisor);
|
||||
|
||||
extern inline void bgc_fp32_vector2_get_mean2(BGC_FP32_Vector2* const mean, const BGC_FP32_Vector2* const vector1, const BGC_FP32_Vector2* const vector2);
|
||||
extern inline void bgc_fp64_vector2_get_mean2(BGC_FP64_Vector2* const mean, const BGC_FP64_Vector2* const vector1, const BGC_FP64_Vector2* const vector2);
|
||||
|
|
|
|||
|
|
@ -191,13 +191,13 @@ inline void bgc_fp64_vector2_subtract_scaled(BGC_FP64_Vector2* const difference,
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_vector2_multiply_by_real(BGC_FP32_Vector2* const product, const BGC_FP32_Vector2* const multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_vector2_multiply_by_real_number(BGC_FP32_Vector2* const product, const BGC_FP32_Vector2* const multiplicand, const float multiplier)
|
||||
{
|
||||
product->x1 = multiplicand->x1 * multiplier;
|
||||
product->x2 = multiplicand->x2 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_vector2_multiply_by_real(BGC_FP64_Vector2* const product, const BGC_FP64_Vector2* const multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_vector2_multiply_by_real_number(BGC_FP64_Vector2* const product, const BGC_FP64_Vector2* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->x1 = multiplicand->x1 * multiplier;
|
||||
product->x2 = multiplicand->x2 * multiplier;
|
||||
|
|
@ -241,24 +241,24 @@ inline void bgc_fp64_vector2_multiply_by_matrix3x2(BGC_FP64_Vector3* const produ
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_vector2_divide_by_real(BGC_FP32_Vector2* const quotient, const BGC_FP32_Vector2* const dividend, const float divisor)
|
||||
inline int bgc_fp32_vector2_divide_by_real_number(BGC_FP32_Vector2* const quotient, const BGC_FP32_Vector2* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp32_vector2_multiply_by_real(quotient, dividend, 1.0f / divisor);
|
||||
bgc_fp32_vector2_multiply_by_real_number(quotient, dividend, 1.0f / divisor);
|
||||
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_vector2_divide_by_real(BGC_FP64_Vector2* const quotient, const BGC_FP64_Vector2* const dividend, const double divisor)
|
||||
inline int bgc_fp64_vector2_divide_by_real_number(BGC_FP64_Vector2* const quotient, const BGC_FP64_Vector2* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor) || isnan(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
}
|
||||
|
||||
bgc_fp64_vector2_multiply_by_real(quotient, dividend, 1.0 / divisor);
|
||||
bgc_fp64_vector2_multiply_by_real_number(quotient, dividend, 1.0 / divisor);
|
||||
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
|
@ -391,7 +391,7 @@ inline int bgc_fp32_vector2_get_normalized(BGC_FP32_Vector2* const normalized, c
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
bgc_fp32_vector2_multiply_by_real(normalized, vector, sqrtf(1.0f / square_modulus));
|
||||
bgc_fp32_vector2_multiply_by_real_number(normalized, vector, sqrtf(1.0f / square_modulus));
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -409,7 +409,7 @@ inline int bgc_fp64_vector2_get_normalized(BGC_FP64_Vector2* const normalized, c
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
bgc_fp64_vector2_multiply_by_real(normalized, vector, sqrt(1.0 / square_modulus));
|
||||
bgc_fp64_vector2_multiply_by_real_number(normalized, vector, sqrt(1.0 / square_modulus));
|
||||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,8 +54,8 @@ extern inline void bgc_fp64_vector3_multiply_by_matrix2x3(BGC_FP64_Vector2* cons
|
|||
extern inline void bgc_fp32_vector3_multiply_by_matrix3x3(BGC_FP32_Vector3* const product, const BGC_FP32_Vector3* const vector, const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline void bgc_fp64_vector3_multiply_by_matrix3x3(BGC_FP64_Vector3* const product, const BGC_FP64_Vector3* const vector, const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_vector3_divide_by_real(BGC_FP32_Vector3* const quotient, const BGC_FP32_Vector3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_vector3_divide_by_real(BGC_FP64_Vector3* const quotient, const BGC_FP64_Vector3* const dividend, const double divisor);
|
||||
extern inline int bgc_fp32_vector3_divide_by_real_number(BGC_FP32_Vector3* const quotient, const BGC_FP32_Vector3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_vector3_divide_by_real_number(BGC_FP64_Vector3* const quotient, const BGC_FP64_Vector3* const dividend, const double divisor);
|
||||
|
||||