Отказ от терминов Versor и Cotes Number в пользу Turn3 и Turn2, использование кватернионов внутри Turn3
This commit is contained in:
parent
38cff7e27d
commit
b470a3194b
27 changed files with 1815 additions and 2045 deletions
|
|
@ -273,6 +273,32 @@ inline void bgc_fp64_quaternion_get_product(BGC_FP64_Quaternion* product, const
|
|||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_quaternion_get_product_by_conjugate(BGC_FP32_Quaternion* product, const BGC_FP32_Quaternion* left, const BGC_FP32_Quaternion* 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_get_product_by_conjugate(BGC_FP64_Quaternion* product, const BGC_FP64_Quaternion* left, const BGC_FP64_Quaternion* 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;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_quaternion_multiply(BGC_FP32_Quaternion* product, const BGC_FP32_Quaternion* multiplicand, const float multipier)
|
||||
{
|
||||
product->s0 = multiplicand->s0 * multipier;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue