Добавление квалификатора const для запрета изменения указаелей внутри функций
This commit is contained in:
parent
610756ffed
commit
e6ac9023ec
24 changed files with 951 additions and 951 deletions
|
|
@ -1,31 +1,31 @@
|
|||
#include "./affine2.h"
|
||||
|
||||
extern inline void bgc_fp32_affine2_reset(BGC_FP32_Affine2* affine);
|
||||
extern inline void bgc_fp64_affine2_reset(BGC_FP64_Affine2* affine);
|
||||
extern inline void bgc_fp32_affine2_reset(BGC_FP32_Affine2* const affine);
|
||||
extern inline void bgc_fp64_affine2_reset(BGC_FP64_Affine2* const affine);
|
||||
|
||||
extern inline void bgc_fp32_affine2_make(BGC_FP32_Affine2* affine, const BGC_FP32_Matrix2x2* distortion, const BGC_FP32_Vector2* shift);
|
||||
extern inline void bgc_fp64_affine2_make(BGC_FP64_Affine2* affine, const BGC_FP64_Matrix2x2* distortion, const BGC_FP64_Vector2* shift);
|
||||
extern inline void bgc_fp32_affine2_make(BGC_FP32_Affine2* const affine, const BGC_FP32_Matrix2x2* const distortion, const BGC_FP32_Vector2* const shift);
|
||||
extern inline void bgc_fp64_affine2_make(BGC_FP64_Affine2* const affine, const BGC_FP64_Matrix2x2* const distortion, const BGC_FP64_Vector2* const shift);
|
||||
|
||||
extern inline void bgc_fp32_affine2_copy(BGC_FP32_Affine2* destination, const BGC_FP32_Affine2* source);
|
||||
extern inline void bgc_fp64_affine2_copy(BGC_FP64_Affine2* destination, const BGC_FP64_Affine2* source);
|
||||
extern inline void bgc_fp32_affine2_copy(BGC_FP32_Affine2* const destination, const BGC_FP32_Affine2* const source);
|
||||
extern inline void bgc_fp64_affine2_copy(BGC_FP64_Affine2* const destination, const BGC_FP64_Affine2* const source);
|
||||
|
||||
extern inline void bgc_fp32_affine2_swap(BGC_FP32_Affine2* first, BGC_FP32_Affine2* second);
|
||||
extern inline void bgc_fp64_affine2_swap(BGC_FP64_Affine2* first, BGC_FP64_Affine2* second);
|
||||
extern inline void bgc_fp32_affine2_swap(BGC_FP32_Affine2* const first, BGC_FP32_Affine2* const second);
|
||||
extern inline void bgc_fp64_affine2_swap(BGC_FP64_Affine2* const first, BGC_FP64_Affine2* const second);
|
||||
|
||||
extern inline void bgc_fp32_affine2_convert_to_fp64(BGC_FP64_Affine2* destination, const BGC_FP32_Affine2* source);
|
||||
extern inline void bgc_fp64_affine2_convert_to_fp32(BGC_FP32_Affine2* destination, const BGC_FP64_Affine2* source);
|
||||
extern inline void bgc_fp32_affine2_convert_to_fp64(BGC_FP64_Affine2* const destination, const BGC_FP32_Affine2* const source);
|
||||
extern inline void bgc_fp64_affine2_convert_to_fp32(BGC_FP32_Affine2* const destination, const BGC_FP64_Affine2* const source);
|
||||
|
||||
extern inline int bgc_fp32_affine2_invert(BGC_FP32_Affine2* affine);
|
||||
extern inline int bgc_fp64_affine2_invert(BGC_FP64_Affine2* affine);
|
||||
extern inline int bgc_fp32_affine2_invert(BGC_FP32_Affine2* const affine);
|
||||
extern inline int bgc_fp64_affine2_invert(BGC_FP64_Affine2* const affine);
|
||||
|
||||
extern inline int bgc_fp32_affine2_get_inverse(BGC_FP32_Affine2* inverse, const BGC_FP32_Affine2* affine);
|
||||
extern inline int bgc_fp64_affine2_get_inverse(BGC_FP64_Affine2* inverse, const BGC_FP64_Affine2* affine);
|
||||
extern inline int bgc_fp32_affine2_get_inverse(BGC_FP32_Affine2* const inverse, const BGC_FP32_Affine2* const affine);
|
||||
extern inline int bgc_fp64_affine2_get_inverse(BGC_FP64_Affine2* const inverse, const BGC_FP64_Affine2* const affine);
|
||||
|
||||
extern inline void bgc_fp32_affine2_combine(BGC_FP32_Affine2* combination, const BGC_FP32_Affine2* first, const BGC_FP32_Affine2* second);
|
||||
extern inline void bgc_fp64_affine2_combine(BGC_FP64_Affine2* combination, const BGC_FP64_Affine2* first, const BGC_FP64_Affine2* second);
|
||||
extern inline void bgc_fp32_affine2_combine(BGC_FP32_Affine2* const combination, const BGC_FP32_Affine2* const first, const BGC_FP32_Affine2* const second);
|
||||
extern inline void bgc_fp64_affine2_combine(BGC_FP64_Affine2* const combination, const BGC_FP64_Affine2* const first, const BGC_FP64_Affine2* const second);
|
||||
|
||||
extern inline void bgc_fp32_affine2_transform_point(BGC_FP32_Vector2* transformed_point, const BGC_FP32_Affine2* affine, const BGC_FP32_Vector2* initial_point);
|
||||
extern inline void bgc_fp64_affine2_transform_point(BGC_FP64_Vector2* transformed_point, const BGC_FP64_Affine2* affine, const BGC_FP64_Vector2* initial_point);
|
||||
extern inline void bgc_fp32_affine2_transform_point(BGC_FP32_Vector2* const transformed_point, const BGC_FP32_Affine2* const affine, const BGC_FP32_Vector2* const initial_point);
|
||||
extern inline void bgc_fp64_affine2_transform_point(BGC_FP64_Vector2* const transformed_point, const BGC_FP64_Affine2* const affine, const BGC_FP64_Vector2* const initial_point);
|
||||
|
||||
extern inline void bgc_fp32_affine2_transform_vector(BGC_FP32_Vector2* transformed_vector, const BGC_FP32_Affine2* affine, const BGC_FP32_Vector2* initial_vector);
|
||||
extern inline void bgc_fp64_affine2_transform_vector(BGC_FP64_Vector2* transformed_vector, const BGC_FP64_Affine2* affine, const BGC_FP64_Vector2* initial_vector);
|
||||
extern inline void bgc_fp32_affine2_transform_vector(BGC_FP32_Vector2* const transformed_vector, const BGC_FP32_Affine2* const affine, const BGC_FP32_Vector2* const initial_vector);
|
||||
extern inline void bgc_fp64_affine2_transform_vector(BGC_FP64_Vector2* const transformed_vector, const BGC_FP64_Affine2* const affine, const BGC_FP64_Vector2* const initial_vector);
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
// ==================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_affine2_reset(BGC_FP32_Affine2* affine)
|
||||
inline void bgc_fp32_affine2_reset(BGC_FP32_Affine2* const affine)
|
||||
{
|
||||
bgc_fp32_matrix2x2_make_identity(&affine->distortion);
|
||||
bgc_fp32_vector2_reset(&affine->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_reset(BGC_FP64_Affine2* affine)
|
||||
inline void bgc_fp64_affine2_reset(BGC_FP64_Affine2* const affine)
|
||||
{
|
||||
bgc_fp64_matrix2x2_make_identity(&affine->distortion);
|
||||
bgc_fp64_vector2_reset(&affine->shift);
|
||||
|
|
@ -21,13 +21,13 @@ inline void bgc_fp64_affine2_reset(BGC_FP64_Affine2* affine)
|
|||
|
||||
// ==================== Make ===================== //
|
||||
|
||||
inline void bgc_fp32_affine2_make(BGC_FP32_Affine2* affine, const BGC_FP32_Matrix2x2* distortion, const BGC_FP32_Vector2* shift)
|
||||
inline void bgc_fp32_affine2_make(BGC_FP32_Affine2* const affine, const BGC_FP32_Matrix2x2* const distortion, const BGC_FP32_Vector2* const shift)
|
||||
{
|
||||
bgc_fp32_matrix2x2_copy(&affine->distortion, distortion);
|
||||
bgc_fp32_vector2_copy(&affine->shift, shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_make(BGC_FP64_Affine2* affine, const BGC_FP64_Matrix2x2* distortion, const BGC_FP64_Vector2* shift)
|
||||
inline void bgc_fp64_affine2_make(BGC_FP64_Affine2* const affine, const BGC_FP64_Matrix2x2* const distortion, const BGC_FP64_Vector2* const shift)
|
||||
{
|
||||
bgc_fp64_matrix2x2_copy(&affine->distortion, distortion);
|
||||
bgc_fp64_vector2_copy(&affine->shift, shift);
|
||||
|
|
@ -36,13 +36,13 @@ inline void bgc_fp64_affine2_make(BGC_FP64_Affine2* affine, const BGC_FP64_Matri
|
|||
|
||||
// ==================== Copy ===================== //
|
||||
|
||||
inline void bgc_fp32_affine2_copy(BGC_FP32_Affine2* destination, const BGC_FP32_Affine2* source)
|
||||
inline void bgc_fp32_affine2_copy(BGC_FP32_Affine2* const destination, const BGC_FP32_Affine2* const source)
|
||||
{
|
||||
bgc_fp32_matrix2x2_copy(&destination->distortion, &source->distortion);
|
||||
bgc_fp32_vector2_copy(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_copy(BGC_FP64_Affine2* destination, const BGC_FP64_Affine2* source)
|
||||
inline void bgc_fp64_affine2_copy(BGC_FP64_Affine2* const destination, const BGC_FP64_Affine2* const source)
|
||||
{
|
||||
bgc_fp64_matrix2x2_copy(&destination->distortion, &source->distortion);
|
||||
bgc_fp64_vector2_copy(&destination->shift, &source->shift);
|
||||
|
|
@ -50,13 +50,13 @@ inline void bgc_fp64_affine2_copy(BGC_FP64_Affine2* destination, const BGC_FP64_
|
|||
|
||||
// ==================== Swap ===================== //
|
||||
|
||||
inline void bgc_fp32_affine2_swap(BGC_FP32_Affine2 * first, BGC_FP32_Affine2 * second)
|
||||
inline void bgc_fp32_affine2_swap(BGC_FP32_Affine2* const first, BGC_FP32_Affine2* const second)
|
||||
{
|
||||
bgc_fp32_matrix2x2_swap(&first->distortion, &second->distortion);
|
||||
bgc_fp32_vector2_swap(&first->shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_swap(BGC_FP64_Affine2 * first, BGC_FP64_Affine2 * second)
|
||||
inline void bgc_fp64_affine2_swap(BGC_FP64_Affine2* const first, BGC_FP64_Affine2* const second)
|
||||
{
|
||||
bgc_fp64_matrix2x2_swap(&first->distortion, &second->distortion);
|
||||
bgc_fp64_vector2_swap(&first->shift, &second->shift);
|
||||
|
|
@ -64,13 +64,13 @@ inline void bgc_fp64_affine2_swap(BGC_FP64_Affine2 * first, BGC_FP64_Affine2 * s
|
|||
|
||||
// =================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_affine2_convert_to_fp64(BGC_FP64_Affine2* destination, const BGC_FP32_Affine2* source)
|
||||
inline void bgc_fp32_affine2_convert_to_fp64(BGC_FP64_Affine2* const destination, const BGC_FP32_Affine2* const source)
|
||||
{
|
||||
bgc_fp32_matrix2x2_convert_to_fp64(&destination->distortion, &source->distortion);
|
||||
bgc_fp32_vector2_convert_to_fp64(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_convert_to_fp32(BGC_FP32_Affine2* destination, const BGC_FP64_Affine2 * source)
|
||||
inline void bgc_fp64_affine2_convert_to_fp32(BGC_FP32_Affine2* const destination, const BGC_FP64_Affine2* const source)
|
||||
{
|
||||
bgc_fp64_matrix2x2_convert_to_fp32(&destination->distortion, &source->distortion);
|
||||
bgc_fp64_vector2_convert_to_fp32(&destination->shift, &source->shift);
|
||||
|
|
@ -78,7 +78,7 @@ inline void bgc_fp64_affine2_convert_to_fp32(BGC_FP32_Affine2* destination, cons
|
|||
|
||||
// =================== Invert ==================== //
|
||||
|
||||
inline int bgc_fp32_affine2_invert(BGC_FP32_Affine2 * affine)
|
||||
inline int bgc_fp32_affine2_invert(BGC_FP32_Affine2* const affine)
|
||||
{
|
||||
if (bgc_fp32_matrix2x2_invert(&affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -90,7 +90,7 @@ inline int bgc_fp32_affine2_invert(BGC_FP32_Affine2 * affine)
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_affine2_invert(BGC_FP64_Affine2 * affine)
|
||||
inline int bgc_fp64_affine2_invert(BGC_FP64_Affine2* const affine)
|
||||
{
|
||||
if (bgc_fp64_matrix2x2_invert(&affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -104,7 +104,7 @@ inline int bgc_fp64_affine2_invert(BGC_FP64_Affine2 * affine)
|
|||
|
||||
// ================= Get Inverse ================= //
|
||||
|
||||
inline int bgc_fp32_affine2_get_inverse(BGC_FP32_Affine2* inverse, const BGC_FP32_Affine2 * affine)
|
||||
inline int bgc_fp32_affine2_get_inverse(BGC_FP32_Affine2* const inverse, const BGC_FP32_Affine2* const affine)
|
||||
{
|
||||
if (bgc_fp32_matrix2x2_get_inverse(&inverse->distortion, &affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -116,7 +116,7 @@ inline int bgc_fp32_affine2_get_inverse(BGC_FP32_Affine2* inverse, const BGC_FP3
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_affine2_get_inverse(BGC_FP64_Affine2* inverse, const BGC_FP64_Affine2 * affine)
|
||||
inline int bgc_fp64_affine2_get_inverse(BGC_FP64_Affine2* const inverse, const BGC_FP64_Affine2* const affine)
|
||||
{
|
||||
if (bgc_fp64_matrix2x2_get_inverse(&inverse->distortion, &affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -130,7 +130,7 @@ inline int bgc_fp64_affine2_get_inverse(BGC_FP64_Affine2* inverse, const BGC_FP6
|
|||
|
||||
// =================== Combine =================== //
|
||||
|
||||
inline void bgc_fp32_affine2_combine(BGC_FP32_Affine2* combination, const BGC_FP32_Affine2 * first, const BGC_FP32_Affine2 * second)
|
||||
inline void bgc_fp32_affine2_combine(BGC_FP32_Affine2* const combination, const BGC_FP32_Affine2* const first, const BGC_FP32_Affine2* const second)
|
||||
{
|
||||
BGC_FP32_Vector2 first_shift;
|
||||
bgc_fp32_matrix2x2_multiply_by_vector2(&first_shift, &second->distortion, &first->shift);
|
||||
|
|
@ -138,7 +138,7 @@ inline void bgc_fp32_affine2_combine(BGC_FP32_Affine2* combination, const BGC_FP
|
|||
bgc_fp32_vector2_add(&combination->shift, &second->shift, &first_shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_combine(BGC_FP64_Affine2* combination, const BGC_FP64_Affine2 * first, const BGC_FP64_Affine2 * second)
|
||||
inline void bgc_fp64_affine2_combine(BGC_FP64_Affine2* const combination, const BGC_FP64_Affine2* const first, const BGC_FP64_Affine2* const second)
|
||||
{
|
||||
BGC_FP64_Vector2 first_shift;
|
||||
bgc_fp64_matrix2x2_multiply_by_vector2(&first_shift, &second->distortion, &first->shift);
|
||||
|
|
@ -148,14 +148,14 @@ inline void bgc_fp64_affine2_combine(BGC_FP64_Affine2* combination, const BGC_FP
|
|||
|
||||
// =============== Transform Point =============== //
|
||||
|
||||
inline void bgc_fp32_affine2_transform_point(BGC_FP32_Vector2* transformed_point, const BGC_FP32_Affine2 * affine, const BGC_FP32_Vector2 * initial_point)
|
||||
inline void bgc_fp32_affine2_transform_point(BGC_FP32_Vector2* const transformed_point, const BGC_FP32_Affine2* const affine, const BGC_FP32_Vector2* const initial_point)
|
||||
{
|
||||
BGC_FP32_Vector2 distorted;
|
||||
bgc_fp32_matrix2x2_multiply_by_vector2(&distorted, &affine->distortion, initial_point);
|
||||
bgc_fp32_vector2_add(transformed_point, &affine->shift, &distorted);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_transform_point(BGC_FP64_Vector2* transformed_point, const BGC_FP64_Affine2 * affine, const BGC_FP64_Vector2 * initial_point)
|
||||
inline void bgc_fp64_affine2_transform_point(BGC_FP64_Vector2* const transformed_point, const BGC_FP64_Affine2* const affine, const BGC_FP64_Vector2* const initial_point)
|
||||
{
|
||||
BGC_FP64_Vector2 distorted;
|
||||
bgc_fp64_matrix2x2_multiply_by_vector2(&distorted, &affine->distortion, initial_point);
|
||||
|
|
@ -164,12 +164,12 @@ inline void bgc_fp64_affine2_transform_point(BGC_FP64_Vector2* transformed_point
|
|||
|
||||
// ============== Transform Vector =============== //
|
||||
|
||||
inline void bgc_fp32_affine2_transform_vector(BGC_FP32_Vector2* transformed_vector, const BGC_FP32_Affine2 * affine, const BGC_FP32_Vector2 * initial_vector)
|
||||
inline void bgc_fp32_affine2_transform_vector(BGC_FP32_Vector2* const transformed_vector, const BGC_FP32_Affine2* const affine, const BGC_FP32_Vector2* const initial_vector)
|
||||
{
|
||||
bgc_fp32_matrix2x2_multiply_by_vector2(transformed_vector, &affine->distortion, initial_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine2_transform_vector(BGC_FP64_Vector2* transformed_vector, const BGC_FP64_Affine2 * affine, const BGC_FP64_Vector2 * initial_vector)
|
||||
inline void bgc_fp64_affine2_transform_vector(BGC_FP64_Vector2* const transformed_vector, const BGC_FP64_Affine2* const affine, const BGC_FP64_Vector2* const initial_vector)
|
||||
{
|
||||
bgc_fp64_matrix2x2_multiply_by_vector2(transformed_vector, &affine->distortion, initial_vector);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,31 +1,31 @@
|
|||
#include "./affine3.h"
|
||||
|
||||
extern inline void bgc_fp32_affine3_reset(BGC_FP32_Affine3* affine);
|
||||
extern inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3* affine);
|
||||
extern inline void bgc_fp32_affine3_reset(BGC_FP32_Affine3* const affine);
|
||||
extern inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3* const affine);
|
||||
|
||||
extern inline void bgc_fp32_affine3_make(BGC_FP32_Affine3* affine, const BGC_FP32_Matrix3x3* distortion, const BGC_FP32_Vector3* shift);
|
||||
extern inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* affine, const BGC_FP64_Matrix3x3* distortion, const BGC_FP64_Vector3* shift);
|
||||
extern inline void bgc_fp32_affine3_make(BGC_FP32_Affine3* const affine, const BGC_FP32_Matrix3x3* const distortion, const BGC_FP32_Vector3* const shift);
|
||||
extern inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* const affine, const BGC_FP64_Matrix3x3* const distortion, const BGC_FP64_Vector3* const shift);
|
||||
|
||||
extern inline void bgc_fp32_affine3_copy(BGC_FP32_Affine3* destination, const BGC_FP32_Affine3* source);
|
||||
extern inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* destination, const BGC_FP64_Affine3* source);
|
||||
extern inline void bgc_fp32_affine3_copy(BGC_FP32_Affine3* const destination, const BGC_FP32_Affine3* const source);
|
||||
extern inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* const destination, const BGC_FP64_Affine3* const source);
|
||||
|
||||
extern inline void bgc_fp32_affine3_swap(BGC_FP32_Affine3* first, BGC_FP32_Affine3* second);
|
||||
extern inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3* first, BGC_FP64_Affine3* second);
|
||||
extern inline void bgc_fp32_affine3_swap(BGC_FP32_Affine3* const first, BGC_FP32_Affine3* const second);
|
||||
extern inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3* const first, BGC_FP64_Affine3* const second);
|
||||
|
||||
extern inline void bgc_fp32_affine3_convert_to_fp64(BGC_FP64_Affine3* destination, const BGC_FP32_Affine3* source);
|
||||
extern inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* destination, const BGC_FP64_Affine3* source);
|
||||
extern inline void bgc_fp32_affine3_convert_to_fp64(BGC_FP64_Affine3* const destination, const BGC_FP32_Affine3* const source);
|
||||
extern inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* const destination, const BGC_FP64_Affine3* const source);
|
||||
|
||||
extern inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3* affine);
|
||||
extern inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3* affine);
|
||||
extern inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3* const affine);
|
||||
extern inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3* const affine);
|
||||
|
||||
extern inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* inverse, const BGC_FP32_Affine3* affine);
|
||||
extern inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* inverse, const BGC_FP64_Affine3* affine);
|
||||
extern inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* const inverse, const BGC_FP32_Affine3* const affine);
|
||||
extern inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* const inverse, const BGC_FP64_Affine3* const affine);
|
||||
|
||||
extern inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* combination, const BGC_FP32_Affine3* first, const BGC_FP32_Affine3* second);
|
||||
extern inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* combination, const BGC_FP64_Affine3* first, const BGC_FP64_Affine3* second);
|
||||
extern inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* const combination, const BGC_FP32_Affine3* const first, const BGC_FP32_Affine3* const second);
|
||||
extern inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* const combination, const BGC_FP64_Affine3* const first, const BGC_FP64_Affine3* const second);
|
||||
|
||||
extern inline void bgc_fp32_affine3_transform_point(BGC_FP32_Vector3* transformed_point, const BGC_FP32_Affine3* affine, const BGC_FP32_Vector3* initial_point);
|
||||
extern inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* transformed_point, const BGC_FP64_Affine3* affine, const BGC_FP64_Vector3* initial_point);
|
||||
extern inline void bgc_fp32_affine3_transform_point(BGC_FP32_Vector3* const transformed_point, const BGC_FP32_Affine3* const affine, const BGC_FP32_Vector3* const initial_point);
|
||||
extern inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* const transformed_point, const BGC_FP64_Affine3* const affine, const BGC_FP64_Vector3* const initial_point);
|
||||
|
||||
extern inline void bgc_fp32_affine3_transform_vector(BGC_FP32_Vector3* transformed_vector, const BGC_FP32_Affine3* affine, const BGC_FP32_Vector3* initial_vector);
|
||||
extern inline void bgc_fp64_affine3_transform_vector(BGC_FP64_Vector3* transformed_vector, const BGC_FP64_Affine3* affine, const BGC_FP64_Vector3* initial_vector);
|
||||
extern inline void bgc_fp32_affine3_transform_vector(BGC_FP32_Vector3* const transformed_vector, const BGC_FP32_Affine3* const affine, const BGC_FP32_Vector3* const initial_vector);
|
||||
extern inline void bgc_fp64_affine3_transform_vector(BGC_FP64_Vector3* const transformed_vector, const BGC_FP64_Affine3* const affine, const BGC_FP64_Vector3* const initial_vector);
|
||||
|
|
|
|||
|
|
@ -7,13 +7,13 @@
|
|||
|
||||
// ==================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_affine3_reset(BGC_FP32_Affine3 * affine)
|
||||
inline void bgc_fp32_affine3_reset(BGC_FP32_Affine3* const affine)
|
||||
{
|
||||
bgc_fp32_matrix3x3_make_identity(&affine->distortion);
|
||||
bgc_fp32_vector3_reset(&affine->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3 * affine)
|
||||
inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3* const affine)
|
||||
{
|
||||
bgc_fp64_matrix3x3_make_identity(&affine->distortion);
|
||||
bgc_fp64_vector3_reset(&affine->shift);
|
||||
|
|
@ -21,13 +21,13 @@ inline void bgc_fp64_affine3_reset(BGC_FP64_Affine3 * affine)
|
|||
|
||||
// ==================== Make ===================== //
|
||||
|
||||
inline void bgc_fp32_affine3_make(BGC_FP32_Affine3* affine, const BGC_FP32_Matrix3x3 * distortion, const BGC_FP32_Vector3 * shift)
|
||||
inline void bgc_fp32_affine3_make(BGC_FP32_Affine3* const affine, const BGC_FP32_Matrix3x3* const distortion, const BGC_FP32_Vector3* const shift)
|
||||
{
|
||||
bgc_fp32_matrix3x3_copy(&affine->distortion, distortion);
|
||||
bgc_fp32_vector3_copy(&affine->shift, shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* affine, const BGC_FP64_Matrix3x3 * distortion, const BGC_FP64_Vector3 * shift)
|
||||
inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* const affine, const BGC_FP64_Matrix3x3* const distortion, const BGC_FP64_Vector3* const shift)
|
||||
{
|
||||
bgc_fp64_matrix3x3_copy(&affine->distortion, distortion);
|
||||
bgc_fp64_vector3_copy(&affine->shift, shift);
|
||||
|
|
@ -35,13 +35,13 @@ inline void bgc_fp64_affine3_make(BGC_FP64_Affine3* affine, const BGC_FP64_Matri
|
|||
|
||||
// ==================== Copy ===================== //
|
||||
|
||||
inline void bgc_fp32_affine3_copy(BGC_FP32_Affine3* destination, const BGC_FP32_Affine3 * source)
|
||||
inline void bgc_fp32_affine3_copy(BGC_FP32_Affine3* const destination, const BGC_FP32_Affine3* const source)
|
||||
{
|
||||
bgc_fp32_matrix3x3_copy(&destination->distortion, &source->distortion);
|
||||
bgc_fp32_vector3_copy(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* destination, const BGC_FP64_Affine3 * source)
|
||||
inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* const destination, const BGC_FP64_Affine3* const source)
|
||||
{
|
||||
bgc_fp64_matrix3x3_copy(&destination->distortion, &source->distortion);
|
||||
bgc_fp64_vector3_copy(&destination->shift, &source->shift);
|
||||
|
|
@ -49,13 +49,13 @@ inline void bgc_fp64_affine3_copy(BGC_FP64_Affine3* destination, const BGC_FP64_
|
|||
|
||||
// ==================== Swap ===================== //
|
||||
|
||||
inline void bgc_fp32_affine3_swap(BGC_FP32_Affine3 * first, BGC_FP32_Affine3 * second)
|
||||
inline void bgc_fp32_affine3_swap(BGC_FP32_Affine3* const first, BGC_FP32_Affine3* const second)
|
||||
{
|
||||
bgc_fp32_matrix3x3_swap(&first->distortion, &second->distortion);
|
||||
bgc_fp32_vector3_swap(&first->shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3 * first, BGC_FP64_Affine3 * second)
|
||||
inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3* const first, BGC_FP64_Affine3* const second)
|
||||
{
|
||||
bgc_fp64_matrix3x3_swap(&first->distortion, &second->distortion);
|
||||
bgc_fp64_vector3_swap(&first->shift, &second->shift);
|
||||
|
|
@ -63,13 +63,13 @@ inline void bgc_fp64_affine3_swap(BGC_FP64_Affine3 * first, BGC_FP64_Affine3 * s
|
|||
|
||||
// =================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_affine3_convert_to_fp64(BGC_FP64_Affine3* destination, const BGC_FP32_Affine3 * source)
|
||||
inline void bgc_fp32_affine3_convert_to_fp64(BGC_FP64_Affine3* const destination, const BGC_FP32_Affine3* const source)
|
||||
{
|
||||
bgc_fp32_matrix3x3_convert_to_fp64(&destination->distortion, &source->distortion);
|
||||
bgc_fp32_vector3_convert_to_fp64(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* destination, const BGC_FP64_Affine3* source)
|
||||
inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* const destination, const BGC_FP64_Affine3* const source)
|
||||
{
|
||||
bgc_fp64_matrix3x3_convert_to_fp32(&destination->distortion, &source->distortion);
|
||||
bgc_fp64_vector3_convert_to_fp32(&destination->shift, &source->shift);
|
||||
|
|
@ -77,7 +77,7 @@ inline void bgc_fp64_affine3_convert_to_fp32(BGC_FP32_Affine3* destination, cons
|
|||
|
||||
// =================== Invert ==================== //
|
||||
|
||||
inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3 * affine)
|
||||
inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3* const affine)
|
||||
{
|
||||
if (bgc_fp32_matrix3x3_invert(&affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -89,7 +89,7 @@ inline int bgc_fp32_affine3_invert(BGC_FP32_Affine3 * affine)
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3 * affine)
|
||||
inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3* const affine)
|
||||
{
|
||||
if (bgc_fp64_matrix3x3_invert(&affine->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -103,7 +103,7 @@ inline int bgc_fp64_affine3_invert(BGC_FP64_Affine3 * affine)
|
|||
|
||||
// ================= Get Inverse ================= //
|
||||
|
||||
inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* destination, const BGC_FP32_Affine3 * source)
|
||||
inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* const destination, const BGC_FP32_Affine3* const source)
|
||||
{
|
||||
if (bgc_fp32_matrix3x3_get_inverse(&destination->distortion, &source->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -115,7 +115,7 @@ inline int bgc_fp32_affine3_get_inverse(BGC_FP32_Affine3* destination, const BGC
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* destination, const BGC_FP64_Affine3 * source)
|
||||
inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* const destination, const BGC_FP64_Affine3* const source)
|
||||
{
|
||||
if (bgc_fp64_matrix3x3_get_inverse(&destination->distortion, &source->distortion) != BGC_SUCCESS) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -129,7 +129,7 @@ inline int bgc_fp64_affine3_get_inverse(BGC_FP64_Affine3* destination, const BGC
|
|||
|
||||
// =================== Combine =================== //
|
||||
|
||||
inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* combination, const BGC_FP32_Affine3 * first, const BGC_FP32_Affine3 * second)
|
||||
inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* const combination, const BGC_FP32_Affine3* const first, const BGC_FP32_Affine3* const second)
|
||||
{
|
||||
BGC_FP32_Vector3 first_shift;
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
|
|
@ -137,7 +137,7 @@ inline void bgc_fp32_affine3_combine(BGC_FP32_Affine3* combination, const BGC_FP
|
|||
bgc_fp32_vector3_add(&combination->shift, &first_shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* combination, const BGC_FP64_Affine3 * first, const BGC_FP64_Affine3 * second)
|
||||
inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* const combination, const BGC_FP64_Affine3* const first, const BGC_FP64_Affine3* const second)
|
||||
{
|
||||
BGC_FP64_Vector3 first_shift;
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(&first_shift, &second->distortion, &first->shift);
|
||||
|
|
@ -147,14 +147,14 @@ inline void bgc_fp64_affine3_combine(BGC_FP64_Affine3* combination, const BGC_FP
|
|||
|
||||
// =============== Transform Point =============== //
|
||||
|
||||
inline void bgc_fp32_affine3_transform_point(BGC_FP32_Vector3* transformed_point, const BGC_FP32_Affine3 * affine, const BGC_FP32_Vector3 * initial_point)
|
||||
inline void bgc_fp32_affine3_transform_point(BGC_FP32_Vector3* const transformed_point, const BGC_FP32_Affine3* const affine, const BGC_FP32_Vector3* const initial_point)
|
||||
{
|
||||
BGC_FP32_Vector3 distorted;
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
bgc_fp32_vector3_add(transformed_point, &affine->shift, &distorted);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* transformed_point, const BGC_FP64_Affine3 * affine, const BGC_FP64_Vector3 * initial_point)
|
||||
inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* const transformed_point, const BGC_FP64_Affine3* const affine, const BGC_FP64_Vector3* const initial_point)
|
||||
{
|
||||
BGC_FP64_Vector3 distorted;
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(&distorted, &affine->distortion, initial_point);
|
||||
|
|
@ -163,12 +163,12 @@ inline void bgc_fp64_affine3_transform_point(BGC_FP64_Vector3* transformed_point
|
|||
|
||||
// ============== Transform Vector =============== //
|
||||
|
||||
inline void bgc_fp32_affine3_transform_vector(BGC_FP32_Vector3* transformed_vector, const BGC_FP32_Affine3 * affine, const BGC_FP32_Vector3 * initial_vector)
|
||||
inline void bgc_fp32_affine3_transform_vector(BGC_FP32_Vector3* const transformed_vector, const BGC_FP32_Affine3* const affine, const BGC_FP32_Vector3* const initial_vector)
|
||||
{
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(transformed_vector, &affine->distortion, initial_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_affine3_transform_vector(BGC_FP64_Vector3* transformed_vector, const BGC_FP64_Affine3 * affine, const BGC_FP64_Vector3 * initial_vector)
|
||||
inline void bgc_fp64_affine3_transform_vector(BGC_FP64_Vector3* const transformed_vector, const BGC_FP64_Affine3* const affine, const BGC_FP64_Vector3* const initial_vector)
|
||||
{
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(transformed_vector, &affine->distortion, initial_vector);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,64 +1,64 @@
|
|||
#include "./dual-vector3.h"
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_reset(BGC_FP32_DualVector3* vector);
|
||||
extern inline void bgc_fp64_dual_vector3_reset(BGC_FP64_DualVector3* vector);
|
||||
extern inline void bgc_fp32_dual_vector3_reset(BGC_FP32_DualVector3* const vector);
|
||||
extern inline void bgc_fp64_dual_vector3_reset(BGC_FP64_DualVector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_copy(BGC_FP32_DualVector3* destination, const BGC_FP32_DualVector3* source);
|
||||
extern inline void bgc_fp64_dual_vector3_copy(BGC_FP64_DualVector3* destination, const BGC_FP64_DualVector3* source);
|
||||
extern inline void bgc_fp32_dual_vector3_copy(BGC_FP32_DualVector3* const destination, const BGC_FP32_DualVector3* const source);
|
||||
extern inline void bgc_fp64_dual_vector3_copy(BGC_FP64_DualVector3* const destination, const BGC_FP64_DualVector3* const source);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_swap(BGC_FP32_DualVector3* first, BGC_FP32_DualVector3* second);
|
||||
extern inline void bgc_fp64_dual_vector3_swap(BGC_FP64_DualVector3* first, BGC_FP64_DualVector3* second);
|
||||
extern inline void bgc_fp32_dual_vector3_swap(BGC_FP32_DualVector3* const first, BGC_FP32_DualVector3* const second);
|
||||
extern inline void bgc_fp64_dual_vector3_swap(BGC_FP64_DualVector3* const first, BGC_FP64_DualVector3* const second);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_convert_to_fp64(BGC_FP64_DualVector3* destination, const BGC_FP32_DualVector3* source);
|
||||
extern inline void bgc_fp64_dual_vector3_convert_to_fp32(BGC_FP32_DualVector3* destination, const BGC_FP64_DualVector3* source);
|
||||
extern inline void bgc_fp32_dual_vector3_convert_to_fp64(BGC_FP64_DualVector3* const destination, const BGC_FP32_DualVector3* const source);
|
||||
extern inline void bgc_fp64_dual_vector3_convert_to_fp32(BGC_FP32_DualVector3* const destination, const BGC_FP64_DualVector3* const source);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_revert(BGC_FP32_DualVector3* vector);
|
||||
extern inline void bgc_fp64_dual_vector3_revert(BGC_FP64_DualVector3* vector);
|
||||
extern inline void bgc_fp32_dual_vector3_revert(BGC_FP32_DualVector3* const vector);
|
||||
extern inline void bgc_fp64_dual_vector3_revert(BGC_FP64_DualVector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_get_reverse(BGC_FP32_DualVector3* reverse, const BGC_FP32_DualVector3* vector);
|
||||
extern inline void bgc_fp64_dual_vector3_get_reverse(BGC_FP64_DualVector3* reverse, const BGC_FP64_DualVector3* vector);
|
||||
extern inline void bgc_fp32_dual_vector3_get_reverse(BGC_FP32_DualVector3* const reverse, const BGC_FP32_DualVector3* const vector);
|
||||
extern inline void bgc_fp64_dual_vector3_get_reverse(BGC_FP64_DualVector3* const reverse, const BGC_FP64_DualVector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_add(BGC_FP32_DualVector3* sum, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second);
|
||||
extern inline void bgc_fp64_dual_vector3_add(BGC_FP64_DualVector3* sum, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second);
|
||||
extern inline void bgc_fp32_dual_vector3_add(BGC_FP32_DualVector3* const sum, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second);
|
||||
extern inline void bgc_fp64_dual_vector3_add(BGC_FP64_DualVector3* const sum, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_add_scaled(BGC_FP32_DualVector3* sum, const BGC_FP32_DualVector3* base_vector, const BGC_FP32_DualVector3* scalable_vector, const float scale);
|
||||
extern inline void bgc_fp64_dual_vector3_add_scaled(BGC_FP64_DualVector3* sum, const BGC_FP64_DualVector3* base_vector, const BGC_FP64_DualVector3* scalable_vector, const double scale);
|
||||
extern inline void bgc_fp32_dual_vector3_add_scaled(BGC_FP32_DualVector3* const sum, const BGC_FP32_DualVector3* const base_vector, const BGC_FP32_DualVector3* const scalable_vector, const float scale);
|
||||
extern inline void bgc_fp64_dual_vector3_add_scaled(BGC_FP64_DualVector3* const sum, const BGC_FP64_DualVector3* const base_vector, const BGC_FP64_DualVector3* const scalable_vector, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_subtract(BGC_FP32_DualVector3* difference, const BGC_FP32_DualVector3* minuend, const BGC_FP32_DualVector3* subtrahend);
|
||||
extern inline void bgc_fp64_dual_vector3_subtract(BGC_FP64_DualVector3* difference, const BGC_FP64_DualVector3* minuend, const BGC_FP64_DualVector3* subtrahend);
|
||||
extern inline void bgc_fp32_dual_vector3_subtract(BGC_FP32_DualVector3* const difference, const BGC_FP32_DualVector3* const minuend, const BGC_FP32_DualVector3* const subtrahend);
|
||||
extern inline void bgc_fp64_dual_vector3_subtract(BGC_FP64_DualVector3* const difference, const BGC_FP64_DualVector3* const minuend, const BGC_FP64_DualVector3* const subtrahend);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_subtract_scaled(BGC_FP32_DualVector3* difference, const BGC_FP32_DualVector3* base_vector, const BGC_FP32_DualVector3* scalable_vector, const float scale);
|
||||
extern inline void bgc_fp64_dual_vector3_subtract_scaled(BGC_FP64_DualVector3* difference, const BGC_FP64_DualVector3* base_vector, const BGC_FP64_DualVector3* scalable_vector, const double scale);
|
||||
extern inline void bgc_fp32_dual_vector3_subtract_scaled(BGC_FP32_DualVector3* const difference, const BGC_FP32_DualVector3* const base_vector, const BGC_FP32_DualVector3* const scalable_vector, const float scale);
|
||||
extern inline void bgc_fp64_dual_vector3_subtract_scaled(BGC_FP64_DualVector3* const difference, const BGC_FP64_DualVector3* const base_vector, const BGC_FP64_DualVector3* const scalable_vector, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_multiply_by_real(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_dual_vector3_multiply_by_real(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* multiplicand, const double multiplier);
|
||||
extern inline void bgc_fp32_dual_vector3_multiply_by_real(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_dual_vector3_multiply_by_real(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const multiplicand, const double multiplier);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_multiply_by_dual(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* multiplicand, const BGC_FP32_DualNumber* multiplier);
|
||||
extern inline void bgc_fp64_dual_vector3_multiply_by_dual(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* multiplicand, const BGC_FP64_DualNumber* multiplier);
|
||||
extern inline void bgc_fp32_dual_vector3_multiply_by_dual(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const multiplicand, const BGC_FP32_DualNumber* const multiplier);
|
||||
extern inline void bgc_fp64_dual_vector3_multiply_by_dual(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const multiplicand, const BGC_FP64_DualNumber* const multiplier);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_multiply_by_conjugate(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* multiplicand, const BGC_FP32_DualNumber* multiplier_to_conjugate);
|
||||
extern inline void bgc_fp64_dual_vector3_multiply_by_conjugate(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* multiplicand, const BGC_FP64_DualNumber* multiplier_to_conjugate);
|
||||
extern inline void bgc_fp32_dual_vector3_multiply_by_conjugate(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(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const multiplicand, const BGC_FP64_DualNumber* const multiplier_to_conjugate);
|
||||
|
||||
extern inline int bgc_fp32_dual_vector3_divide_by_real(BGC_FP32_DualVector3* quotient, const BGC_FP32_DualVector3* dividend, const float divisor);
|
||||
extern inline int bgc_fp64_dual_vector3_divide_by_real(BGC_FP64_DualVector3* quotient, const BGC_FP64_DualVector3* dividend, const double divisor);
|
||||
extern inline int bgc_fp32_dual_vector3_divide_by_real(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const float divisor);
|
||||
extern inline int bgc_fp64_dual_vector3_divide_by_real(BGC_FP64_DualVector3* const quotient, const BGC_FP64_DualVector3* const dividend, const double divisor);
|
||||
|
||||
extern inline int bgc_fp32_dual_vector3_divide_by_dual(BGC_FP32_DualVector3* quotient, const BGC_FP32_DualVector3* dividend, const BGC_FP32_DualNumber* divisor);
|
||||
extern inline int bgc_fp64_dual_vector3_divide_by_dual(BGC_FP64_DualVector3* quotient, const BGC_FP64_DualVector3* dividend, const BGC_FP64_DualNumber* divisor);
|
||||
extern inline int bgc_fp32_dual_vector3_divide_by_dual(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const BGC_FP32_DualNumber* const divisor);
|
||||
extern inline int bgc_fp64_dual_vector3_divide_by_dual(BGC_FP64_DualVector3* const quotient, const BGC_FP64_DualVector3* const dividend, const BGC_FP64_DualNumber* const divisor);
|
||||
|
||||
extern inline int bgc_fp32_dual_vector3_divide_by_conjugate(BGC_FP32_DualVector3* quotient, const BGC_FP32_DualVector3* dividend, const BGC_FP32_DualNumber* divisor_to_conjugate);
|
||||
extern inline int bgc_fp64_dual_vector3_divide_by_conjugate(BGC_FP64_DualVector3* quotient, const BGC_FP64_DualVector3* dividend, const BGC_FP64_DualNumber* divisor_to_conjugate);
|
||||
extern inline int bgc_fp32_dual_vector3_divide_by_conjugate(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const BGC_FP32_DualNumber* const divisor_to_conjugate);
|
||||
extern inline int bgc_fp64_dual_vector3_divide_by_conjugate(BGC_FP64_DualVector3* const quotient, const BGC_FP64_DualVector3* const dividend, const BGC_FP64_DualNumber* const divisor_to_conjugate);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_get_mean2(BGC_FP32_DualVector3* mean, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second);
|
||||
extern inline void bgc_fp64_dual_vector3_get_mean2(BGC_FP64_DualVector3* mean, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second);
|
||||
extern inline void bgc_fp32_dual_vector3_get_mean2(BGC_FP32_DualVector3* const mean, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second);
|
||||
extern inline void bgc_fp64_dual_vector3_get_mean2(BGC_FP64_DualVector3* const mean, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_get_mean3(BGC_FP32_DualVector3* mean, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second, const BGC_FP32_DualVector3* third);
|
||||
extern inline void bgc_fp64_dual_vector3_get_mean3(BGC_FP64_DualVector3* mean, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second, const BGC_FP64_DualVector3* third);
|
||||
extern inline void bgc_fp32_dual_vector3_get_mean3(BGC_FP32_DualVector3* const mean, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second, const BGC_FP32_DualVector3* const third);
|
||||
extern inline void bgc_fp64_dual_vector3_get_mean3(BGC_FP64_DualVector3* const mean, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second, const BGC_FP64_DualVector3* const third);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_interpolate(BGC_FP32_DualVector3* interpolation, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second, const float phase);
|
||||
extern inline void bgc_fp64_dual_vector3_interpolate(BGC_FP64_DualVector3* interpolation, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second, const double phase);
|
||||
extern inline void bgc_fp32_dual_vector3_interpolate(BGC_FP32_DualVector3* const interpolation, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second, const float phase);
|
||||
extern inline void bgc_fp64_dual_vector3_interpolate(BGC_FP64_DualVector3* const interpolation, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second, const double phase);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_get_dot_product(BGC_FP32_DualNumber* product, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second);
|
||||
extern inline void bgc_fp64_dual_vector3_get_dot_product(BGC_FP64_DualNumber* product, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second);
|
||||
extern inline void bgc_fp32_dual_vector3_get_dot_product(BGC_FP32_DualNumber* const product, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second);
|
||||
extern inline void bgc_fp64_dual_vector3_get_dot_product(BGC_FP64_DualNumber* const product, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second);
|
||||
|
||||
extern inline void bgc_fp32_dual_vector3_get_cross_product(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second);
|
||||
extern inline void bgc_fp64_dual_vector3_get_cross_product(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second);
|
||||
extern inline void bgc_fp32_dual_vector3_get_cross_product(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second);
|
||||
extern inline void bgc_fp64_dual_vector3_get_cross_product(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second);
|
||||
|
|
|
|||
|
|
@ -6,13 +6,13 @@
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_reset(BGC_FP32_DualVector3* vector)
|
||||
inline void bgc_fp32_dual_vector3_reset(BGC_FP32_DualVector3* const vector)
|
||||
{
|
||||
bgc_fp32_vector3_reset(&vector->real_part);
|
||||
bgc_fp32_vector3_reset(&vector->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_reset(BGC_FP64_DualVector3* vector)
|
||||
inline void bgc_fp64_dual_vector3_reset(BGC_FP64_DualVector3* const vector)
|
||||
{
|
||||
bgc_fp64_vector3_reset(&vector->real_part);
|
||||
bgc_fp64_vector3_reset(&vector->dual_part);
|
||||
|
|
@ -20,13 +20,13 @@ inline void bgc_fp64_dual_vector3_reset(BGC_FP64_DualVector3* vector)
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_copy(BGC_FP32_DualVector3* destination, const BGC_FP32_DualVector3* source)
|
||||
inline void bgc_fp32_dual_vector3_copy(BGC_FP32_DualVector3* const destination, const BGC_FP32_DualVector3* const source)
|
||||
{
|
||||
bgc_fp32_vector3_copy(&destination->real_part, &source->real_part);
|
||||
bgc_fp32_vector3_copy(&destination->dual_part, &source->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_copy(BGC_FP64_DualVector3* destination, const BGC_FP64_DualVector3* source)
|
||||
inline void bgc_fp64_dual_vector3_copy(BGC_FP64_DualVector3* const destination, const BGC_FP64_DualVector3* const source)
|
||||
{
|
||||
bgc_fp64_vector3_copy(&destination->real_part, &source->real_part);
|
||||
bgc_fp64_vector3_copy(&destination->dual_part, &source->dual_part);
|
||||
|
|
@ -34,13 +34,13 @@ inline void bgc_fp64_dual_vector3_copy(BGC_FP64_DualVector3* destination, const
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_swap(BGC_FP32_DualVector3* first, BGC_FP32_DualVector3* second)
|
||||
inline void bgc_fp32_dual_vector3_swap(BGC_FP32_DualVector3* const first, BGC_FP32_DualVector3* const second)
|
||||
{
|
||||
bgc_fp32_vector3_swap(&first->real_part, &second->real_part);
|
||||
bgc_fp32_vector3_swap(&first->dual_part, &second->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_swap(BGC_FP64_DualVector3* first, BGC_FP64_DualVector3* second)
|
||||
inline void bgc_fp64_dual_vector3_swap(BGC_FP64_DualVector3* const first, BGC_FP64_DualVector3* const second)
|
||||
{
|
||||
bgc_fp64_vector3_swap(&first->real_part, &second->real_part);
|
||||
bgc_fp64_vector3_swap(&first->dual_part, &second->dual_part);
|
||||
|
|
@ -48,13 +48,13 @@ inline void bgc_fp64_dual_vector3_swap(BGC_FP64_DualVector3* first, BGC_FP64_Dua
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_convert_to_fp64(BGC_FP64_DualVector3* destination, const BGC_FP32_DualVector3* source)
|
||||
inline void bgc_fp32_dual_vector3_convert_to_fp64(BGC_FP64_DualVector3* const destination, const BGC_FP32_DualVector3* const source)
|
||||
{
|
||||
bgc_fp32_vector3_convert_to_fp64(&destination->real_part, &source->real_part);
|
||||
bgc_fp32_vector3_convert_to_fp64(&destination->dual_part, &source->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_convert_to_fp32(BGC_FP32_DualVector3* destination, const BGC_FP64_DualVector3* source)
|
||||
inline void bgc_fp64_dual_vector3_convert_to_fp32(BGC_FP32_DualVector3* const destination, const BGC_FP64_DualVector3* const source)
|
||||
{
|
||||
bgc_fp64_vector3_convert_to_fp32(&destination->real_part, &source->real_part);
|
||||
bgc_fp64_vector3_convert_to_fp32(&destination->dual_part, &source->dual_part);
|
||||
|
|
@ -62,13 +62,13 @@ inline void bgc_fp64_dual_vector3_convert_to_fp32(BGC_FP32_DualVector3* destinat
|
|||
|
||||
// =================== Revert =================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_revert(BGC_FP32_DualVector3* vector)
|
||||
inline void bgc_fp32_dual_vector3_revert(BGC_FP32_DualVector3* const vector)
|
||||
{
|
||||
bgc_fp32_vector3_revert(&vector->real_part);
|
||||
bgc_fp32_vector3_revert(&vector->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_revert(BGC_FP64_DualVector3* vector)
|
||||
inline void bgc_fp64_dual_vector3_revert(BGC_FP64_DualVector3* const vector)
|
||||
{
|
||||
bgc_fp64_vector3_revert(&vector->real_part);
|
||||
bgc_fp64_vector3_revert(&vector->dual_part);
|
||||
|
|
@ -76,13 +76,13 @@ inline void bgc_fp64_dual_vector3_revert(BGC_FP64_DualVector3* vector)
|
|||
|
||||
// ================ Get Reverse ================= //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_get_reverse(BGC_FP32_DualVector3* reverse, const BGC_FP32_DualVector3* vector)
|
||||
inline void bgc_fp32_dual_vector3_get_reverse(BGC_FP32_DualVector3* const reverse, const BGC_FP32_DualVector3* const vector)
|
||||
{
|
||||
bgc_fp32_vector3_get_reverse(&reverse->real_part, &vector->real_part);
|
||||
bgc_fp32_vector3_get_reverse(&reverse->dual_part, &vector->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_get_reverse(BGC_FP64_DualVector3* reverse, const BGC_FP64_DualVector3* vector)
|
||||
inline void bgc_fp64_dual_vector3_get_reverse(BGC_FP64_DualVector3* const reverse, const BGC_FP64_DualVector3* const vector)
|
||||
{
|
||||
bgc_fp64_vector3_get_reverse(&reverse->real_part, &vector->real_part);
|
||||
bgc_fp64_vector3_get_reverse(&reverse->dual_part, &vector->dual_part);
|
||||
|
|
@ -90,13 +90,13 @@ inline void bgc_fp64_dual_vector3_get_reverse(BGC_FP64_DualVector3* reverse, con
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_add(BGC_FP32_DualVector3* sum, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second)
|
||||
inline void bgc_fp32_dual_vector3_add(BGC_FP32_DualVector3* const sum, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second)
|
||||
{
|
||||
bgc_fp32_vector3_add(&sum->real_part, &first->real_part, &second->real_part);
|
||||
bgc_fp32_vector3_add(&sum->dual_part, &first->dual_part, &second->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_add(BGC_FP64_DualVector3* sum, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second)
|
||||
inline void bgc_fp64_dual_vector3_add(BGC_FP64_DualVector3* const sum, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second)
|
||||
{
|
||||
bgc_fp64_vector3_add(&sum->real_part, &first->real_part, &second->real_part);
|
||||
bgc_fp64_vector3_add(&sum->dual_part, &first->dual_part, &second->dual_part);
|
||||
|
|
@ -104,13 +104,13 @@ inline void bgc_fp64_dual_vector3_add(BGC_FP64_DualVector3* sum, const BGC_FP64_
|
|||
|
||||
// ================= Add Scaled ================= //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_add_scaled(BGC_FP32_DualVector3* sum, const BGC_FP32_DualVector3* base_vector, const BGC_FP32_DualVector3* scalable_vector, const float scale)
|
||||
inline void bgc_fp32_dual_vector3_add_scaled(BGC_FP32_DualVector3* const sum, const BGC_FP32_DualVector3* const base_vector, const BGC_FP32_DualVector3* const scalable_vector, const float scale)
|
||||
{
|
||||
bgc_fp32_vector3_add_scaled(&sum->real_part, &base_vector->real_part, &scalable_vector->real_part, scale);
|
||||
bgc_fp32_vector3_add_scaled(&sum->dual_part, &base_vector->dual_part, &scalable_vector->dual_part, scale);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_add_scaled(BGC_FP64_DualVector3* sum, const BGC_FP64_DualVector3* base_vector, const BGC_FP64_DualVector3* scalable_vector, const double scale)
|
||||
inline void bgc_fp64_dual_vector3_add_scaled(BGC_FP64_DualVector3* const sum, const BGC_FP64_DualVector3* const base_vector, const BGC_FP64_DualVector3* const scalable_vector, const double scale)
|
||||
{
|
||||
bgc_fp64_vector3_add_scaled(&sum->real_part, &base_vector->real_part, &scalable_vector->real_part, scale);
|
||||
bgc_fp64_vector3_add_scaled(&sum->dual_part, &base_vector->dual_part, &scalable_vector->dual_part, scale);
|
||||
|
|
@ -118,13 +118,13 @@ inline void bgc_fp64_dual_vector3_add_scaled(BGC_FP64_DualVector3* sum, const BG
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_subtract(BGC_FP32_DualVector3* difference, const BGC_FP32_DualVector3* minuend, const BGC_FP32_DualVector3* subtrahend)
|
||||
inline void bgc_fp32_dual_vector3_subtract(BGC_FP32_DualVector3* const difference, const BGC_FP32_DualVector3* const minuend, const BGC_FP32_DualVector3* const subtrahend)
|
||||
{
|
||||
bgc_fp32_vector3_subtract(&difference->real_part, &minuend->real_part, &subtrahend->real_part);
|
||||
bgc_fp32_vector3_subtract(&difference->dual_part, &minuend->dual_part, &subtrahend->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_subtract(BGC_FP64_DualVector3* difference, const BGC_FP64_DualVector3* minuend, const BGC_FP64_DualVector3* subtrahend)
|
||||
inline void bgc_fp64_dual_vector3_subtract(BGC_FP64_DualVector3* const difference, const BGC_FP64_DualVector3* const minuend, const BGC_FP64_DualVector3* const subtrahend)
|
||||
{
|
||||
bgc_fp64_vector3_subtract(&difference->real_part, &minuend->real_part, &subtrahend->real_part);
|
||||
bgc_fp64_vector3_subtract(&difference->dual_part, &minuend->dual_part, &subtrahend->dual_part);
|
||||
|
|
@ -132,13 +132,13 @@ inline void bgc_fp64_dual_vector3_subtract(BGC_FP64_DualVector3* difference, con
|
|||
|
||||
// ============== Subtract Scaled =============== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_subtract_scaled(BGC_FP32_DualVector3* difference, const BGC_FP32_DualVector3* base_vector, const BGC_FP32_DualVector3* scalable_vector, const float scale)
|
||||
inline void bgc_fp32_dual_vector3_subtract_scaled(BGC_FP32_DualVector3* const difference, const BGC_FP32_DualVector3* const base_vector, const BGC_FP32_DualVector3* const scalable_vector, const float scale)
|
||||
{
|
||||
bgc_fp32_vector3_subtract_scaled(&difference->real_part, &base_vector->real_part, &scalable_vector->real_part, scale);
|
||||
bgc_fp32_vector3_subtract_scaled(&difference->dual_part, &base_vector->dual_part, &scalable_vector->dual_part, scale);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_subtract_scaled(BGC_FP64_DualVector3* difference, const BGC_FP64_DualVector3* base_vector, const BGC_FP64_DualVector3* scalable_vector, const double scale)
|
||||
inline void bgc_fp64_dual_vector3_subtract_scaled(BGC_FP64_DualVector3* const difference, const BGC_FP64_DualVector3* const base_vector, const BGC_FP64_DualVector3* const scalable_vector, const double scale)
|
||||
{
|
||||
bgc_fp64_vector3_subtract_scaled(&difference->real_part, &base_vector->real_part, &scalable_vector->real_part, scale);
|
||||
bgc_fp64_vector3_subtract_scaled(&difference->dual_part, &base_vector->dual_part, &scalable_vector->dual_part, scale);
|
||||
|
|
@ -146,13 +146,13 @@ inline void bgc_fp64_dual_vector3_subtract_scaled(BGC_FP64_DualVector3* differen
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_multiply_by_real(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_dual_vector3_multiply_by_real(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const multiplicand, const float multiplier)
|
||||
{
|
||||
bgc_fp32_vector3_multiply_by_real(&product->real_part, &multiplicand->real_part, multiplier);
|
||||
bgc_fp32_vector3_multiply_by_real(&product->dual_part, &multiplicand->dual_part, multiplier);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_multiply_by_real(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_dual_vector3_multiply_by_real(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const multiplicand, const double multiplier)
|
||||
{
|
||||
bgc_fp64_vector3_multiply_by_real(&product->real_part, &multiplicand->real_part, multiplier);
|
||||
bgc_fp64_vector3_multiply_by_real(&product->dual_part, &multiplicand->dual_part, multiplier);
|
||||
|
|
@ -160,7 +160,7 @@ inline void bgc_fp64_dual_vector3_multiply_by_real(BGC_FP64_DualVector3* product
|
|||
|
||||
// ========== Multiply by Dual Number =========== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_multiply_by_dual(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* multiplicand, const BGC_FP32_DualNumber* multiplier)
|
||||
inline void bgc_fp32_dual_vector3_multiply_by_dual(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const multiplicand, const BGC_FP32_DualNumber* multiplier)
|
||||
{
|
||||
BGC_FP32_Vector3 dual_part;
|
||||
|
||||
|
|
@ -171,7 +171,7 @@ inline void bgc_fp32_dual_vector3_multiply_by_dual(BGC_FP32_DualVector3* product
|
|||
bgc_fp32_vector3_copy(&product->dual_part, &dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_multiply_by_dual(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* multiplicand, const BGC_FP64_DualNumber* multiplier)
|
||||
inline void bgc_fp64_dual_vector3_multiply_by_dual(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const multiplicand, const BGC_FP64_DualNumber* multiplier)
|
||||
{
|
||||
BGC_FP64_Vector3 dual_part;
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ inline void bgc_fp64_dual_vector3_multiply_by_dual(BGC_FP64_DualVector3* product
|
|||
|
||||
// ===== Multiply by Conjugate Dual Number ====== //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_multiply_by_conjugate(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* multiplicand, const BGC_FP32_DualNumber* multiplier_to_conjugate)
|
||||
inline void bgc_fp32_dual_vector3_multiply_by_conjugate(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const multiplicand, const BGC_FP32_DualNumber* const multiplier_to_conjugate)
|
||||
{
|
||||
BGC_FP32_Vector3 dual_part;
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ inline void bgc_fp32_dual_vector3_multiply_by_conjugate(BGC_FP32_DualVector3* pr
|
|||
bgc_fp32_vector3_copy(&product->dual_part, &dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_multiply_by_conjugate(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* multiplicand, const BGC_FP64_DualNumber* multiplier_to_conjugate)
|
||||
inline void bgc_fp64_dual_vector3_multiply_by_conjugate(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const multiplicand, const BGC_FP64_DualNumber* const multiplier_to_conjugate)
|
||||
{
|
||||
BGC_FP64_Vector3 dual_part;
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ inline void bgc_fp64_dual_vector3_multiply_by_conjugate(BGC_FP64_DualVector3* pr
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_dual_vector3_divide_by_real(BGC_FP32_DualVector3* quotient, const BGC_FP32_DualVector3* dividend, const float divisor)
|
||||
inline int bgc_fp32_dual_vector3_divide_by_real(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -222,7 +222,7 @@ inline int bgc_fp32_dual_vector3_divide_by_real(BGC_FP32_DualVector3* quotient,
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_dual_vector3_divide_by_real(BGC_FP64_DualVector3* quotient, const BGC_FP64_DualVector3* dividend, const double divisor)
|
||||
inline int bgc_fp64_dual_vector3_divide_by_real(BGC_FP64_DualVector3* const quotient, const BGC_FP64_DualVector3* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -238,7 +238,7 @@ inline int bgc_fp64_dual_vector3_divide_by_real(BGC_FP64_DualVector3* quotient,
|
|||
|
||||
// =========== Divide by Dual Number ============ //
|
||||
|
||||
inline int bgc_fp32_dual_vector3_divide_by_dual(BGC_FP32_DualVector3* quotient, const BGC_FP32_DualVector3* dividend, const BGC_FP32_DualNumber* divisor)
|
||||
inline int bgc_fp32_dual_vector3_divide_by_dual(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const BGC_FP32_DualNumber* const divisor)
|
||||
{
|
||||
const float square_modulus = divisor->real_part * divisor->real_part;
|
||||
|
||||
|
|
@ -252,7 +252,7 @@ inline int bgc_fp32_dual_vector3_divide_by_dual(BGC_FP32_DualVector3* quotient,
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_dual_vector3_divide_by_dual(BGC_FP64_DualVector3* quotient, const BGC_FP64_DualVector3* dividend, const BGC_FP64_DualNumber* divisor)
|
||||
inline int bgc_fp64_dual_vector3_divide_by_dual(BGC_FP64_DualVector3* const quotient, const BGC_FP64_DualVector3* const dividend, const BGC_FP64_DualNumber* const divisor)
|
||||
{
|
||||
const double square_modulus = divisor->real_part * divisor->real_part;
|
||||
|
||||
|
|
@ -268,7 +268,7 @@ inline int bgc_fp64_dual_vector3_divide_by_dual(BGC_FP64_DualVector3* quotient,
|
|||
|
||||
// ====== Divide by Conjugate Dual Number ======= //
|
||||
|
||||
inline int bgc_fp32_dual_vector3_divide_by_conjugate(BGC_FP32_DualVector3* quotient, const BGC_FP32_DualVector3* dividend, const BGC_FP32_DualNumber* divisor_to_conjugate)
|
||||
inline int bgc_fp32_dual_vector3_divide_by_conjugate(BGC_FP32_DualVector3* const quotient, const BGC_FP32_DualVector3* const dividend, const BGC_FP32_DualNumber* const divisor_to_conjugate)
|
||||
{
|
||||
const float square_modulus = divisor_to_conjugate->real_part * divisor_to_conjugate->real_part;
|
||||
|
||||
|
|
@ -282,7 +282,7 @@ inline int bgc_fp32_dual_vector3_divide_by_conjugate(BGC_FP32_DualVector3* quoti
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_dual_vector3_divide_by_conjugate(BGC_FP64_DualVector3* quotient, const BGC_FP64_DualVector3* dividend, const BGC_FP64_DualNumber* divisor_to_conjugate)
|
||||
inline int bgc_fp64_dual_vector3_divide_by_conjugate(BGC_FP64_DualVector3* const quotient, const BGC_FP64_DualVector3* const dividend, const BGC_FP64_DualNumber* const divisor_to_conjugate)
|
||||
{
|
||||
const double square_modulus = divisor_to_conjugate->real_part * divisor_to_conjugate->real_part;
|
||||
|
||||
|
|
@ -298,13 +298,13 @@ inline int bgc_fp64_dual_vector3_divide_by_conjugate(BGC_FP64_DualVector3* quoti
|
|||
|
||||
// ================ Mean of Two ================= //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_get_mean2(BGC_FP32_DualVector3* mean, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second)
|
||||
inline void bgc_fp32_dual_vector3_get_mean2(BGC_FP32_DualVector3* const mean, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second)
|
||||
{
|
||||
bgc_fp32_vector3_get_mean2(&mean->real_part, &first->real_part, &second->real_part);
|
||||
bgc_fp32_vector3_get_mean2(&mean->dual_part, &first->dual_part, &second->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_get_mean2(BGC_FP64_DualVector3* mean, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second)
|
||||
inline void bgc_fp64_dual_vector3_get_mean2(BGC_FP64_DualVector3* const mean, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second)
|
||||
{
|
||||
bgc_fp64_vector3_get_mean2(&mean->real_part, &first->real_part, &second->real_part);
|
||||
bgc_fp64_vector3_get_mean2(&mean->dual_part, &first->dual_part, &second->dual_part);
|
||||
|
|
@ -312,13 +312,13 @@ inline void bgc_fp64_dual_vector3_get_mean2(BGC_FP64_DualVector3* mean, const BG
|
|||
|
||||
// =============== Mean of Three ================ //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_get_mean3(BGC_FP32_DualVector3* mean, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second, const BGC_FP32_DualVector3* third)
|
||||
inline void bgc_fp32_dual_vector3_get_mean3(BGC_FP32_DualVector3* const mean, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second, const BGC_FP32_DualVector3* const third)
|
||||
{
|
||||
bgc_fp32_vector3_get_mean3(&mean->real_part, &first->real_part, &second->real_part, &third->real_part);
|
||||
bgc_fp32_vector3_get_mean3(&mean->dual_part, &first->dual_part, &second->dual_part, &third->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_get_mean3(BGC_FP64_DualVector3* mean, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second, const BGC_FP64_DualVector3* third)
|
||||
inline void bgc_fp64_dual_vector3_get_mean3(BGC_FP64_DualVector3* const mean, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second, const BGC_FP64_DualVector3* const third)
|
||||
{
|
||||
bgc_fp64_vector3_get_mean3(&mean->real_part, &first->real_part, &second->real_part, &third->real_part);
|
||||
bgc_fp64_vector3_get_mean3(&mean->dual_part, &first->dual_part, &second->dual_part, &third->dual_part);
|
||||
|
|
@ -326,13 +326,13 @@ inline void bgc_fp64_dual_vector3_get_mean3(BGC_FP64_DualVector3* mean, const BG
|
|||
|
||||
// ============ Linear Interpolation ============ //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_interpolate(BGC_FP32_DualVector3* interpolation, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second, const float phase)
|
||||
inline void bgc_fp32_dual_vector3_interpolate(BGC_FP32_DualVector3* const interpolation, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second, const float phase)
|
||||
{
|
||||
bgc_fp32_vector3_interpolate(&interpolation->real_part, &first->real_part, &second->real_part, phase);
|
||||
bgc_fp32_vector3_interpolate(&interpolation->dual_part, &first->dual_part, &second->dual_part, phase);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_interpolate(BGC_FP64_DualVector3* interpolation, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second, const double phase)
|
||||
inline void bgc_fp64_dual_vector3_interpolate(BGC_FP64_DualVector3* const interpolation, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second, const double phase)
|
||||
{
|
||||
bgc_fp64_vector3_interpolate(&interpolation->real_part, &first->real_part, &second->real_part, phase);
|
||||
bgc_fp64_vector3_interpolate(&interpolation->dual_part, &first->dual_part, &second->dual_part, phase);
|
||||
|
|
@ -340,13 +340,13 @@ inline void bgc_fp64_dual_vector3_interpolate(BGC_FP64_DualVector3* interpolatio
|
|||
|
||||
// ================ Dot Product ================= //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_get_dot_product(BGC_FP32_DualNumber* product, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second)
|
||||
inline void bgc_fp32_dual_vector3_get_dot_product(BGC_FP32_DualNumber* const product, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second)
|
||||
{
|
||||
product->real_part = bgc_fp32_vector3_get_dot_product(&first->real_part, &second->real_part);
|
||||
product->dual_part = bgc_fp32_vector3_get_dot_product(&first->dual_part, &second->real_part) + bgc_fp32_vector3_get_dot_product(&first->real_part, &second->dual_part);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_get_dot_product(BGC_FP64_DualNumber* product, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second)
|
||||
inline void bgc_fp64_dual_vector3_get_dot_product(BGC_FP64_DualNumber* const product, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second)
|
||||
{
|
||||
product->real_part = bgc_fp64_vector3_get_dot_product(&first->real_part, &second->real_part);
|
||||
product->dual_part = bgc_fp64_vector3_get_dot_product(&first->dual_part, &second->real_part) + bgc_fp64_vector3_get_dot_product(&first->real_part, &second->dual_part);
|
||||
|
|
@ -354,7 +354,7 @@ inline void bgc_fp64_dual_vector3_get_dot_product(BGC_FP64_DualNumber* product,
|
|||
|
||||
// =============== Cross Product ================ //
|
||||
|
||||
inline void bgc_fp32_dual_vector3_get_cross_product(BGC_FP32_DualVector3* product, const BGC_FP32_DualVector3* first, const BGC_FP32_DualVector3* second)
|
||||
inline void bgc_fp32_dual_vector3_get_cross_product(BGC_FP32_DualVector3* const product, const BGC_FP32_DualVector3* const first, const BGC_FP32_DualVector3* const second)
|
||||
{
|
||||
BGC_FP32_Vector3 part1, part2;
|
||||
|
||||
|
|
@ -365,7 +365,7 @@ inline void bgc_fp32_dual_vector3_get_cross_product(BGC_FP32_DualVector3* produc
|
|||
bgc_fp32_vector3_add(&product->dual_part, &part1, &part2);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_dual_vector3_get_cross_product(BGC_FP64_DualVector3* product, const BGC_FP64_DualVector3* first, const BGC_FP64_DualVector3* second)
|
||||
inline void bgc_fp64_dual_vector3_get_cross_product(BGC_FP64_DualVector3* const product, const BGC_FP64_DualVector3* const first, const BGC_FP64_DualVector3* const second)
|
||||
{
|
||||
BGC_FP64_Vector3 part1, part2;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,94 +1,94 @@
|
|||
#include "./matrix2x2.h"
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_reset(BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_reset(BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp32_matrix2x2_reset(BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_reset(BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_make_identity(BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_make_identity(BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp32_matrix2x2_make_identity(BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_make_identity(BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_make_diagonal(BGC_FP32_Matrix2x2* matrix, const float d1, const float d2);
|
||||
extern inline void bgc_fp64_matrix2x2_make_diagonal(BGC_FP64_Matrix2x2* matrix, const double d1, const double d2);
|
||||
extern inline void bgc_fp32_matrix2x2_make_diagonal(BGC_FP32_Matrix2x2* const matrix, const float d1, const float d2);
|
||||
extern inline void bgc_fp64_matrix2x2_make_diagonal(BGC_FP64_Matrix2x2* const matrix, const double d1, const double d2);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_set_turn(BGC_FP32_Matrix2x2* matrix, const float angle, const int angle_unit);
|
||||
extern inline void bgc_fp64_matrix2x2_set_turn(BGC_FP64_Matrix2x2* matrix, const double angle, const int angle_unit);
|
||||
extern inline void bgc_fp32_matrix2x2_set_turn(BGC_FP32_Matrix2x2* const matrix, const float angle, const int angle_unit);
|
||||
extern inline void bgc_fp64_matrix2x2_set_turn(BGC_FP64_Matrix2x2* const matrix, const double angle, const int angle_unit);
|
||||
|
||||
extern inline float bgc_fp32_matrix2x2_get_determinant(const BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline double bgc_fp64_matrix2x2_get_determinant(const BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline float bgc_fp32_matrix2x2_get_determinant(const BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline double bgc_fp64_matrix2x2_get_determinant(const BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x2_is_identity(const BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_is_identity(const BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp32_matrix2x2_is_identity(const BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_is_identity(const BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x2_is_singular(const BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_is_singular(const BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp32_matrix2x2_is_singular(const BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_is_singular(const BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x2_is_rotation(const BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_is_rotation(const BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp32_matrix2x2_is_rotation(const BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_is_rotation(const BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_copy(BGC_FP32_Matrix2x2* destination, const BGC_FP32_Matrix2x2* source);
|
||||
extern inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* destination, const BGC_FP64_Matrix2x2* source);
|
||||
extern inline void bgc_fp32_matrix2x2_copy(BGC_FP32_Matrix2x2* const destination, const BGC_FP32_Matrix2x2* const source);
|
||||
extern inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* const destination, const BGC_FP64_Matrix2x2* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* matrix1, BGC_FP32_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* matrix1, BGC_FP64_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* const matrix1, BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* const matrix1, BGC_FP64_Matrix2x2* const matrix2);
|
||||
|
||||
extern inline void bgc_fp64_matrix2x2_convert_to_fp32(BGC_FP32_Matrix2x2* destination, const BGC_FP64_Matrix2x2* source);
|
||||
extern inline void bgc_fp32_matrix2x2_convert_to_fp64(BGC_FP64_Matrix2x2* destination, const BGC_FP32_Matrix2x2* source);
|
||||
extern inline void bgc_fp64_matrix2x2_convert_to_fp32(BGC_FP32_Matrix2x2* const destination, const BGC_FP64_Matrix2x2* const source);
|
||||
extern inline void bgc_fp32_matrix2x2_convert_to_fp64(BGC_FP64_Matrix2x2* const destination, const BGC_FP32_Matrix2x2* const source);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x2_get_inverse(BGC_FP32_Matrix2x2* inverse, const BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_get_inverse(BGC_FP64_Matrix2x2* inverse, const BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp32_matrix2x2_get_inverse(BGC_FP32_Matrix2x2* const inverse, const BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_get_inverse(BGC_FP64_Matrix2x2* const inverse, const BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix2x2_invert(BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_invert(BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline int bgc_fp32_matrix2x2_invert(BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline int bgc_fp64_matrix2x2_invert(BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_transpose(BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_transpose(BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp32_matrix2x2_transpose(BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_transpose(BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_get_transposed(BGC_FP32_Matrix2x2* transposed, const BGC_FP32_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_get_transposed(BGC_FP64_Matrix2x2* transposed, const BGC_FP64_Matrix2x2* matrix);
|
||||
extern inline void bgc_fp32_matrix2x2_get_transposed(BGC_FP32_Matrix2x2* const transposed, const BGC_FP32_Matrix2x2* const matrix);
|
||||
extern inline void bgc_fp64_matrix2x2_get_transposed(BGC_FP64_Matrix2x2* const transposed, const BGC_FP64_Matrix2x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_get_row(BGC_FP32_Vector2* row, const BGC_FP32_Matrix2x2* matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* row, const BGC_FP64_Matrix2x2* matrix, const int row_number);
|
||||
extern inline void bgc_fp32_matrix2x2_get_row(BGC_FP32_Vector2* const row, const BGC_FP32_Matrix2x2* const matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* const row, const BGC_FP64_Matrix2x2* const matrix, const int row_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_set_row(BGC_FP32_Matrix2x2* matrix, const int row_number, const BGC_FP32_Vector2* row);
|
||||
extern inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* matrix, const int row_number, const BGC_FP64_Vector2* row);
|
||||
extern inline void bgc_fp32_matrix2x2_set_row(BGC_FP32_Matrix2x2* const matrix, const int row_number, const BGC_FP32_Vector2* const row);
|
||||
extern inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* const matrix, const int row_number, const BGC_FP64_Vector2* const row);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_get_column(BGC_FP32_Vector2* column, const BGC_FP32_Matrix2x2* matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* column, const BGC_FP64_Matrix2x2* matrix, const int column_number);
|
||||
extern inline void bgc_fp32_matrix2x2_get_column(BGC_FP32_Vector2* const column, const BGC_FP32_Matrix2x2* const matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* const column, const BGC_FP64_Matrix2x2* const matrix, const int column_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* matrix, const int column_number, const BGC_FP32_Vector2* column);
|
||||
extern inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* matrix, const int column_number, const BGC_FP64_Vector2* column);
|
||||
extern inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column);
|
||||
extern inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* sum, const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* sum, const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_add_scaled(BGC_FP32_Matrix2x2* sum, const BGC_FP32_Matrix2x2* basic_matrix, const BGC_FP32_Matrix2x2* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x2_add_scaled(BGC_FP64_Matrix2x2* sum, const BGC_FP64_Matrix2x2* basic_matrix, const BGC_FP64_Matrix2x2* scalable_matrix, const double scale);
|
||||
extern inline void bgc_fp32_matrix2x2_add_scaled(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const basic_matrix, const BGC_FP32_Matrix2x2* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x2_add_scaled(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const basic_matrix, const BGC_FP64_Matrix2x2* const scalable_matrix, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_subtract(BGC_FP32_Matrix2x2* difference, const BGC_FP32_Matrix2x2* minuend, const BGC_FP32_Matrix2x2* subtrahend);
|
||||
extern inline void bgc_fp64_matrix2x2_subtract(BGC_FP64_Matrix2x2* difference, const BGC_FP64_Matrix2x2* minuend, const BGC_FP64_Matrix2x2* subtrahend);
|
||||
extern inline void bgc_fp32_matrix2x2_subtract(BGC_FP32_Matrix2x2* const difference, const BGC_FP32_Matrix2x2* const minuend, const BGC_FP32_Matrix2x2* const subtrahend);
|
||||
extern inline void bgc_fp64_matrix2x2_subtract(BGC_FP64_Matrix2x2* const difference, const BGC_FP64_Matrix2x2* const minuend, const BGC_FP64_Matrix2x2* const subtrahend);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_subtract_scaled(BGC_FP32_Matrix2x2* difference, const BGC_FP32_Matrix2x2* basic_matrix, const BGC_FP32_Matrix2x2* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x2_subtract_scaled(BGC_FP64_Matrix2x2* difference, const BGC_FP64_Matrix2x2* basic_matrix, const BGC_FP64_Matrix2x2* scalable_matrix, const double scale);
|
||||
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* product, const BGC_FP32_Matrix2x2* multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_real(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix2x2* multiplicand, const double multiplier);
|
||||
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_vector2(BGC_FP32_Vector2* product, const BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Vector2* vector);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* product, const BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Vector2* vector);
|
||||
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);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* product, const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix3x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix3x2* matrix2);
|
||||
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* quotient, const BGC_FP32_Matrix2x2* dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x2_divide_by_real(BGC_FP64_Matrix2x2* quotient, const BGC_FP64_Matrix2x2* dividend, const double divisor);
|
||||
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 void bgc_fp32_matrix2x2_get_mean2(BGC_FP32_Matrix2x2* mean, const BGC_FP32_Matrix2x2* term1, const BGC_FP32_Matrix2x2* term2);
|
||||
extern inline void bgc_fp64_matrix2x2_get_mean2(BGC_FP64_Matrix2x2* mean, const BGC_FP64_Matrix2x2* term1, const BGC_FP64_Matrix2x2* term2);
|
||||
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);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_get_mean3(BGC_FP32_Matrix2x2* mean, const BGC_FP32_Matrix2x2* term1, const BGC_FP32_Matrix2x2* term2, const BGC_FP32_Matrix2x2* term3);
|
||||
extern inline void bgc_fp64_matrix2x2_get_mean3(BGC_FP64_Matrix2x2* mean, const BGC_FP64_Matrix2x2* term1, const BGC_FP64_Matrix2x2* term2, const BGC_FP64_Matrix2x2* term3);
|
||||
extern inline void bgc_fp32_matrix2x2_get_mean3(BGC_FP32_Matrix2x2* const mean, const BGC_FP32_Matrix2x2* const term1, const BGC_FP32_Matrix2x2* const term2, const BGC_FP32_Matrix2x2* const term3);
|
||||
extern inline void bgc_fp64_matrix2x2_get_mean3(BGC_FP64_Matrix2x2* const mean, const BGC_FP64_Matrix2x2* const term1, const BGC_FP64_Matrix2x2* const term2, const BGC_FP64_Matrix2x2* const term3);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x2_interpolate(BGC_FP32_Matrix2x2* interpolation, const BGC_FP32_Matrix2x2* first, const BGC_FP32_Matrix2x2* second, const float phase);
|
||||
extern inline void bgc_fp64_matrix2x2_interpolate(BGC_FP64_Matrix2x2* interpolation, const BGC_FP64_Matrix2x2* first, const BGC_FP64_Matrix2x2* second, const double phase);
|
||||
extern inline void bgc_fp32_matrix2x2_interpolate(BGC_FP32_Matrix2x2* const interpolation, const BGC_FP32_Matrix2x2* const first, const BGC_FP32_Matrix2x2* const second, const float phase);
|
||||
extern inline void bgc_fp64_matrix2x2_interpolate(BGC_FP64_Matrix2x2* const interpolation, const BGC_FP64_Matrix2x2* const first, const BGC_FP64_Matrix2x2* const second, const double phase);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_reset(BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_reset(BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -17,7 +17,7 @@ inline void bgc_fp32_matrix2x2_reset(BGC_FP32_Matrix2x2* matrix)
|
|||
matrix->r2c2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_reset(BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_reset(BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -27,7 +27,7 @@ inline void bgc_fp64_matrix2x2_reset(BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// ================== Identity ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_make_identity(BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_make_identity(BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 1.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -35,7 +35,7 @@ inline void bgc_fp32_matrix2x2_make_identity(BGC_FP32_Matrix2x2* matrix)
|
|||
matrix->r2c2 = 1.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_make_identity(BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_make_identity(BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 1.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -45,7 +45,7 @@ inline void bgc_fp64_matrix2x2_make_identity(BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// ================ Set Diagonal ================ //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_make_diagonal(BGC_FP32_Matrix2x2* matrix, const float d1, const float d2)
|
||||
inline void bgc_fp32_matrix2x2_make_diagonal(BGC_FP32_Matrix2x2* const matrix, const float d1, const float d2)
|
||||
{
|
||||
matrix->r1c1 = d1;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -53,7 +53,7 @@ inline void bgc_fp32_matrix2x2_make_diagonal(BGC_FP32_Matrix2x2* matrix, const f
|
|||
matrix->r2c2 = d2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_make_diagonal(BGC_FP64_Matrix2x2* matrix, const double d1, const double d2)
|
||||
inline void bgc_fp64_matrix2x2_make_diagonal(BGC_FP64_Matrix2x2* const matrix, const double d1, const double d2)
|
||||
{
|
||||
matrix->r1c1 = d1;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -63,7 +63,7 @@ inline void bgc_fp64_matrix2x2_make_diagonal(BGC_FP64_Matrix2x2* matrix, const d
|
|||
|
||||
// ============== Rotation Matrix =============== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_set_turn(BGC_FP32_Matrix2x2* matrix, const float angle, const int angle_unit)
|
||||
inline void bgc_fp32_matrix2x2_set_turn(BGC_FP32_Matrix2x2* const matrix, const float angle, const int angle_unit)
|
||||
{
|
||||
const float radians = bgc_fp32_angle_to_radians(angle, angle_unit);
|
||||
const float cosine = cosf(radians);
|
||||
|
|
@ -75,7 +75,7 @@ inline void bgc_fp32_matrix2x2_set_turn(BGC_FP32_Matrix2x2* matrix, const float
|
|||
matrix->r2c2 = cosine;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_set_turn(BGC_FP64_Matrix2x2* matrix, const double angle, const int angle_unit)
|
||||
inline void bgc_fp64_matrix2x2_set_turn(BGC_FP64_Matrix2x2* const matrix, const double angle, const int angle_unit)
|
||||
{
|
||||
const double radians = bgc_fp64_angle_to_radians(angle, angle_unit);
|
||||
const double cosine = cos(radians);
|
||||
|
|
@ -89,19 +89,19 @@ inline void bgc_fp64_matrix2x2_set_turn(BGC_FP64_Matrix2x2* matrix, const double
|
|||
|
||||
// ================ Determinant ================= //
|
||||
|
||||
inline float bgc_fp32_matrix2x2_get_determinant(const BGC_FP32_Matrix2x2* matrix)
|
||||
inline float bgc_fp32_matrix2x2_get_determinant(const BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
return matrix->r1c1 * matrix->r2c2 - matrix->r1c2 * matrix->r2c1;
|
||||
}
|
||||
|
||||
inline double bgc_fp64_matrix2x2_get_determinant(const BGC_FP64_Matrix2x2* matrix)
|
||||
inline double bgc_fp64_matrix2x2_get_determinant(const BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
return matrix->r1c1 * matrix->r2c2 - matrix->r1c2 * matrix->r2c1;
|
||||
}
|
||||
|
||||
// ================ Is Identity ================= //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_is_identity(const BGC_FP32_Matrix2x2* matrix)
|
||||
inline int bgc_fp32_matrix2x2_is_identity(const BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
return bgc_fp32_is_unit(matrix->r1c1) && bgc_fp32_is_zero(matrix->r1c2)
|
||||
&& bgc_fp32_is_zero(matrix->r2c1) && bgc_fp32_is_unit(matrix->r2c2);
|
||||
|
|
@ -115,19 +115,19 @@ inline int bgc_fp64_matrix2x2_is_identity(const BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// ================ Is Singular ================= //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_is_singular(const BGC_FP32_Matrix2x2* matrix)
|
||||
inline int bgc_fp32_matrix2x2_is_singular(const BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
return bgc_fp32_is_zero(bgc_fp32_matrix2x2_get_determinant(matrix));
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x2_is_singular(const BGC_FP64_Matrix2x2* matrix)
|
||||
inline int bgc_fp64_matrix2x2_is_singular(const BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
return bgc_fp64_is_zero(bgc_fp64_matrix2x2_get_determinant(matrix));
|
||||
}
|
||||
|
||||
// ================ Is Rotation ================= //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_is_rotation(const BGC_FP32_Matrix2x2* matrix)
|
||||
inline int bgc_fp32_matrix2x2_is_rotation(const BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
BGC_FP32_Matrix2x2 product;
|
||||
|
||||
|
|
@ -140,7 +140,7 @@ inline int bgc_fp32_matrix2x2_is_rotation(const BGC_FP32_Matrix2x2* matrix)
|
|||
return bgc_fp32_matrix2x2_is_identity(&product);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x2_is_rotation(const BGC_FP64_Matrix2x2* matrix)
|
||||
inline int bgc_fp64_matrix2x2_is_rotation(const BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
BGC_FP64_Matrix2x2 product;
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ inline int bgc_fp64_matrix2x2_is_rotation(const BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_copy(BGC_FP32_Matrix2x2* destination, const BGC_FP32_Matrix2x2* source)
|
||||
inline void bgc_fp32_matrix2x2_copy(BGC_FP32_Matrix2x2* const destination, const BGC_FP32_Matrix2x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -164,7 +164,7 @@ inline void bgc_fp32_matrix2x2_copy(BGC_FP32_Matrix2x2* destination, const BGC_F
|
|||
destination->r2c2 = source->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* destination, const BGC_FP64_Matrix2x2* source)
|
||||
inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* const destination, const BGC_FP64_Matrix2x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -175,7 +175,7 @@ inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* destination, const BGC_F
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* matrix1, BGC_FP32_Matrix2x2* matrix2)
|
||||
inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* const matrix1, BGC_FP32_Matrix2x2* const matrix2)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
|
|
@ -196,7 +196,7 @@ inline void bgc_fp32_matrix2x2_swap(BGC_FP32_Matrix2x2* matrix1, BGC_FP32_Matrix
|
|||
matrix1->r2c2 = r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* matrix1, BGC_FP64_Matrix2x2* matrix2)
|
||||
inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* const matrix1, BGC_FP64_Matrix2x2* const matrix2)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
|
|
@ -219,7 +219,7 @@ inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* matrix1, BGC_FP64_Matrix
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_matrix2x2_convert_to_fp32(BGC_FP32_Matrix2x2* destination, const BGC_FP64_Matrix2x2* source)
|
||||
inline void bgc_fp64_matrix2x2_convert_to_fp32(BGC_FP32_Matrix2x2* const destination, const BGC_FP64_Matrix2x2* const source)
|
||||
{
|
||||
destination->r1c1 = (float)source->r1c1;
|
||||
destination->r1c2 = (float)source->r1c2;
|
||||
|
|
@ -228,7 +228,7 @@ inline void bgc_fp64_matrix2x2_convert_to_fp32(BGC_FP32_Matrix2x2* destination,
|
|||
destination->r2c2 = (float)source->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_matrix2x2_convert_to_fp64(BGC_FP64_Matrix2x2* destination, const BGC_FP32_Matrix2x2* source)
|
||||
inline void bgc_fp32_matrix2x2_convert_to_fp64(BGC_FP64_Matrix2x2* const destination, const BGC_FP32_Matrix2x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -239,7 +239,7 @@ inline void bgc_fp32_matrix2x2_convert_to_fp64(BGC_FP64_Matrix2x2* destination,
|
|||
|
||||
// ================ Get Inverse ================= //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_get_inverse(BGC_FP32_Matrix2x2* inverse, const BGC_FP32_Matrix2x2* matrix)
|
||||
inline int bgc_fp32_matrix2x2_get_inverse(BGC_FP32_Matrix2x2* const inverse, const BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
const float determinant = bgc_fp32_matrix2x2_get_determinant(matrix);
|
||||
|
||||
|
|
@ -264,7 +264,7 @@ inline int bgc_fp32_matrix2x2_get_inverse(BGC_FP32_Matrix2x2* inverse, const BGC
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x2_get_inverse(BGC_FP64_Matrix2x2* inverse, const BGC_FP64_Matrix2x2* matrix)
|
||||
inline int bgc_fp64_matrix2x2_get_inverse(BGC_FP64_Matrix2x2* const inverse, const BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
const double determinant = bgc_fp64_matrix2x2_get_determinant(matrix);
|
||||
|
||||
|
|
@ -291,26 +291,26 @@ inline int bgc_fp64_matrix2x2_get_inverse(BGC_FP64_Matrix2x2* inverse, const BGC
|
|||
|
||||
// =================== Invert =================== //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_invert(BGC_FP32_Matrix2x2* matrix)
|
||||
inline int bgc_fp32_matrix2x2_invert(BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
return bgc_fp32_matrix2x2_get_inverse(matrix, matrix);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x2_invert(BGC_FP64_Matrix2x2* matrix)
|
||||
inline int bgc_fp64_matrix2x2_invert(BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
return bgc_fp64_matrix2x2_get_inverse(matrix, matrix);
|
||||
}
|
||||
|
||||
// ================= Transpose ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_transpose(BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_transpose(BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
const float r1c2 = matrix->r1c2;
|
||||
matrix->r1c2 = matrix->r2c1;
|
||||
matrix->r2c1 = r1c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_transpose(BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_transpose(BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
const double r1c2 = matrix->r1c2;
|
||||
matrix->r1c2 = matrix->r2c1;
|
||||
|
|
@ -319,7 +319,7 @@ inline void bgc_fp64_matrix2x2_transpose(BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// =============== Get Transpose ================ //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_transposed(BGC_FP32_Matrix2x2* transposed, const BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_get_transposed(BGC_FP32_Matrix2x2* const transposed, const BGC_FP32_Matrix2x2* const matrix)
|
||||
{
|
||||
const float r1c2 = matrix->r1c2;
|
||||
|
||||
|
|
@ -330,7 +330,7 @@ inline void bgc_fp32_matrix2x2_get_transposed(BGC_FP32_Matrix2x2* transposed, co
|
|||
transposed->r2c2 = matrix->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_transposed(BGC_FP64_Matrix2x2* transposed, const BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_get_transposed(BGC_FP64_Matrix2x2* const transposed, const BGC_FP64_Matrix2x2* const matrix)
|
||||
{
|
||||
const double r1c2 = matrix->r1c2;
|
||||
|
||||
|
|
@ -343,7 +343,7 @@ inline void bgc_fp64_matrix2x2_get_transposed(BGC_FP64_Matrix2x2* transposed, co
|
|||
|
||||
// ================== Get Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_row(BGC_FP32_Vector2* row, const BGC_FP32_Matrix2x2* matrix, const int row_number)
|
||||
inline void bgc_fp32_matrix2x2_get_row(BGC_FP32_Vector2* const row, const BGC_FP32_Matrix2x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
|
|
@ -361,7 +361,7 @@ inline void bgc_fp32_matrix2x2_get_row(BGC_FP32_Vector2* row, const BGC_FP32_Mat
|
|||
row->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* row, const BGC_FP64_Matrix2x2* matrix, const int row_number)
|
||||
inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* const row, const BGC_FP64_Matrix2x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
|
|
@ -381,7 +381,7 @@ inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* row, const BGC_FP64_Mat
|
|||
|
||||
// ================== Set Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_set_row(BGC_FP32_Matrix2x2* matrix, const int row_number, const BGC_FP32_Vector2* row)
|
||||
inline void bgc_fp32_matrix2x2_set_row(BGC_FP32_Matrix2x2* const matrix, const int row_number, const BGC_FP32_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
|
|
@ -395,7 +395,7 @@ inline void bgc_fp32_matrix2x2_set_row(BGC_FP32_Matrix2x2* matrix, const int row
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* matrix, const int row_number, const BGC_FP64_Vector2* row)
|
||||
inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* const matrix, const int row_number, const BGC_FP64_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
|
|
@ -411,7 +411,7 @@ inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* matrix, const int row
|
|||
|
||||
// ================= Get Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_column(BGC_FP32_Vector2* column, const BGC_FP32_Matrix2x2* matrix, const int column_number)
|
||||
inline void bgc_fp32_matrix2x2_get_column(BGC_FP32_Vector2* const column, const BGC_FP32_Matrix2x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
|
|
@ -429,7 +429,7 @@ inline void bgc_fp32_matrix2x2_get_column(BGC_FP32_Vector2* column, const BGC_FP
|
|||
column->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* column, const BGC_FP64_Matrix2x2* matrix, const int column_number)
|
||||
inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* const column, const BGC_FP64_Matrix2x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
|
|
@ -449,7 +449,7 @@ inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* column, const BGC_FP
|
|||
|
||||
// ================= Set Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* matrix, const int column_number, const BGC_FP32_Vector2* column)
|
||||
inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
|
|
@ -463,7 +463,7 @@ inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* matrix, const int
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* matrix, const int column_number, const BGC_FP64_Vector2* column)
|
||||
inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
|
|
@ -479,7 +479,7 @@ inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* matrix, const int
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* sum, const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix2x2* matrix2)
|
||||
inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -488,7 +488,7 @@ inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* sum, const BGC_FP32_Matri
|
|||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* sum, const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix2x2* matrix2)
|
||||
inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -499,7 +499,7 @@ inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* sum, const BGC_FP64_Matri
|
|||
|
||||
// ================= Add Scaled ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_add_scaled(BGC_FP32_Matrix2x2* sum, const BGC_FP32_Matrix2x2* basic_matrix, const BGC_FP32_Matrix2x2* scalable_matrix, const float scale)
|
||||
inline void bgc_fp32_matrix2x2_add_scaled(BGC_FP32_Matrix2x2* const sum, const BGC_FP32_Matrix2x2* const basic_matrix, const BGC_FP32_Matrix2x2* const scalable_matrix, const float scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -508,7 +508,7 @@ inline void bgc_fp32_matrix2x2_add_scaled(BGC_FP32_Matrix2x2* sum, const BGC_FP3
|
|||
sum->r2c2 = basic_matrix->r2c2 + scalable_matrix->r2c2 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_add_scaled(BGC_FP64_Matrix2x2* sum, const BGC_FP64_Matrix2x2* basic_matrix, const BGC_FP64_Matrix2x2* scalable_matrix, const double scale)
|
||||
inline void bgc_fp64_matrix2x2_add_scaled(BGC_FP64_Matrix2x2* const sum, const BGC_FP64_Matrix2x2* const basic_matrix, const BGC_FP64_Matrix2x2* const scalable_matrix, const double scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -519,7 +519,7 @@ inline void bgc_fp64_matrix2x2_add_scaled(BGC_FP64_Matrix2x2* sum, const BGC_FP6
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_subtract(BGC_FP32_Matrix2x2* difference, const BGC_FP32_Matrix2x2* minuend, const BGC_FP32_Matrix2x2* subtrahend)
|
||||
inline void bgc_fp32_matrix2x2_subtract(BGC_FP32_Matrix2x2* const difference, const BGC_FP32_Matrix2x2* const minuend, const BGC_FP32_Matrix2x2* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -528,7 +528,7 @@ inline void bgc_fp32_matrix2x2_subtract(BGC_FP32_Matrix2x2* difference, const BG
|
|||
difference->r2c2 = minuend->r2c2 - subtrahend->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_subtract(BGC_FP64_Matrix2x2* difference, const BGC_FP64_Matrix2x2* minuend, const BGC_FP64_Matrix2x2* subtrahend)
|
||||
inline void bgc_fp64_matrix2x2_subtract(BGC_FP64_Matrix2x2* const difference, const BGC_FP64_Matrix2x2* const minuend, const BGC_FP64_Matrix2x2* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -539,7 +539,7 @@ inline void bgc_fp64_matrix2x2_subtract(BGC_FP64_Matrix2x2* difference, const BG
|
|||
|
||||
// ============== Subtract Scaled =============== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_subtract_scaled(BGC_FP32_Matrix2x2* difference, const BGC_FP32_Matrix2x2* basic_matrix, const BGC_FP32_Matrix2x2* scalable_matrix, const float scale)
|
||||
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)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -548,7 +548,7 @@ inline void bgc_fp32_matrix2x2_subtract_scaled(BGC_FP32_Matrix2x2* difference, c
|
|||
difference->r2c2 = basic_matrix->r2c2 - scalable_matrix->r2c2 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_subtract_scaled(BGC_FP64_Matrix2x2* difference, const BGC_FP64_Matrix2x2* basic_matrix, const BGC_FP64_Matrix2x2* scalable_matrix, const double scale)
|
||||
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)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -559,7 +559,7 @@ inline void bgc_fp64_matrix2x2_subtract_scaled(BGC_FP64_Matrix2x2* difference, c
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_real(BGC_FP32_Matrix2x2* product, const BGC_FP32_Matrix2x2* multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_real(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* product, con
|
|||
product->r2c2 = multiplicand->r2c2 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_real(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix2x2* multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_real(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -579,7 +579,7 @@ inline void bgc_fp64_matrix2x2_multiply_by_real(BGC_FP64_Matrix2x2* product, con
|
|||
|
||||
// ============ Right Vector Product ============ //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_vector2(BGC_FP32_Vector2* product, const BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Vector2* vector)
|
||||
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)
|
||||
{
|
||||
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
|
|
@ -588,7 +588,7 @@ inline void bgc_fp32_matrix2x2_multiply_by_vector2(BGC_FP32_Vector2* product, co
|
|||
product->x2 = x2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* product, const BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Vector2* vector)
|
||||
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)
|
||||
{
|
||||
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
|
|
@ -599,7 +599,7 @@ inline void bgc_fp64_matrix2x2_multiply_by_vector2(BGC_FP64_Vector2* product, co
|
|||
|
||||
// ========== Matrix Product 2x2 at 2x2 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* product, const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix2x2* matrix2)
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix2x2* const matrix1, const BGC_FP32_Matrix2x2* const matrix2)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -614,7 +614,7 @@ inline void bgc_fp32_matrix2x2_multiply_by_matrix2x2(BGC_FP32_Matrix2x2* product
|
|||
product->r2c2 = r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix2x2* matrix2)
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix2x2* const matrix1, const BGC_FP64_Matrix2x2* const matrix2)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -631,7 +631,7 @@ inline void bgc_fp64_matrix2x2_multiply_by_matrix2x2(BGC_FP64_Matrix2x2* product
|
|||
|
||||
// ========== Matrix Product 2x2 at 3x2 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix3x2* matrix2)
|
||||
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)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -650,7 +650,7 @@ inline void bgc_fp32_matrix2x2_multiply_by_matrix3x2(BGC_FP32_Matrix3x2* product
|
|||
product->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix3x2* matrix2)
|
||||
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)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -671,7 +671,7 @@ inline void bgc_fp64_matrix2x2_multiply_by_matrix3x2(BGC_FP64_Matrix3x2* product
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_divide_by_real(BGC_FP32_Matrix2x2* quotient, const BGC_FP32_Matrix2x2* dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix2x2_divide_by_real(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;
|
||||
|
|
@ -681,7 +681,7 @@ inline int bgc_fp32_matrix2x2_divide_by_real(BGC_FP32_Matrix2x2* quotient, const
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x2_divide_by_real(BGC_FP64_Matrix2x2* quotient, const BGC_FP64_Matrix2x2* dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix2x2_divide_by_real(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;
|
||||
|
|
@ -693,7 +693,7 @@ inline int bgc_fp64_matrix2x2_divide_by_real(BGC_FP64_Matrix2x2* quotient, const
|
|||
|
||||
// ================== Average2 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_mean2(BGC_FP32_Matrix2x2* mean, const BGC_FP32_Matrix2x2* term1, const BGC_FP32_Matrix2x2* term2)
|
||||
inline void bgc_fp32_matrix2x2_get_mean2(BGC_FP32_Matrix2x2* const mean, const BGC_FP32_Matrix2x2* const term1, const BGC_FP32_Matrix2x2* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5f;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5f;
|
||||
|
|
@ -702,7 +702,7 @@ inline void bgc_fp32_matrix2x2_get_mean2(BGC_FP32_Matrix2x2* mean, const BGC_FP3
|
|||
mean->r2c2 = (term1->r2c2 + term2->r2c2) * 0.5f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_mean2(BGC_FP64_Matrix2x2* mean, const BGC_FP64_Matrix2x2* term1, const BGC_FP64_Matrix2x2* term2)
|
||||
inline void bgc_fp64_matrix2x2_get_mean2(BGC_FP64_Matrix2x2* const mean, const BGC_FP64_Matrix2x2* const term1, const BGC_FP64_Matrix2x2* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5;
|
||||
|
|
@ -713,7 +713,7 @@ inline void bgc_fp64_matrix2x2_get_mean2(BGC_FP64_Matrix2x2* mean, const BGC_FP6
|
|||
|
||||
// ================== Average3 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_mean3(BGC_FP32_Matrix2x2* mean, const BGC_FP32_Matrix2x2* term1, const BGC_FP32_Matrix2x2* term2, const BGC_FP32_Matrix2x2* term3)
|
||||
inline void bgc_fp32_matrix2x2_get_mean3(BGC_FP32_Matrix2x2* const mean, const BGC_FP32_Matrix2x2* const term1, const BGC_FP32_Matrix2x2* const term2, const BGC_FP32_Matrix2x2* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP32_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP32_ONE_THIRD;
|
||||
|
|
@ -722,7 +722,7 @@ inline void bgc_fp32_matrix2x2_get_mean3(BGC_FP32_Matrix2x2* mean, const BGC_FP3
|
|||
mean->r2c2 = (term1->r2c2 + term2->r2c2 + term3->r2c2) * BGC_FP32_ONE_THIRD;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_mean3(BGC_FP64_Matrix2x2* mean, const BGC_FP64_Matrix2x2* term1, const BGC_FP64_Matrix2x2* term2, const BGC_FP64_Matrix2x2* term3)
|
||||
inline void bgc_fp64_matrix2x2_get_mean3(BGC_FP64_Matrix2x2* const mean, const BGC_FP64_Matrix2x2* const term1, const BGC_FP64_Matrix2x2* const term2, const BGC_FP64_Matrix2x2* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP64_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP64_ONE_THIRD;
|
||||
|
|
@ -733,7 +733,7 @@ inline void bgc_fp64_matrix2x2_get_mean3(BGC_FP64_Matrix2x2* mean, const BGC_FP6
|
|||
|
||||
// ================ Interpolate ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_interpolate(BGC_FP32_Matrix2x2* interpolation, const BGC_FP32_Matrix2x2* first, const BGC_FP32_Matrix2x2* second, const float phase)
|
||||
inline void bgc_fp32_matrix2x2_interpolate(BGC_FP32_Matrix2x2* const interpolation, const BGC_FP32_Matrix2x2* const first, const BGC_FP32_Matrix2x2* const second, const float phase)
|
||||
{
|
||||
const float counter_phase = 1.0f - phase;
|
||||
|
||||
|
|
@ -744,7 +744,7 @@ inline void bgc_fp32_matrix2x2_interpolate(BGC_FP32_Matrix2x2* interpolation, co
|
|||
interpolation->r2c2 = first->r2c2 * counter_phase + second->r2c2 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_interpolate(BGC_FP64_Matrix2x2* interpolation, const BGC_FP64_Matrix2x2* first, const BGC_FP64_Matrix2x2* second, const double phase)
|
||||
inline void bgc_fp64_matrix2x2_interpolate(BGC_FP64_Matrix2x2* const interpolation, const BGC_FP64_Matrix2x2* const first, const BGC_FP64_Matrix2x2* const second, const double phase)
|
||||
{
|
||||
const double counter_phase = 1.0 - phase;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,64 +1,64 @@
|
|||
#include "./matrix2x3.h"
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_reset(BGC_FP32_Matrix2x3* matrix);
|
||||
extern inline void bgc_fp64_matrix2x3_reset(BGC_FP64_Matrix2x3* matrix);
|
||||
extern inline void bgc_fp32_matrix2x3_reset(BGC_FP32_Matrix2x3* const matrix);
|
||||
extern inline void bgc_fp64_matrix2x3_reset(BGC_FP64_Matrix2x3* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_copy(BGC_FP32_Matrix2x3* destination, const BGC_FP32_Matrix2x3* source);
|
||||
extern inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* destination, const BGC_FP64_Matrix2x3* source);
|
||||
extern inline void bgc_fp32_matrix2x3_copy(BGC_FP32_Matrix2x3* const destination, const BGC_FP32_Matrix2x3* const source);
|
||||
extern inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* const destination, const BGC_FP64_Matrix2x3* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* matrix1, BGC_FP32_Matrix2x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* matrix1, BGC_FP64_Matrix2x3* matrix2);
|
||||
extern inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* const matrix1, BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* const matrix1, BGC_FP64_Matrix2x3* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_convert_to_fp64(BGC_FP64_Matrix2x3* destination, const BGC_FP32_Matrix2x3* source);
|
||||
extern inline void bgc_fp64_matrix2x3_convert_to_fp32(BGC_FP32_Matrix2x3* destination, const BGC_FP64_Matrix2x3* source);
|
||||
extern inline void bgc_fp32_matrix2x3_convert_to_fp64(BGC_FP64_Matrix2x3* const destination, const BGC_FP32_Matrix2x3* const source);
|
||||
extern inline void bgc_fp64_matrix2x3_convert_to_fp32(BGC_FP32_Matrix2x3* const destination, const BGC_FP64_Matrix2x3* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_get_transposed(BGC_FP32_Matrix2x3* transposed, const BGC_FP32_Matrix3x2* matrix);
|
||||
extern inline void bgc_fp64_matrix2x3_get_transposed(BGC_FP64_Matrix2x3* transposed, const BGC_FP64_Matrix3x2* matrix);
|
||||
extern inline void bgc_fp32_matrix2x3_get_transposed(BGC_FP32_Matrix2x3* const transposed, const BGC_FP32_Matrix3x2* const matrix);
|
||||
extern inline void bgc_fp64_matrix2x3_get_transposed(BGC_FP64_Matrix2x3* const transposed, const BGC_FP64_Matrix3x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_get_row(BGC_FP32_Vector2* row, const BGC_FP32_Matrix2x3* matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix2x3_get_row(BGC_FP64_Vector2* row, const BGC_FP64_Matrix2x3* matrix, const int row_number);
|
||||
extern inline void bgc_fp32_matrix2x3_get_row(BGC_FP32_Vector2* const row, const BGC_FP32_Matrix2x3* const matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix2x3_get_row(BGC_FP64_Vector2* const row, const BGC_FP64_Matrix2x3* const matrix, const int row_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_set_row(BGC_FP32_Matrix2x3* matrix, const int row_number, const BGC_FP32_Vector2* row);
|
||||
extern inline void bgc_fp64_matrix2x3_set_row(BGC_FP64_Matrix2x3* matrix, const int row_number, const BGC_FP64_Vector2* row);
|
||||
extern inline void bgc_fp32_matrix2x3_set_row(BGC_FP32_Matrix2x3* const matrix, const int row_number, const BGC_FP32_Vector2* const row);
|
||||
extern inline void bgc_fp64_matrix2x3_set_row(BGC_FP64_Matrix2x3* const matrix, const int row_number, const BGC_FP64_Vector2* const row);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_get_column(BGC_FP32_Vector3* column, const BGC_FP32_Matrix2x3* matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* column, const BGC_FP64_Matrix2x3* matrix, const int column_number);
|
||||
extern inline void bgc_fp32_matrix2x3_get_column(BGC_FP32_Vector3* const column, const BGC_FP32_Matrix2x3* const matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* const column, const BGC_FP64_Matrix2x3* const matrix, const int column_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_set_column(BGC_FP32_Matrix2x3* matrix, const int number, const BGC_FP32_Vector3* column);
|
||||
extern inline void bgc_fp64_matrix2x3_set_column(BGC_FP64_Matrix2x3* matrix, const int number, const BGC_FP64_Vector3* column);
|
||||
extern inline void bgc_fp32_matrix2x3_set_column(BGC_FP32_Matrix2x3* const matrix, const int number, const BGC_FP32_Vector3* const column);
|
||||
extern inline void bgc_fp64_matrix2x3_set_column(BGC_FP64_Matrix2x3* const matrix, const int number, const BGC_FP64_Vector3* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* sum, const BGC_FP32_Matrix2x3* matrix1, const BGC_FP32_Matrix2x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* sum, const BGC_FP64_Matrix2x3* matrix1, const BGC_FP64_Matrix2x3* matrix2);
|
||||
extern inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x3* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_add_scaled(BGC_FP32_Matrix2x3* sum, const BGC_FP32_Matrix2x3* basic_matrix, const BGC_FP32_Matrix2x3* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x3_add_scaled(BGC_FP64_Matrix2x3* sum, const BGC_FP64_Matrix2x3* basic_matrix, const BGC_FP64_Matrix2x3* scalable_matrix, const double scale);
|
||||
extern inline void bgc_fp32_matrix2x3_add_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_add_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_subtract(BGC_FP32_Matrix2x3* difference, const BGC_FP32_Matrix2x3* minuend, const BGC_FP32_Matrix2x3* subtrahend);
|
||||
extern inline void bgc_fp64_matrix2x3_subtract(BGC_FP64_Matrix2x3* difference, const BGC_FP64_Matrix2x3* minuend, const BGC_FP64_Matrix2x3* subtrahend);
|
||||
extern inline void bgc_fp32_matrix2x3_subtract(BGC_FP32_Matrix2x3* const difference, const BGC_FP32_Matrix2x3* const minuend, const BGC_FP32_Matrix2x3* const subtrahend);
|
||||
extern inline void bgc_fp64_matrix2x3_subtract(BGC_FP64_Matrix2x3* const difference, const BGC_FP64_Matrix2x3* const minuend, const BGC_FP64_Matrix2x3* const subtrahend);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_subtract_scaled(BGC_FP32_Matrix2x3* sum, const BGC_FP32_Matrix2x3* basic_matrix, const BGC_FP32_Matrix2x3* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix2x3_subtract_scaled(BGC_FP64_Matrix2x3* sum, const BGC_FP64_Matrix2x3* basic_matrix, const BGC_FP64_Matrix2x3* scalable_matrix, const double scale);
|
||||
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* product, const BGC_FP32_Matrix2x3* multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_real(BGC_FP64_Matrix2x3* product, const BGC_FP64_Matrix2x3* multiplicand, const double multiplier);
|
||||
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_vector2(BGC_FP32_Vector3* product, const BGC_FP32_Matrix2x3* matrix, const BGC_FP32_Vector2* vector);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_vector2(BGC_FP64_Vector3* product, const BGC_FP64_Matrix2x3* matrix, const BGC_FP64_Vector2* vector);
|
||||
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);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* product, const BGC_FP32_Matrix2x3* matrix1, const BGC_FP32_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* product, const BGC_FP64_Matrix2x3* matrix1, const BGC_FP64_Matrix2x2* matrix2);
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x2* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* product, const BGC_FP32_Matrix2x3* matrix1, const BGC_FP32_Matrix3x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* product, const BGC_FP64_Matrix2x3* matrix1, const BGC_FP64_Matrix3x2* matrix2);
|
||||
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* quotient, const BGC_FP32_Matrix2x3* dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix2x3_divide_by_real(BGC_FP64_Matrix2x3* quotient, const BGC_FP64_Matrix2x3* dividend, const double divisor);
|
||||
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 void bgc_fp32_matrix2x3_get_mean2(BGC_FP32_Matrix2x3* mean, const BGC_FP32_Matrix2x3* term1, const BGC_FP32_Matrix2x3* term2);
|
||||
extern inline void bgc_fp64_matrix2x3_get_mean2(BGC_FP64_Matrix2x3* mean, const BGC_FP64_Matrix2x3* term1, const BGC_FP64_Matrix2x3* term2);
|
||||
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);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_get_mean3(BGC_FP32_Matrix2x3* mean, const BGC_FP32_Matrix2x3* term1, const BGC_FP32_Matrix2x3* term2, const BGC_FP32_Matrix2x3* term3);
|
||||
extern inline void bgc_fp64_matrix2x3_get_mean3(BGC_FP64_Matrix2x3* mean, const BGC_FP64_Matrix2x3* term1, const BGC_FP64_Matrix2x3* term2, const BGC_FP64_Matrix2x3* term3);
|
||||
extern inline void bgc_fp32_matrix2x3_get_mean3(BGC_FP32_Matrix2x3* const mean, const BGC_FP32_Matrix2x3* const term1, const BGC_FP32_Matrix2x3* const term2, const BGC_FP32_Matrix2x3* const term3);
|
||||
extern inline void bgc_fp64_matrix2x3_get_mean3(BGC_FP64_Matrix2x3* const mean, const BGC_FP64_Matrix2x3* const term1, const BGC_FP64_Matrix2x3* const term2, const BGC_FP64_Matrix2x3* const term3);
|
||||
|
||||
extern inline void bgc_fp32_matrix2x3_interpolate(BGC_FP32_Matrix2x3* interpolation, const BGC_FP32_Matrix2x3* first, const BGC_FP32_Matrix2x3* second, const float phase);
|
||||
extern inline void bgc_fp64_matrix2x3_interpolate(BGC_FP64_Matrix2x3* interpolation, const BGC_FP64_Matrix2x3* first, const BGC_FP64_Matrix2x3* second, const double phase);
|
||||
extern inline void bgc_fp32_matrix2x3_interpolate(BGC_FP32_Matrix2x3* const interpolation, const BGC_FP32_Matrix2x3* const first, const BGC_FP32_Matrix2x3* const second, const float phase);
|
||||
extern inline void bgc_fp64_matrix2x3_interpolate(BGC_FP64_Matrix2x3* const interpolation, const BGC_FP64_Matrix2x3* const first, const BGC_FP64_Matrix2x3* const second, const double phase);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_reset(BGC_FP32_Matrix2x3* matrix)
|
||||
inline void bgc_fp32_matrix2x3_reset(BGC_FP32_Matrix2x3* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -20,7 +20,7 @@ inline void bgc_fp32_matrix2x3_reset(BGC_FP32_Matrix2x3* matrix)
|
|||
matrix->r3c2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_reset(BGC_FP64_Matrix2x3* matrix)
|
||||
inline void bgc_fp64_matrix2x3_reset(BGC_FP64_Matrix2x3* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -34,7 +34,7 @@ inline void bgc_fp64_matrix2x3_reset(BGC_FP64_Matrix2x3* matrix)
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_copy(BGC_FP32_Matrix2x3* destination, const BGC_FP32_Matrix2x3* source)
|
||||
inline void bgc_fp32_matrix2x3_copy(BGC_FP32_Matrix2x3* const destination, const BGC_FP32_Matrix2x3* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -46,7 +46,7 @@ inline void bgc_fp32_matrix2x3_copy(BGC_FP32_Matrix2x3* destination, const BGC_F
|
|||
destination->r3c2 = source->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* destination, const BGC_FP64_Matrix2x3* source)
|
||||
inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* const destination, const BGC_FP64_Matrix2x3* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -60,7 +60,7 @@ inline void bgc_fp64_matrix2x3_copy(BGC_FP64_Matrix2x3* destination, const BGC_F
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* matrix1, BGC_FP32_Matrix2x3* matrix2)
|
||||
inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* const matrix1, BGC_FP32_Matrix2x3* const matrix2)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
|
|
@ -90,7 +90,7 @@ inline void bgc_fp32_matrix2x3_swap(BGC_FP32_Matrix2x3* matrix1, BGC_FP32_Matrix
|
|||
matrix1->r3c2 = r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* matrix1, BGC_FP64_Matrix2x3* matrix2)
|
||||
inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* const matrix1, BGC_FP64_Matrix2x3* const matrix2)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
|
|
@ -122,7 +122,7 @@ inline void bgc_fp64_matrix2x3_swap(BGC_FP64_Matrix2x3* matrix1, BGC_FP64_Matrix
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_matrix2x3_convert_to_fp32(BGC_FP32_Matrix2x3* destination, const BGC_FP64_Matrix2x3* source)
|
||||
inline void bgc_fp64_matrix2x3_convert_to_fp32(BGC_FP32_Matrix2x3* const destination, const BGC_FP64_Matrix2x3* const source)
|
||||
{
|
||||
destination->r1c1 = (float)source->r1c1;
|
||||
destination->r1c2 = (float)source->r1c2;
|
||||
|
|
@ -134,7 +134,7 @@ inline void bgc_fp64_matrix2x3_convert_to_fp32(BGC_FP32_Matrix2x3* destination,
|
|||
destination->r3c2 = (float)source->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_matrix2x3_convert_to_fp64(BGC_FP64_Matrix2x3* destination, const BGC_FP32_Matrix2x3* source)
|
||||
inline void bgc_fp32_matrix2x3_convert_to_fp64(BGC_FP64_Matrix2x3* const destination, const BGC_FP32_Matrix2x3* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -148,7 +148,7 @@ inline void bgc_fp32_matrix2x3_convert_to_fp64(BGC_FP64_Matrix2x3* destination,
|
|||
|
||||
// ================= Transpose ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_get_transposed(BGC_FP32_Matrix2x3* transposed, const BGC_FP32_Matrix3x2* matrix)
|
||||
inline void bgc_fp32_matrix2x3_get_transposed(BGC_FP32_Matrix2x3* const transposed, const BGC_FP32_Matrix3x2* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -160,7 +160,7 @@ inline void bgc_fp32_matrix2x3_get_transposed(BGC_FP32_Matrix2x3* transposed, co
|
|||
transposed->r3c2 = matrix->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_get_transposed(BGC_FP64_Matrix2x3* transposed, const BGC_FP64_Matrix3x2* matrix)
|
||||
inline void bgc_fp64_matrix2x3_get_transposed(BGC_FP64_Matrix2x3* const transposed, const BGC_FP64_Matrix3x2* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -174,7 +174,7 @@ inline void bgc_fp64_matrix2x3_get_transposed(BGC_FP64_Matrix2x3* transposed, co
|
|||
|
||||
// ================== Get Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_get_row(BGC_FP32_Vector2* row, const BGC_FP32_Matrix2x3* matrix, const int row_number)
|
||||
inline void bgc_fp32_matrix2x3_get_row(BGC_FP32_Vector2* const row, const BGC_FP32_Matrix2x3* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
|
|
@ -198,7 +198,7 @@ inline void bgc_fp32_matrix2x3_get_row(BGC_FP32_Vector2* row, const BGC_FP32_Mat
|
|||
row->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_get_row(BGC_FP64_Vector2* row, const BGC_FP64_Matrix2x3* matrix, const int row_number)
|
||||
inline void bgc_fp64_matrix2x3_get_row(BGC_FP64_Vector2* const row, const BGC_FP64_Matrix2x3* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
|
|
@ -224,7 +224,7 @@ inline void bgc_fp64_matrix2x3_get_row(BGC_FP64_Vector2* row, const BGC_FP64_Mat
|
|||
|
||||
// ================== Set Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_set_row(BGC_FP32_Matrix2x3* matrix, const int row_number, const BGC_FP32_Vector2* row)
|
||||
inline void bgc_fp32_matrix2x3_set_row(BGC_FP32_Matrix2x3* const matrix, const int row_number, const BGC_FP32_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
|
|
@ -244,7 +244,7 @@ inline void bgc_fp32_matrix2x3_set_row(BGC_FP32_Matrix2x3* matrix, const int row
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_set_row(BGC_FP64_Matrix2x3* matrix, const int row_number, const BGC_FP64_Vector2* row)
|
||||
inline void bgc_fp64_matrix2x3_set_row(BGC_FP64_Matrix2x3* const matrix, const int row_number, const BGC_FP64_Vector2* const row)
|
||||
{
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
|
|
@ -266,7 +266,7 @@ inline void bgc_fp64_matrix2x3_set_row(BGC_FP64_Matrix2x3* matrix, const int row
|
|||
|
||||
// ================= Get Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_get_column(BGC_FP32_Vector3* column, const BGC_FP32_Matrix2x3* matrix, const int column_number)
|
||||
inline void bgc_fp32_matrix2x3_get_column(BGC_FP32_Vector3* const column, const BGC_FP32_Matrix2x3* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
|
|
@ -282,7 +282,7 @@ inline void bgc_fp32_matrix2x3_get_column(BGC_FP32_Vector3* column, const BGC_FP
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* column, const BGC_FP64_Matrix2x3* matrix, const int column_number)
|
||||
inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* const column, const BGC_FP64_Matrix2x3* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
|
|
@ -300,7 +300,7 @@ inline void bgc_fp64_matrix2x3_get_column(BGC_FP64_Vector3* column, const BGC_FP
|
|||
|
||||
// ================= Set Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_set_column(BGC_FP32_Matrix2x3* matrix, const int column_number, const BGC_FP32_Vector3* column)
|
||||
inline void bgc_fp32_matrix2x3_set_column(BGC_FP32_Matrix2x3* const matrix, const int column_number, const BGC_FP32_Vector3* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
|
|
@ -316,7 +316,7 @@ inline void bgc_fp32_matrix2x3_set_column(BGC_FP32_Matrix2x3* matrix, const int
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_set_column(BGC_FP64_Matrix2x3* matrix, const int column_number, const BGC_FP64_Vector3* column)
|
||||
inline void bgc_fp64_matrix2x3_set_column(BGC_FP64_Matrix2x3* const matrix, const int column_number, const BGC_FP64_Vector3* const column)
|
||||
{
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
|
|
@ -334,7 +334,7 @@ inline void bgc_fp64_matrix2x3_set_column(BGC_FP64_Matrix2x3* matrix, const int
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* sum, const BGC_FP32_Matrix2x3* matrix1, const BGC_FP32_Matrix2x3* matrix2)
|
||||
inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x3* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -346,7 +346,7 @@ inline void bgc_fp32_matrix2x3_add(BGC_FP32_Matrix2x3* sum, const BGC_FP32_Matri
|
|||
sum->r3c2 = matrix1->r3c2 + matrix2->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* sum, const BGC_FP64_Matrix2x3* matrix1, const BGC_FP64_Matrix2x3* matrix2)
|
||||
inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x3* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -360,7 +360,7 @@ inline void bgc_fp64_matrix2x3_add(BGC_FP64_Matrix2x3* sum, const BGC_FP64_Matri
|
|||
|
||||
// ================= Add Scaled ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_add_scaled(BGC_FP32_Matrix2x3* sum, const BGC_FP32_Matrix2x3* basic_matrix, const BGC_FP32_Matrix2x3* scalable_matrix, const float scale)
|
||||
inline void bgc_fp32_matrix2x3_add_scaled(BGC_FP32_Matrix2x3* const sum, const BGC_FP32_Matrix2x3* const basic_matrix, const BGC_FP32_Matrix2x3* const scalable_matrix, const float scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -372,7 +372,7 @@ inline void bgc_fp32_matrix2x3_add_scaled(BGC_FP32_Matrix2x3* sum, const BGC_FP3
|
|||
sum->r3c2 = basic_matrix->r3c2 + scalable_matrix->r3c2 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_add_scaled(BGC_FP64_Matrix2x3* sum, const BGC_FP64_Matrix2x3* basic_matrix, const BGC_FP64_Matrix2x3* scalable_matrix, const double scale)
|
||||
inline void bgc_fp64_matrix2x3_add_scaled(BGC_FP64_Matrix2x3* const sum, const BGC_FP64_Matrix2x3* const basic_matrix, const BGC_FP64_Matrix2x3* const scalable_matrix, const double scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -386,7 +386,7 @@ inline void bgc_fp64_matrix2x3_add_scaled(BGC_FP64_Matrix2x3* sum, const BGC_FP6
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_subtract(BGC_FP32_Matrix2x3* difference, const BGC_FP32_Matrix2x3* minuend, const BGC_FP32_Matrix2x3* subtrahend)
|
||||
inline void bgc_fp32_matrix2x3_subtract(BGC_FP32_Matrix2x3* const difference, const BGC_FP32_Matrix2x3* const minuend, const BGC_FP32_Matrix2x3* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -398,7 +398,7 @@ inline void bgc_fp32_matrix2x3_subtract(BGC_FP32_Matrix2x3* difference, const BG
|
|||
difference->r3c2 = minuend->r3c2 - subtrahend->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_subtract(BGC_FP64_Matrix2x3* difference, const BGC_FP64_Matrix2x3* minuend, const BGC_FP64_Matrix2x3* subtrahend)
|
||||
inline void bgc_fp64_matrix2x3_subtract(BGC_FP64_Matrix2x3* const difference, const BGC_FP64_Matrix2x3* const minuend, const BGC_FP64_Matrix2x3* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -412,7 +412,7 @@ inline void bgc_fp64_matrix2x3_subtract(BGC_FP64_Matrix2x3* difference, const BG
|
|||
|
||||
// ============== Subtract scaled =============== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_subtract_scaled(BGC_FP32_Matrix2x3* sum, const BGC_FP32_Matrix2x3* basic_matrix, const BGC_FP32_Matrix2x3* scalable_matrix, const float scale)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -424,7 +424,7 @@ inline void bgc_fp32_matrix2x3_subtract_scaled(BGC_FP32_Matrix2x3* sum, const BG
|
|||
sum->r3c2 = basic_matrix->r3c2 - scalable_matrix->r3c2 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_subtract_scaled(BGC_FP64_Matrix2x3* sum, const BGC_FP64_Matrix2x3* basic_matrix, const BGC_FP64_Matrix2x3* scalable_matrix, const double scale)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -438,7 +438,7 @@ inline void bgc_fp64_matrix2x3_subtract_scaled(BGC_FP64_Matrix2x3* sum, const BG
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_real(BGC_FP32_Matrix2x3* product, const BGC_FP32_Matrix2x3* multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_real(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* product, con
|
|||
product->r3c2 = multiplicand->r3c2 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_real(BGC_FP64_Matrix2x3* product, const BGC_FP64_Matrix2x3* multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_real(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -464,14 +464,14 @@ inline void bgc_fp64_matrix2x3_multiply_by_real(BGC_FP64_Matrix2x3* product, con
|
|||
|
||||
// ============ Right Vector Product ============ //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_vector2(BGC_FP32_Vector3* product, const BGC_FP32_Matrix2x3* matrix, const BGC_FP32_Vector2* vector)
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_vector2(BGC_FP32_Vector3* const product, const BGC_FP32_Matrix2x3* const matrix, const BGC_FP32_Vector2* vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
product->x3 = matrix->r3c1 * vector->x1 + matrix->r3c2 * vector->x2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_vector2(BGC_FP64_Vector3* product, const BGC_FP64_Matrix2x3* matrix, const BGC_FP64_Vector2* vector)
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_vector2(BGC_FP64_Vector3* const product, const BGC_FP64_Matrix2x3* const matrix, const BGC_FP64_Vector2* vector)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
|
|
@ -481,7 +481,7 @@ inline void bgc_fp64_matrix2x3_multiply_by_vector2(BGC_FP64_Vector3* product, co
|
|||
|
||||
// ========== Matrix Product 2x3 at 2x2 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* product, const BGC_FP32_Matrix2x3* matrix1, const BGC_FP32_Matrix2x2* matrix2)
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* const product, const BGC_FP32_Matrix2x3* const matrix1, const BGC_FP32_Matrix2x2* const matrix2)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -502,7 +502,7 @@ inline void bgc_fp32_matrix2x3_multiply_by_matrix2x2(BGC_FP32_Matrix2x3* product
|
|||
product->r3c2 = r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* product, const BGC_FP64_Matrix2x3* matrix1, const BGC_FP64_Matrix2x2* matrix2)
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* const product, const BGC_FP64_Matrix2x3* const matrix1, const BGC_FP64_Matrix2x2* const matrix2)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -525,7 +525,7 @@ inline void bgc_fp64_matrix2x3_multiply_by_matrix2x2(BGC_FP64_Matrix2x3* product
|
|||
|
||||
// ========== Matrix Product 2x3 at 3x2 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* product, const BGC_FP32_Matrix2x3* matrix1, const BGC_FP32_Matrix3x2* matrix2)
|
||||
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)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -540,7 +540,7 @@ inline void bgc_fp32_matrix2x3_multiply_by_matrix3x2(BGC_FP32_Matrix3x3* product
|
|||
product->r3c3 = matrix1->r3c1 * matrix2->r1c3 + matrix1->r3c2 * matrix2->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* product, const BGC_FP64_Matrix2x3* matrix1, const BGC_FP64_Matrix3x2* matrix2)
|
||||
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)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2;
|
||||
|
|
@ -557,7 +557,7 @@ inline void bgc_fp64_matrix2x3_multiply_by_matrix3x2(BGC_FP64_Matrix3x3* product
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix2x3_divide_by_real(BGC_FP32_Matrix2x3* quotient, const BGC_FP32_Matrix2x3* dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix2x3_divide_by_real(BGC_FP32_Matrix2x3* const quotient, const BGC_FP32_Matrix2x3* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -567,7 +567,7 @@ inline int bgc_fp32_matrix2x3_divide_by_real(BGC_FP32_Matrix2x3* quotient, const
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x3_divide_by_real(BGC_FP64_Matrix2x3* quotient, const BGC_FP64_Matrix2x3* dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix2x3_divide_by_real(BGC_FP64_Matrix2x3* const quotient, const BGC_FP64_Matrix2x3* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -579,7 +579,7 @@ inline int bgc_fp64_matrix2x3_divide_by_real(BGC_FP64_Matrix2x3* quotient, const
|
|||
|
||||
// ================== Average2 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_get_mean2(BGC_FP32_Matrix2x3* mean, const BGC_FP32_Matrix2x3* term1, const BGC_FP32_Matrix2x3* term2)
|
||||
inline void bgc_fp32_matrix2x3_get_mean2(BGC_FP32_Matrix2x3* const mean, const BGC_FP32_Matrix2x3* const term1, const BGC_FP32_Matrix2x3* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5f;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5f;
|
||||
|
|
@ -591,7 +591,7 @@ inline void bgc_fp32_matrix2x3_get_mean2(BGC_FP32_Matrix2x3* mean, const BGC_FP3
|
|||
mean->r3c2 = (term1->r3c2 + term2->r3c2) * 0.5f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_get_mean2(BGC_FP64_Matrix2x3* mean, const BGC_FP64_Matrix2x3* term1, const BGC_FP64_Matrix2x3* term2)
|
||||
inline void bgc_fp64_matrix2x3_get_mean2(BGC_FP64_Matrix2x3* const mean, const BGC_FP64_Matrix2x3* const term1, const BGC_FP64_Matrix2x3* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5;
|
||||
|
|
@ -605,7 +605,7 @@ inline void bgc_fp64_matrix2x3_get_mean2(BGC_FP64_Matrix2x3* mean, const BGC_FP6
|
|||
|
||||
// ================== Average3 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_get_mean3(BGC_FP32_Matrix2x3* mean, const BGC_FP32_Matrix2x3* term1, const BGC_FP32_Matrix2x3* term2, const BGC_FP32_Matrix2x3* term3)
|
||||
inline void bgc_fp32_matrix2x3_get_mean3(BGC_FP32_Matrix2x3* const mean, const BGC_FP32_Matrix2x3* const term1, const BGC_FP32_Matrix2x3* const term2, const BGC_FP32_Matrix2x3* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP32_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP32_ONE_THIRD;
|
||||
|
|
@ -617,7 +617,7 @@ inline void bgc_fp32_matrix2x3_get_mean3(BGC_FP32_Matrix2x3* mean, const BGC_FP3
|
|||
mean->r3c2 = (term1->r3c2 + term2->r3c2 + term3->r3c2) * BGC_FP32_ONE_THIRD;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_get_mean3(BGC_FP64_Matrix2x3* mean, const BGC_FP64_Matrix2x3* term1, const BGC_FP64_Matrix2x3* term2, const BGC_FP64_Matrix2x3* term3)
|
||||
inline void bgc_fp64_matrix2x3_get_mean3(BGC_FP64_Matrix2x3* const mean, const BGC_FP64_Matrix2x3* const term1, const BGC_FP64_Matrix2x3* const term2, const BGC_FP64_Matrix2x3* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP64_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP64_ONE_THIRD;
|
||||
|
|
@ -631,7 +631,7 @@ inline void bgc_fp64_matrix2x3_get_mean3(BGC_FP64_Matrix2x3* mean, const BGC_FP6
|
|||
|
||||
// ================ Interpolate ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x3_interpolate(BGC_FP32_Matrix2x3* interpolation, const BGC_FP32_Matrix2x3* first, const BGC_FP32_Matrix2x3* second, const float phase)
|
||||
inline void bgc_fp32_matrix2x3_interpolate(BGC_FP32_Matrix2x3* const interpolation, const BGC_FP32_Matrix2x3* const first, const BGC_FP32_Matrix2x3* const second, const float phase)
|
||||
{
|
||||
const float couter_phase = 1.0f - phase;
|
||||
|
||||
|
|
@ -645,7 +645,7 @@ inline void bgc_fp32_matrix2x3_interpolate(BGC_FP32_Matrix2x3* interpolation, co
|
|||
interpolation->r3c2 = first->r3c2 * couter_phase + second->r3c2 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x3_interpolate(BGC_FP64_Matrix2x3* interpolation, const BGC_FP64_Matrix2x3* first, const BGC_FP64_Matrix2x3* second, const double phase)
|
||||
inline void bgc_fp64_matrix2x3_interpolate(BGC_FP64_Matrix2x3* const interpolation, const BGC_FP64_Matrix2x3* const first, const BGC_FP64_Matrix2x3* const second, const double phase)
|
||||
{
|
||||
const double couter_phase = 1.0 - phase;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,64 +1,64 @@
|
|||
#include "./matrix3x2.h"
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* matrix);
|
||||
extern inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* matrix);
|
||||
extern inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* const matrix);
|
||||
extern inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source);
|
||||
extern inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source);
|
||||
extern inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source);
|
||||
extern inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* matrix1, BGC_FP32_Matrix3x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* matrix1, BGC_FP64_Matrix3x2* matrix2);
|
||||
extern inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* const matrix1, BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* const matrix1, BGC_FP64_Matrix3x2* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source);
|
||||
extern inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source);
|
||||
extern inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source);
|
||||
extern inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* transposed, const BGC_FP32_Matrix2x3* matrix);
|
||||
extern inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* transposed, const BGC_FP64_Matrix2x3* matrix);
|
||||
extern inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* const transposed, const BGC_FP32_Matrix2x3* const matrix);
|
||||
extern inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* const transposed, const BGC_FP64_Matrix2x3* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Matrix3x2* matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Matrix3x2* matrix, const int row_number);
|
||||
extern inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* const row, const BGC_FP32_Matrix3x2* const matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* const row, const BGC_FP64_Matrix3x2* const matrix, const int row_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* matrix, const int row_number, const BGC_FP32_Vector3* row);
|
||||
extern inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* matrix, const int row_number, const BGC_FP64_Vector3* row);
|
||||
extern inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* const matrix, const int row_number, const BGC_FP32_Vector3* const row);
|
||||
extern inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* const matrix, const int row_number, const BGC_FP64_Vector3* const row);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* column, const BGC_FP32_Matrix3x2* matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* column, const BGC_FP64_Matrix3x2* matrix, const int column_number);
|
||||
extern inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* const column, const BGC_FP32_Matrix3x2* const matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* const column, const BGC_FP64_Matrix3x2* const matrix, const int column_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* matrix, const int column_number, const BGC_FP32_Vector2* column);
|
||||
extern inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* matrix, const int column_number, const BGC_FP64_Vector2* column);
|
||||
extern inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column);
|
||||
extern inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x2* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x2* matrix2);
|
||||
extern inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matrix3x2* basic_matrix, const BGC_FP32_Matrix3x2* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matrix3x2* basic_matrix, const BGC_FP64_Matrix3x2* scalable_matrix, const double scale);
|
||||
extern inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const basic_matrix, const BGC_FP32_Matrix3x2* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const basic_matrix, const BGC_FP64_Matrix3x2* const scalable_matrix, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* difference, const BGC_FP32_Matrix3x2* minuend, const BGC_FP32_Matrix3x2* subtrahend);
|
||||
extern inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* difference, const BGC_FP64_Matrix3x2* minuend, const BGC_FP64_Matrix3x2* subtrahend);
|
||||
extern inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* const difference, const BGC_FP32_Matrix3x2* const minuend, const BGC_FP32_Matrix3x2* const subtrahend);
|
||||
extern inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* const difference, const BGC_FP64_Matrix3x2* const minuend, const BGC_FP64_Matrix3x2* const subtrahend);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_subtract_scaled(BGC_FP32_Matrix3x2* difference, const BGC_FP32_Matrix3x2* basic_matrix, const BGC_FP32_Matrix3x2* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* difference, const BGC_FP64_Matrix3x2* basic_matrix, const BGC_FP64_Matrix3x2* scalable_matrix, const double scale);
|
||||
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* product, const BGC_FP32_Matrix3x2* multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix3x2* multiplicand, const double multiplier);
|
||||
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_vector3(BGC_FP32_Vector2* product, const BGC_FP32_Matrix3x2* matrix, const BGC_FP32_Vector3* vector);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* product, const BGC_FP64_Matrix3x2* matrix, const BGC_FP64_Vector3* vector);
|
||||
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);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* product, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix2x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix2x3* matrix2);
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix2x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix2x3* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x3* matrix2);
|
||||
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* quotient, const BGC_FP32_Matrix3x2* dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* quotient, const BGC_FP64_Matrix3x2* dividend, const double divisor);
|
||||
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 void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* mean, const BGC_FP32_Matrix3x2* term1, const BGC_FP32_Matrix3x2* term2);
|
||||
extern inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* mean, const BGC_FP64_Matrix3x2* term1, const BGC_FP64_Matrix3x2* term2);
|
||||
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);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* mean, const BGC_FP32_Matrix3x2* term1, const BGC_FP32_Matrix3x2* term2, const BGC_FP32_Matrix3x2* term3);
|
||||
extern inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* mean, const BGC_FP64_Matrix3x2* term1, const BGC_FP64_Matrix3x2* term2, const BGC_FP64_Matrix3x2* term3);
|
||||
extern inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* const mean, const BGC_FP32_Matrix3x2* const term1, const BGC_FP32_Matrix3x2* const term2, const BGC_FP32_Matrix3x2* const term3);
|
||||
extern inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* const mean, const BGC_FP64_Matrix3x2* const term1, const BGC_FP64_Matrix3x2* const term2, const BGC_FP64_Matrix3x2* const term3);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* interpolation, const BGC_FP32_Matrix3x2* first, const BGC_FP32_Matrix3x2* second, const float phase);
|
||||
extern inline void bgc_fp64_matrix3x2_interpolate(BGC_FP64_Matrix3x2* interpolation, const BGC_FP64_Matrix3x2* first, const BGC_FP64_Matrix3x2* second, const double phase);
|
||||
extern inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* const interpolation, const BGC_FP32_Matrix3x2* const first, const BGC_FP32_Matrix3x2* const second, const float phase);
|
||||
extern inline void bgc_fp64_matrix3x2_interpolate(BGC_FP64_Matrix3x2* const interpolation, const BGC_FP64_Matrix3x2* const first, const BGC_FP64_Matrix3x2* const second, const double phase);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* matrix)
|
||||
inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -19,7 +19,7 @@ inline void bgc_fp32_matrix3x2_reset(BGC_FP32_Matrix3x2* matrix)
|
|||
matrix->r2c3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* matrix)
|
||||
inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -32,7 +32,7 @@ inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* matrix)
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source)
|
||||
inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -43,7 +43,7 @@ inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* destination, const BGC_F
|
|||
destination->r2c3 = source->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source)
|
||||
inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -56,7 +56,7 @@ inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* destination, const BGC_F
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* matrix1, BGC_FP32_Matrix3x2* matrix2)
|
||||
inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* const matrix1, BGC_FP32_Matrix3x2* const matrix2)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
|
|
@ -83,7 +83,7 @@ inline void bgc_fp32_matrix3x2_swap(BGC_FP32_Matrix3x2* matrix1, BGC_FP32_Matrix
|
|||
matrix1->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* matrix1, BGC_FP64_Matrix3x2* matrix2)
|
||||
inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* const matrix1, BGC_FP64_Matrix3x2* const matrix2)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
|
|
@ -112,7 +112,7 @@ inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* matrix1, BGC_FP64_Matrix
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source)
|
||||
inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* const destination, const BGC_FP64_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = (float)source->r1c1;
|
||||
destination->r1c2 = (float)source->r1c2;
|
||||
|
|
@ -123,7 +123,7 @@ inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* destination,
|
|||
destination->r2c3 = (float)source->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source)
|
||||
inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* const destination, const BGC_FP32_Matrix3x2* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -136,7 +136,7 @@ inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* destination,
|
|||
|
||||
// ================= Transpose ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* transposed, const BGC_FP32_Matrix2x3* matrix)
|
||||
inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* const transposed, const BGC_FP32_Matrix2x3* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -147,7 +147,7 @@ inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* transposed, co
|
|||
transposed->r2c3 = matrix->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* transposed, const BGC_FP64_Matrix2x3* matrix)
|
||||
inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* const transposed, const BGC_FP64_Matrix2x3* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -160,7 +160,7 @@ inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* transposed, co
|
|||
|
||||
// ================== Get Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Matrix3x2* matrix, const int row_number)
|
||||
inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* const row, const BGC_FP32_Matrix3x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -183,7 +183,7 @@ inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Mat
|
|||
row->x3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Matrix3x2* matrix, const int row_number)
|
||||
inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* const row, const BGC_FP64_Matrix3x2* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -208,7 +208,7 @@ inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Mat
|
|||
|
||||
// ================== Set Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* matrix, const int row_number, const BGC_FP32_Vector3* row)
|
||||
inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* const matrix, const int row_number, const BGC_FP32_Vector3* const row)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -226,7 +226,7 @@ inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* matrix, const int row
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* matrix, const int row_number, const BGC_FP64_Vector3* row)
|
||||
inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* const matrix, const int row_number, const BGC_FP64_Vector3* const row)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -246,7 +246,7 @@ inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* matrix, const int row
|
|||
|
||||
// ================= Get Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* column, const BGC_FP32_Matrix3x2* matrix, const int column_number)
|
||||
inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* const column, const BGC_FP32_Matrix3x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -273,7 +273,7 @@ inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* column, const BGC_FP
|
|||
column->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* column, const BGC_FP64_Matrix3x2* matrix, const int column_number)
|
||||
inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* const column, const BGC_FP64_Matrix3x2* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -302,7 +302,7 @@ inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* column, const BGC_FP
|
|||
|
||||
// ================= Set Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* matrix, const int column_number, const BGC_FP32_Vector2* column)
|
||||
inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* const matrix, const int column_number, const BGC_FP32_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -325,7 +325,7 @@ inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* matrix, const int
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* matrix, const int column_number, const BGC_FP64_Vector2* column)
|
||||
inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* const matrix, const int column_number, const BGC_FP64_Vector2* const column)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -350,7 +350,7 @@ inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* matrix, const int
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x2* matrix2)
|
||||
inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix3x2* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -361,7 +361,7 @@ inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matri
|
|||
sum->r2c3 = matrix1->r2c3 + matrix2->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x2* matrix2)
|
||||
inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix3x2* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -374,7 +374,7 @@ inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matri
|
|||
|
||||
// ================= Add Scaled ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matrix3x2* basic_matrix, const BGC_FP32_Matrix3x2* scalable_matrix, const float scale)
|
||||
inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* const sum, const BGC_FP32_Matrix3x2* const basic_matrix, const BGC_FP32_Matrix3x2* const scalable_matrix, const float scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -385,7 +385,7 @@ inline void bgc_fp32_matrix3x2_add_scaled(BGC_FP32_Matrix3x2* sum, const BGC_FP3
|
|||
sum->r2c3 = basic_matrix->r2c3 + scalable_matrix->r2c3 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matrix3x2* basic_matrix, const BGC_FP64_Matrix3x2* scalable_matrix, const double scale)
|
||||
inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* const sum, const BGC_FP64_Matrix3x2* const basic_matrix, const BGC_FP64_Matrix3x2* const scalable_matrix, const double scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -398,7 +398,7 @@ inline void bgc_fp64_matrix3x2_add_scaled(BGC_FP64_Matrix3x2* sum, const BGC_FP6
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* difference, const BGC_FP32_Matrix3x2* minuend, const BGC_FP32_Matrix3x2* subtrahend)
|
||||
inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* const difference, const BGC_FP32_Matrix3x2* const minuend, const BGC_FP32_Matrix3x2* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -409,7 +409,7 @@ inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* difference, const BG
|
|||
difference->r2c3 = minuend->r2c3 - subtrahend->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* difference, const BGC_FP64_Matrix3x2* minuend, const BGC_FP64_Matrix3x2* subtrahend)
|
||||
inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* const difference, const BGC_FP64_Matrix3x2* const minuend, const BGC_FP64_Matrix3x2* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -422,7 +422,7 @@ inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* difference, const BG
|
|||
|
||||
// ============== Subtract Scaled =============== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_subtract_scaled(BGC_FP32_Matrix3x2* difference, const BGC_FP32_Matrix3x2* basic_matrix, const BGC_FP32_Matrix3x2* scalable_matrix, const float scale)
|
||||
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)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -433,7 +433,7 @@ inline void bgc_fp32_matrix3x2_subtract_scaled(BGC_FP32_Matrix3x2* difference, c
|
|||
difference->r2c3 = basic_matrix->r2c3 - scalable_matrix->r2c3 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* difference, const BGC_FP64_Matrix3x2* basic_matrix, const BGC_FP64_Matrix3x2* scalable_matrix, const double scale)
|
||||
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)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -446,7 +446,7 @@ inline void bgc_fp64_matrix3x2_subtract_scaled(BGC_FP64_Matrix3x2* difference, c
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_real(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix3x2* multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_real(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* product, con
|
|||
product->r2c3 = multiplicand->r2c3 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix3x2* multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* const product, const BGC_FP64_Matrix3x2* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -470,13 +470,13 @@ inline void bgc_fp64_matrix3x2_multiply_by_real(BGC_FP64_Matrix3x2* product, con
|
|||
|
||||
// ============ Right Vector Product ============ //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_vector3(BGC_FP32_Vector2* product, const BGC_FP32_Matrix3x2* matrix, const BGC_FP32_Vector3* vector)
|
||||
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)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* product, const BGC_FP64_Matrix3x2* matrix, const BGC_FP64_Vector3* vector)
|
||||
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)
|
||||
{
|
||||
product->x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2 + matrix->r1c3 * vector->x3;
|
||||
product->x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2 + matrix->r2c3 * vector->x3;
|
||||
|
|
@ -484,7 +484,7 @@ inline void bgc_fp64_matrix3x2_multiply_by_vector3(BGC_FP64_Vector2* product, co
|
|||
|
||||
// ========== Matrix Product 3x2 at 2x3 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* product, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix2x3* matrix2)
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* const product, const BGC_FP32_Matrix3x2* const matrix1, const BGC_FP32_Matrix2x3* const matrix2)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -493,7 +493,7 @@ inline void bgc_fp32_matrix3x2_multiply_by_matrix2x3(BGC_FP32_Matrix2x2* product
|
|||
product->r2c2 = matrix1->r2c1 * matrix2->r1c2 + matrix1->r2c2 * matrix2->r2c2 + matrix1->r2c3 * matrix2->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix2x3* matrix2)
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* const product, const BGC_FP64_Matrix3x2* const matrix1, const BGC_FP64_Matrix2x3* const matrix2)
|
||||
{
|
||||
product->r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
product->r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -504,7 +504,7 @@ inline void bgc_fp64_matrix3x2_multiply_by_matrix2x3(BGC_FP64_Matrix2x2* product
|
|||
|
||||
// ========== Matrix Product 3x2 at 3x2 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x3* matrix2)
|
||||
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)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -523,7 +523,7 @@ inline void bgc_fp32_matrix3x2_multiply_by_matrix3x3(BGC_FP32_Matrix3x2* product
|
|||
product->r2c3 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x3* matrix2)
|
||||
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)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -544,7 +544,7 @@ inline void bgc_fp64_matrix3x2_multiply_by_matrix3x3(BGC_FP64_Matrix3x2* product
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* quotient, const BGC_FP32_Matrix3x2* dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* const quotient, const BGC_FP32_Matrix3x2* const dividend, const float divisor)
|
||||
{
|
||||
if (bgc_fp32_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -554,7 +554,7 @@ inline int bgc_fp32_matrix3x2_divide_by_real(BGC_FP32_Matrix3x2* quotient, const
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* quotient, const BGC_FP64_Matrix3x2* dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* const quotient, const BGC_FP64_Matrix3x2* const dividend, const double divisor)
|
||||
{
|
||||
if (bgc_fp64_is_zero(divisor)) {
|
||||
return BGC_FAILURE;
|
||||
|
|
@ -566,7 +566,7 @@ inline int bgc_fp64_matrix3x2_divide_by_real(BGC_FP64_Matrix3x2* quotient, const
|
|||
|
||||
// ================== Average2 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* mean, const BGC_FP32_Matrix3x2* term1, const BGC_FP32_Matrix3x2* term2)
|
||||
inline void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* const mean, const BGC_FP32_Matrix3x2* const term1, const BGC_FP32_Matrix3x2* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5f;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5f;
|
||||
|
|
@ -577,7 +577,7 @@ inline void bgc_fp32_matrix3x2_get_mean2(BGC_FP32_Matrix3x2* mean, const BGC_FP3
|
|||
mean->r2c3 = (term1->r2c3 + term2->r2c3) * 0.5f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* mean, const BGC_FP64_Matrix3x2* term1, const BGC_FP64_Matrix3x2* term2)
|
||||
inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* const mean, const BGC_FP64_Matrix3x2* const term1, const BGC_FP64_Matrix3x2* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5;
|
||||
|
|
@ -590,7 +590,7 @@ inline void bgc_fp64_matrix3x2_get_mean2(BGC_FP64_Matrix3x2* mean, const BGC_FP6
|
|||
|
||||
// ================== Average3 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* mean, const BGC_FP32_Matrix3x2* term1, const BGC_FP32_Matrix3x2* term2, const BGC_FP32_Matrix3x2* term3)
|
||||
inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* const mean, const BGC_FP32_Matrix3x2* const term1, const BGC_FP32_Matrix3x2* const term2, const BGC_FP32_Matrix3x2* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP32_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP32_ONE_THIRD;
|
||||
|
|
@ -601,7 +601,7 @@ inline void bgc_fp32_matrix3x2_get_mean3(BGC_FP32_Matrix3x2* mean, const BGC_FP3
|
|||
mean->r2c3 = (term1->r2c3 + term2->r2c3 + term3->r2c3) * BGC_FP32_ONE_THIRD;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* mean, const BGC_FP64_Matrix3x2* term1, const BGC_FP64_Matrix3x2* term2, const BGC_FP64_Matrix3x2* term3)
|
||||
inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* const mean, const BGC_FP64_Matrix3x2* const term1, const BGC_FP64_Matrix3x2* const term2, const BGC_FP64_Matrix3x2* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP64_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP64_ONE_THIRD;
|
||||
|
|
@ -614,7 +614,7 @@ inline void bgc_fp64_matrix3x2_get_mean3(BGC_FP64_Matrix3x2* mean, const BGC_FP6
|
|||
|
||||
// ================ Interpolate ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* interpolation, const BGC_FP32_Matrix3x2* first, const BGC_FP32_Matrix3x2* second, const float phase)
|
||||
inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* const interpolation, const BGC_FP32_Matrix3x2* const first, const BGC_FP32_Matrix3x2* const second, const float phase)
|
||||
{
|
||||
const float couter_phase = 1.0f - phase;
|
||||
|
||||
|
|
@ -627,7 +627,7 @@ inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* interpolation, co
|
|||
interpolation->r2c3 = first->r2c3 * couter_phase + second->r2c3 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_interpolate(BGC_FP64_Matrix3x2* interpolation, const BGC_FP64_Matrix3x2* first, const BGC_FP64_Matrix3x2* second, const double phase)
|
||||
inline void bgc_fp64_matrix3x2_interpolate(BGC_FP64_Matrix3x2* const interpolation, const BGC_FP64_Matrix3x2* const first, const BGC_FP64_Matrix3x2* const second, const double phase)
|
||||
{
|
||||
const double couter_phase = 1.0 - phase;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,95 +1,95 @@
|
|||
#include "./matrix3x3.h"
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_reset(BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_reset(BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp32_matrix3x3_reset(BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_reset(BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_make_identity(BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_make_identity(BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp32_matrix3x3_make_identity(BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_make_identity(BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_make_diagonal(BGC_FP32_Matrix3x3* matrix, const float d1, const float d2, const float d3);
|
||||
extern inline void bgc_fp64_matrix3x3_make_diagonal(BGC_FP64_Matrix3x3* matrix, const double d1, const double d2, const double d3);
|
||||
extern inline void bgc_fp32_matrix3x3_make_diagonal(BGC_FP32_Matrix3x3* const matrix, const float d1, const float d2, const float d3);
|
||||
extern inline void bgc_fp64_matrix3x3_make_diagonal(BGC_FP64_Matrix3x3* const matrix, const double d1, const double d2, const double d3);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_copy(BGC_FP32_Matrix3x3* destination, const BGC_FP32_Matrix3x3* source);
|
||||
extern inline void bgc_fp64_matrix3x3_copy(BGC_FP64_Matrix3x3* destination, const BGC_FP64_Matrix3x3* source);
|
||||
extern inline void bgc_fp32_matrix3x3_copy(BGC_FP32_Matrix3x3* const destination, const BGC_FP32_Matrix3x3* const source);
|
||||
extern inline void bgc_fp64_matrix3x3_copy(BGC_FP64_Matrix3x3* const destination, const BGC_FP64_Matrix3x3* const source);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* matrix1, BGC_FP32_Matrix3x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* matrix1, BGC_FP64_Matrix3x3* matrix2);
|
||||
extern inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* const matrix1, BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* const matrix1, BGC_FP64_Matrix3x3* const matrix2);
|
||||
|
||||
extern inline void bgc_fp64_matrix3x3_convert_to_fp32(BGC_FP32_Matrix3x3* destination, const BGC_FP64_Matrix3x3* source);
|
||||
extern inline void bgc_fp32_matrix3x3_convert_to_fp64(BGC_FP64_Matrix3x3* destination, const BGC_FP32_Matrix3x3* source);
|
||||
extern inline void bgc_fp64_matrix3x3_convert_to_fp32(BGC_FP32_Matrix3x3* const destination, const BGC_FP64_Matrix3x3* const source);
|
||||
extern inline void bgc_fp32_matrix3x3_convert_to_fp64(BGC_FP64_Matrix3x3* const destination, const BGC_FP32_Matrix3x3* const source);
|
||||
|
||||
extern inline float bgc_fp32_matrix3x3_get_determinant(const BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline double bgc_fp64_matrix3x3_get_determinant(const BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline float bgc_fp32_matrix3x3_get_determinant(const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline double bgc_fp64_matrix3x3_get_determinant(const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x3_is_identity(const BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_is_identity(const BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp32_matrix3x3_is_identity(const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_is_identity(const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x3_is_singular(const BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_is_singular(const BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp32_matrix3x3_is_singular(const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_is_singular(const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x3_is_rotation(const BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_is_rotation(const BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp32_matrix3x3_is_rotation(const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_is_rotation(const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline int bgc_fp32_matrix3x3_invert(BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_invert(BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline int bgc_fp32_matrix3x3_invert(BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline int bgc_fp64_matrix3x3_invert(BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_transpose(BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_transpose(BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp32_matrix3x3_transpose(BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_transpose(BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_get_transposed(BGC_FP32_Matrix3x3* transposed, const BGC_FP32_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_get_transposed(BGC_FP64_Matrix3x3* transposed, const BGC_FP64_Matrix3x3* matrix);
|
||||
extern inline void bgc_fp32_matrix3x3_get_transposed(BGC_FP32_Matrix3x3* const transposed, const BGC_FP32_Matrix3x3* const matrix);
|
||||
extern inline void bgc_fp64_matrix3x3_get_transposed(BGC_FP64_Matrix3x3* const transposed, const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Matrix3x3* matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix3x3_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Matrix3x3* matrix, const int row_number);
|
||||
extern inline void bgc_fp32_matrix3x3_get_row(BGC_FP32_Vector3* const row, const BGC_FP32_Matrix3x3* const matrix, const int row_number);
|
||||
extern inline void bgc_fp64_matrix3x3_get_row(BGC_FP64_Vector3* const row, const BGC_FP64_Matrix3x3* const matrix, const int row_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_set_row(BGC_FP32_Matrix3x3* matrix, const int row_number, const BGC_FP32_Vector3* row);
|
||||
extern inline void bgc_fp64_matrix3x3_set_row(BGC_FP64_Matrix3x3* matrix, const int row_number, const BGC_FP64_Vector3* row);
|
||||
extern inline void bgc_fp32_matrix3x3_set_row(BGC_FP32_Matrix3x3* const matrix, const int row_number, const BGC_FP32_Vector3* const row);
|
||||
extern inline void bgc_fp64_matrix3x3_set_row(BGC_FP64_Matrix3x3* const matrix, const int row_number, const BGC_FP64_Vector3* const row);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_get_column(BGC_FP32_Vector3* column, const BGC_FP32_Matrix3x3* matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix3x3_get_column(BGC_FP64_Vector3* column, const BGC_FP64_Matrix3x3* matrix, const int column_number);
|
||||
extern inline void bgc_fp32_matrix3x3_get_column(BGC_FP32_Vector3* const column, const BGC_FP32_Matrix3x3* const matrix, const int column_number);
|
||||
extern inline void bgc_fp64_matrix3x3_get_column(BGC_FP64_Vector3* const column, const BGC_FP64_Matrix3x3* const matrix, const int column_number);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_set_column(BGC_FP32_Matrix3x3* matrix, const int column_number, const BGC_FP32_Vector3* column);
|
||||
extern inline void bgc_fp64_matrix3x3_set_column(BGC_FP64_Matrix3x3* matrix, const int column_number, const BGC_FP64_Vector3* column);
|
||||
extern inline void bgc_fp32_matrix3x3_set_column(BGC_FP32_Matrix3x3* const matrix, const int column_number, const BGC_FP32_Vector3* const column);
|
||||
extern inline void bgc_fp64_matrix3x3_set_column(BGC_FP64_Matrix3x3* const matrix, const int column_number, const BGC_FP64_Vector3* const column);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* sum, const BGC_FP32_Matrix3x3* matrix1, const BGC_FP32_Matrix3x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* sum, const BGC_FP64_Matrix3x3* matrix1, const BGC_FP64_Matrix3x3* matrix2);
|
||||
extern inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix3x3* const matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix3x3* const matrix2);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_add_scaled(BGC_FP32_Matrix3x3* sum, const BGC_FP32_Matrix3x3* basic_matrix, const BGC_FP32_Matrix3x3* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x3_add_scaled(BGC_FP64_Matrix3x3* sum, const BGC_FP64_Matrix3x3* basic_matrix, const BGC_FP64_Matrix3x3* scalable_matrix, const double scale);
|
||||
extern inline void bgc_fp32_matrix3x3_add_scaled(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const basic_matrix, const BGC_FP32_Matrix3x3* const scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x3_add_scaled(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const basic_matrix, const BGC_FP64_Matrix3x3* const scalable_matrix, const double scale);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_subtract(BGC_FP32_Matrix3x3* difference, const BGC_FP32_Matrix3x3* minuend, const BGC_FP32_Matrix3x3* subtrahend);
|
||||
extern inline void bgc_fp64_matrix3x3_subtract(BGC_FP64_Matrix3x3* difference, const BGC_FP64_Matrix3x3* minuend, const BGC_FP64_Matrix3x3* subtrahend);
|
||||
extern inline void bgc_fp32_matrix3x3_subtract(BGC_FP32_Matrix3x3* const difference, const BGC_FP32_Matrix3x3* const minuend, const BGC_FP32_Matrix3x3* const subtrahend);
|
||||
extern inline void bgc_fp64_matrix3x3_subtract(BGC_FP64_Matrix3x3* const difference, const BGC_FP64_Matrix3x3* const minuend, const BGC_FP64_Matrix3x3* const subtrahend);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_subtract_scaled(BGC_FP32_Matrix3x3* difference, const BGC_FP32_Matrix3x3* basic_matrix, const BGC_FP32_Matrix3x3* scalable_matrix, const float scale);
|
||||
extern inline void bgc_fp64_matrix3x3_subtract_scaled(BGC_FP64_Matrix3x3* difference, const BGC_FP64_Matrix3x3* basic_matrix, const BGC_FP64_Matrix3x3* scalable_matrix, const double scale);
|
||||
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* product, const BGC_FP32_Matrix3x3* multiplicand, const float multiplier);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_real(BGC_FP64_Matrix3x3* product, const BGC_FP64_Matrix3x3* multiplicand, const double multiplier);
|
||||
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_vector3(BGC_FP32_Vector3* product, const BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Vector3* vector);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* product, const BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Vector3* vector);
|
||||
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_matrix2x3(BGC_FP32_Matrix2x3* product, const BGC_FP32_Matrix3x3* matrix1, const BGC_FP32_Matrix2x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix2x3(BGC_FP64_Matrix2x3* product, const BGC_FP64_Matrix3x3* matrix1, const BGC_FP64_Matrix2x3* matrix2);
|
||||
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* product, const BGC_FP32_Matrix3x3* matrix1, const BGC_FP32_Matrix3x3* matrix2);
|
||||
extern inline void bgc_fp64_matrix3x3_multiply_by_matrix3x3(BGC_FP64_Matrix3x3* product, const BGC_FP64_Matrix3x3* matrix1, const BGC_FP64_Matrix3x3* 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* quotient, const BGC_FP32_Matrix3x3* dividend, const float divisor);
|
||||
extern inline int bgc_fp64_matrix3x3_divide_by_real(BGC_FP64_Matrix3x3* quotient, const BGC_FP64_Matrix3x3* dividend, const double divisor);
|
||||
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 void bgc_fp32_matrix3x3_get_mean2(BGC_FP32_Matrix3x3* mean, const BGC_FP32_Matrix3x3* term1, const BGC_FP32_Matrix3x3* term2);
|
||||
extern inline void bgc_fp64_matrix3x3_get_mean2(BGC_FP64_Matrix3x3* mean, const BGC_FP64_Matrix3x3* term1, const BGC_FP64_Matrix3x3* term2);
|
||||
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);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_get_mean3(BGC_FP32_Matrix3x3* mean, const BGC_FP32_Matrix3x3* term1, const BGC_FP32_Matrix3x3* term2, const BGC_FP32_Matrix3x3* term3);
|
||||
extern inline void bgc_fp64_matrix3x3_get_mean3(BGC_FP64_Matrix3x3* mean, const BGC_FP64_Matrix3x3* term1, const BGC_FP64_Matrix3x3* term2, const BGC_FP64_Matrix3x3* term3);
|
||||
extern inline void bgc_fp32_matrix3x3_get_mean3(BGC_FP32_Matrix3x3* const mean, const BGC_FP32_Matrix3x3* const term1, const BGC_FP32_Matrix3x3* const term2, const BGC_FP32_Matrix3x3* const term3);
|
||||
extern inline void bgc_fp64_matrix3x3_get_mean3(BGC_FP64_Matrix3x3* const mean, const BGC_FP64_Matrix3x3* const term1, const BGC_FP64_Matrix3x3* const term2, const BGC_FP64_Matrix3x3* const term3);
|
||||
|
||||
extern inline void bgc_fp32_matrix3x3_interpolate(BGC_FP32_Matrix3x3* interpolation, const BGC_FP32_Matrix3x3* first, const BGC_FP32_Matrix3x3* second, const float phase);
|
||||
extern inline void bgc_fp64_matrix3x3_interpolate(BGC_FP64_Matrix3x3* interpolation, const BGC_FP64_Matrix3x3* first, const BGC_FP64_Matrix3x3* second, const double phase);
|
||||
extern inline void bgc_fp32_matrix3x3_interpolate(BGC_FP32_Matrix3x3* const interpolation, const BGC_FP32_Matrix3x3* const first, const BGC_FP32_Matrix3x3* const second, const float phase);
|
||||
extern inline void bgc_fp64_matrix3x3_interpolate(BGC_FP64_Matrix3x3* const interpolation, const BGC_FP64_Matrix3x3* const first, const BGC_FP64_Matrix3x3* const second, const double phase);
|
||||
|
||||
// ================ Get Inverse ================= //
|
||||
|
||||
int bgc_fp32_matrix3x3_get_inverse(BGC_FP32_Matrix3x3* inverse, const BGC_FP32_Matrix3x3* matrix)
|
||||
int bgc_fp32_matrix3x3_get_inverse(BGC_FP32_Matrix3x3* const inverse, const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
const float determinant = bgc_fp32_matrix3x3_get_determinant(matrix);
|
||||
|
||||
|
|
@ -126,7 +126,7 @@ int bgc_fp32_matrix3x3_get_inverse(BGC_FP32_Matrix3x3* inverse, const BGC_FP32_M
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
int bgc_fp64_matrix3x3_get_inverse(BGC_FP64_Matrix3x3* inverse, const BGC_FP64_Matrix3x3* matrix)
|
||||
int bgc_fp64_matrix3x3_get_inverse(BGC_FP64_Matrix3x3* const inverse, const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
const double determinant = bgc_fp64_matrix3x3_get_determinant(matrix);
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_reset(BGC_FP32_Matrix3x3* matrix)
|
||||
inline void bgc_fp32_matrix3x3_reset(BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -23,7 +23,7 @@ inline void bgc_fp32_matrix3x3_reset(BGC_FP32_Matrix3x3* matrix)
|
|||
matrix->r3c3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_reset(BGC_FP64_Matrix3x3* matrix)
|
||||
inline void bgc_fp64_matrix3x3_reset(BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 0.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -40,7 +40,7 @@ inline void bgc_fp64_matrix3x3_reset(BGC_FP64_Matrix3x3* matrix)
|
|||
|
||||
// ================== Identity ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_make_identity(BGC_FP32_Matrix3x3* matrix)
|
||||
inline void bgc_fp32_matrix3x3_make_identity(BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 1.0f;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -55,7 +55,7 @@ inline void bgc_fp32_matrix3x3_make_identity(BGC_FP32_Matrix3x3* matrix)
|
|||
matrix->r3c3 = 1.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_make_identity(BGC_FP64_Matrix3x3* matrix)
|
||||
inline void bgc_fp64_matrix3x3_make_identity(BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
matrix->r1c1 = 1.0;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -72,7 +72,7 @@ inline void bgc_fp64_matrix3x3_make_identity(BGC_FP64_Matrix3x3* matrix)
|
|||
|
||||
// ================ Set Diagonal ================ //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_make_diagonal(BGC_FP32_Matrix3x3* matrix, const float d1, const float d2, const float d3)
|
||||
inline void bgc_fp32_matrix3x3_make_diagonal(BGC_FP32_Matrix3x3* const matrix, const float d1, const float d2, const float d3)
|
||||
{
|
||||
matrix->r1c1 = d1;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -87,7 +87,7 @@ inline void bgc_fp32_matrix3x3_make_diagonal(BGC_FP32_Matrix3x3* matrix, const f
|
|||
matrix->r3c3 = d2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_make_diagonal(BGC_FP64_Matrix3x3* matrix, const double d1, const double d2, const double d3)
|
||||
inline void bgc_fp64_matrix3x3_make_diagonal(BGC_FP64_Matrix3x3* const matrix, const double d1, const double d2, const double d3)
|
||||
{
|
||||
matrix->r1c1 = d1;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -104,7 +104,7 @@ inline void bgc_fp64_matrix3x3_make_diagonal(BGC_FP64_Matrix3x3* matrix, const d
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_copy(BGC_FP32_Matrix3x3* destination, const BGC_FP32_Matrix3x3* source)
|
||||
inline void bgc_fp32_matrix3x3_copy(BGC_FP32_Matrix3x3* const destination, const BGC_FP32_Matrix3x3* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -119,7 +119,7 @@ inline void bgc_fp32_matrix3x3_copy(BGC_FP32_Matrix3x3* destination, const BGC_F
|
|||
destination->r3c3 = source->r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_copy(BGC_FP64_Matrix3x3* destination, const BGC_FP64_Matrix3x3* source)
|
||||
inline void bgc_fp64_matrix3x3_copy(BGC_FP64_Matrix3x3* const destination, const BGC_FP64_Matrix3x3* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -136,7 +136,7 @@ inline void bgc_fp64_matrix3x3_copy(BGC_FP64_Matrix3x3* destination, const BGC_F
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* matrix1, BGC_FP32_Matrix3x3* matrix2)
|
||||
inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* const matrix1, BGC_FP32_Matrix3x3* const matrix2)
|
||||
{
|
||||
const float r1c1 = matrix2->r1c1;
|
||||
const float r1c2 = matrix2->r1c2;
|
||||
|
|
@ -175,7 +175,7 @@ inline void bgc_fp32_matrix3x3_swap(BGC_FP32_Matrix3x3* matrix1, BGC_FP32_Matrix
|
|||
matrix1->r3c3 = r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* matrix1, BGC_FP64_Matrix3x3* matrix2)
|
||||
inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* const matrix1, BGC_FP64_Matrix3x3* const matrix2)
|
||||
{
|
||||
const double r1c1 = matrix2->r1c1;
|
||||
const double r1c2 = matrix2->r1c2;
|
||||
|
|
@ -216,7 +216,7 @@ inline void bgc_fp64_matrix3x3_swap(BGC_FP64_Matrix3x3* matrix1, BGC_FP64_Matrix
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_matrix3x3_convert_to_fp32(BGC_FP32_Matrix3x3* destination, const BGC_FP64_Matrix3x3* source)
|
||||
inline void bgc_fp64_matrix3x3_convert_to_fp32(BGC_FP32_Matrix3x3* const destination, const BGC_FP64_Matrix3x3* const source)
|
||||
{
|
||||
destination->r1c1 = (float)source->r1c1;
|
||||
destination->r1c2 = (float)source->r1c2;
|
||||
|
|
@ -231,7 +231,7 @@ inline void bgc_fp64_matrix3x3_convert_to_fp32(BGC_FP32_Matrix3x3* destination,
|
|||
destination->r3c3 = (float)source->r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_matrix3x3_convert_to_fp64(BGC_FP64_Matrix3x3* destination, const BGC_FP32_Matrix3x3* source)
|
||||
inline void bgc_fp32_matrix3x3_convert_to_fp64(BGC_FP64_Matrix3x3* const destination, const BGC_FP32_Matrix3x3* const source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -248,14 +248,14 @@ inline void bgc_fp32_matrix3x3_convert_to_fp64(BGC_FP64_Matrix3x3* destination,
|
|||
|
||||
// ================ Determinant ================= //
|
||||
|
||||
inline float bgc_fp32_matrix3x3_get_determinant(const BGC_FP32_Matrix3x3* matrix)
|
||||
inline float bgc_fp32_matrix3x3_get_determinant(const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
return matrix->r1c1 * (matrix->r2c2 * matrix->r3c3 - matrix->r2c3 * matrix->r3c2)
|
||||
+ matrix->r1c2 * (matrix->r2c3 * matrix->r3c1 - matrix->r2c1 * matrix->r3c3)
|
||||
+ matrix->r1c3 * (matrix->r2c1 * matrix->r3c2 - matrix->r2c2 * matrix->r3c1);
|
||||
}
|
||||
|
||||
inline double bgc_fp64_matrix3x3_get_determinant(const BGC_FP64_Matrix3x3* matrix)
|
||||
inline double bgc_fp64_matrix3x3_get_determinant(const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
return matrix->r1c1 * (matrix->r2c2 * matrix->r3c3 - matrix->r2c3 * matrix->r3c2)
|
||||
+ matrix->r1c2 * (matrix->r2c3 * matrix->r3c1 - matrix->r2c1 * matrix->r3c3)
|
||||
|
|
@ -264,14 +264,14 @@ inline double bgc_fp64_matrix3x3_get_determinant(const BGC_FP64_Matrix3x3* matri
|
|||
|
||||
// ================ Is Identity ================= //
|
||||
|
||||
inline int bgc_fp32_matrix3x3_is_identity(const BGC_FP32_Matrix3x3* matrix)
|
||||
inline int bgc_fp32_matrix3x3_is_identity(const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
return bgc_fp32_is_unit(matrix->r1c1) && bgc_fp32_is_zero(matrix->r1c2) && bgc_fp32_is_zero(matrix->r1c3)
|
||||
&& bgc_fp32_is_zero(matrix->r2c1) && bgc_fp32_is_unit(matrix->r2c2) && bgc_fp32_is_zero(matrix->r2c3)
|
||||
&& bgc_fp32_is_zero(matrix->r3c1) && bgc_fp32_is_zero(matrix->r3c2) && bgc_fp32_is_unit(matrix->r3c3);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x3_is_identity(const BGC_FP64_Matrix3x3* matrix)
|
||||
inline int bgc_fp64_matrix3x3_is_identity(const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
return bgc_fp64_is_unit(matrix->r1c1) && bgc_fp64_is_zero(matrix->r1c2) && bgc_fp64_is_zero(matrix->r1c3)
|
||||
&& bgc_fp64_is_zero(matrix->r2c1) && bgc_fp64_is_unit(matrix->r2c2) && bgc_fp64_is_zero(matrix->r2c3)
|
||||
|
|
@ -280,19 +280,19 @@ inline int bgc_fp64_matrix3x3_is_identity(const BGC_FP64_Matrix3x3* matrix)
|
|||
|
||||
// ================ Is Singular ================= //
|
||||
|
||||
inline int bgc_fp32_matrix3x3_is_singular(const BGC_FP32_Matrix3x3* matrix)
|
||||
inline int bgc_fp32_matrix3x3_is_singular(const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
return bgc_fp32_is_zero(bgc_fp32_matrix3x3_get_determinant(matrix));
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x3_is_singular(const BGC_FP64_Matrix3x3* matrix)
|
||||
inline int bgc_fp64_matrix3x3_is_singular(const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
return bgc_fp64_is_zero(bgc_fp64_matrix3x3_get_determinant(matrix));
|
||||
}
|
||||
|
||||
// ================ Is Rotation ================= //
|
||||
|
||||
inline int bgc_fp32_matrix3x3_is_rotation(const BGC_FP32_Matrix3x3* matrix)
|
||||
inline int bgc_fp32_matrix3x3_is_rotation(const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
BGC_FP32_Matrix3x3 product;
|
||||
|
||||
|
|
@ -311,7 +311,7 @@ inline int bgc_fp32_matrix3x3_is_rotation(const BGC_FP32_Matrix3x3* matrix)
|
|||
return bgc_fp32_matrix3x3_is_identity(&product);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x3_is_rotation(const BGC_FP64_Matrix3x3* matrix)
|
||||
inline int bgc_fp64_matrix3x3_is_rotation(const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
BGC_FP64_Matrix3x3 product;
|
||||
|
||||
|
|
@ -332,25 +332,25 @@ inline int bgc_fp64_matrix3x3_is_rotation(const BGC_FP64_Matrix3x3* matrix)
|
|||
|
||||
// ================ Get Inverse ================= //
|
||||
|
||||
int bgc_fp32_matrix3x3_get_inverse(BGC_FP32_Matrix3x3* inverse, const BGC_FP32_Matrix3x3* matrix);
|
||||
int bgc_fp32_matrix3x3_get_inverse(BGC_FP32_Matrix3x3* const inverse, const BGC_FP32_Matrix3x3* const matrix);
|
||||
|
||||
int bgc_fp64_matrix3x3_get_inverse(BGC_FP64_Matrix3x3* inverse, const BGC_FP64_Matrix3x3* matrix);
|
||||
int bgc_fp64_matrix3x3_get_inverse(BGC_FP64_Matrix3x3* const inverse, const BGC_FP64_Matrix3x3* const matrix);
|
||||
|
||||
// =================== Invert =================== //
|
||||
|
||||
inline int bgc_fp32_matrix3x3_invert(BGC_FP32_Matrix3x3* matrix)
|
||||
inline int bgc_fp32_matrix3x3_invert(BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
return bgc_fp32_matrix3x3_get_inverse(matrix, matrix);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x3_invert(BGC_FP64_Matrix3x3* matrix)
|
||||
inline int bgc_fp64_matrix3x3_invert(BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
return bgc_fp64_matrix3x3_get_inverse(matrix, matrix);
|
||||
}
|
||||
|
||||
// ================= Transpose ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_transpose(BGC_FP32_Matrix3x3* matrix)
|
||||
inline void bgc_fp32_matrix3x3_transpose(BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
const float r1c2 = matrix->r1c2;
|
||||
const float r1c3 = matrix->r1c3;
|
||||
|
|
@ -365,7 +365,7 @@ inline void bgc_fp32_matrix3x3_transpose(BGC_FP32_Matrix3x3* matrix)
|
|||
matrix->r3c2 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_transpose(BGC_FP64_Matrix3x3* matrix)
|
||||
inline void bgc_fp64_matrix3x3_transpose(BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
const double r1c2 = matrix->r1c2;
|
||||
const double r1c3 = matrix->r1c3;
|
||||
|
|
@ -382,7 +382,7 @@ inline void bgc_fp64_matrix3x3_transpose(BGC_FP64_Matrix3x3* matrix)
|
|||
|
||||
// =============== Get Transpose ================ //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_get_transposed(BGC_FP32_Matrix3x3* transposed, const BGC_FP32_Matrix3x3* matrix)
|
||||
inline void bgc_fp32_matrix3x3_get_transposed(BGC_FP32_Matrix3x3* const transposed, const BGC_FP32_Matrix3x3* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r2c2 = matrix->r2c2;
|
||||
|
|
@ -401,7 +401,7 @@ inline void bgc_fp32_matrix3x3_get_transposed(BGC_FP32_Matrix3x3* transposed, co
|
|||
transposed->r3c2 = r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_get_transposed(BGC_FP64_Matrix3x3* transposed, const BGC_FP64_Matrix3x3* matrix)
|
||||
inline void bgc_fp64_matrix3x3_get_transposed(BGC_FP64_Matrix3x3* const transposed, const BGC_FP64_Matrix3x3* const matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r2c2 = matrix->r2c2;
|
||||
|
|
@ -422,7 +422,7 @@ inline void bgc_fp64_matrix3x3_get_transposed(BGC_FP64_Matrix3x3* transposed, co
|
|||
|
||||
// ================== Get Row -================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Matrix3x3* matrix, const int row_number)
|
||||
inline void bgc_fp32_matrix3x3_get_row(BGC_FP32_Vector3* const row, const BGC_FP32_Matrix3x3* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -453,7 +453,7 @@ inline void bgc_fp32_matrix3x3_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Mat
|
|||
row->x3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Matrix3x3* matrix, const int row_number)
|
||||
inline void bgc_fp64_matrix3x3_get_row(BGC_FP64_Vector3* const row, const BGC_FP64_Matrix3x3* const matrix, const int row_number)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -486,7 +486,7 @@ inline void bgc_fp64_matrix3x3_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Mat
|
|||
|
||||
// ================== Set Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_set_row(BGC_FP32_Matrix3x3* matrix, const int row_number, const BGC_FP32_Vector3* row)
|
||||
inline void bgc_fp32_matrix3x3_set_row(BGC_FP32_Matrix3x3* const matrix, const int row_number, const BGC_FP32_Vector3* const row)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -512,7 +512,7 @@ inline void bgc_fp32_matrix3x3_set_row(BGC_FP32_Matrix3x3* matrix, const int row
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_set_row(BGC_FP64_Matrix3x3* matrix, const int row_number, const BGC_FP64_Vector3* row)
|
||||
inline void bgc_fp64_matrix3x3_set_row(BGC_FP64_Matrix3x3* const matrix, const int row_number, const BGC_FP64_Vector3* const row)
|
||||
{
|
||||
if (row_number == 1)
|
||||
{
|
||||
|
|
@ -540,7 +540,7 @@ inline void bgc_fp64_matrix3x3_set_row(BGC_FP64_Matrix3x3* matrix, const int row
|
|||
|
||||
// ================= Get Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_get_column(BGC_FP32_Vector3* column, const BGC_FP32_Matrix3x3* matrix, const int column_number)
|
||||
inline void bgc_fp32_matrix3x3_get_column(BGC_FP32_Vector3* const column, const BGC_FP32_Matrix3x3* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -571,7 +571,7 @@ inline void bgc_fp32_matrix3x3_get_column(BGC_FP32_Vector3* column, const BGC_FP
|
|||
column->x3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_get_column(BGC_FP64_Vector3* column, const BGC_FP64_Matrix3x3* matrix, const int column_number)
|
||||
inline void bgc_fp64_matrix3x3_get_column(BGC_FP64_Vector3* const column, const BGC_FP64_Matrix3x3* const matrix, const int column_number)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -604,7 +604,7 @@ inline void bgc_fp64_matrix3x3_get_column(BGC_FP64_Vector3* column, const BGC_FP
|
|||
|
||||
// ================= Set Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_set_column(BGC_FP32_Matrix3x3* matrix, const int column_number, const BGC_FP32_Vector3* column)
|
||||
inline void bgc_fp32_matrix3x3_set_column(BGC_FP32_Matrix3x3* const matrix, const int column_number, const BGC_FP32_Vector3* const column)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -630,7 +630,7 @@ inline void bgc_fp32_matrix3x3_set_column(BGC_FP32_Matrix3x3* matrix, const int
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_set_column(BGC_FP64_Matrix3x3* matrix, const int column_number, const BGC_FP64_Vector3* column)
|
||||
inline void bgc_fp64_matrix3x3_set_column(BGC_FP64_Matrix3x3* const matrix, const int column_number, const BGC_FP64_Vector3* const column)
|
||||
{
|
||||
if (column_number == 1)
|
||||
{
|
||||
|
|
@ -658,7 +658,7 @@ inline void bgc_fp64_matrix3x3_set_column(BGC_FP64_Matrix3x3* matrix, const int
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* sum, const BGC_FP32_Matrix3x3* matrix1, const BGC_FP32_Matrix3x3* matrix2)
|
||||
inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const matrix1, const BGC_FP32_Matrix3x3* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -673,7 +673,7 @@ inline void bgc_fp32_matrix3x3_add(BGC_FP32_Matrix3x3* sum, const BGC_FP32_Matri
|
|||
sum->r3c3 = matrix1->r3c3 + matrix2->r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* sum, const BGC_FP64_Matrix3x3* matrix1, const BGC_FP64_Matrix3x3* matrix2)
|
||||
inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const matrix1, const BGC_FP64_Matrix3x3* const matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -690,7 +690,7 @@ inline void bgc_fp64_matrix3x3_add(BGC_FP64_Matrix3x3* sum, const BGC_FP64_Matri
|
|||
|
||||
// ================= Add Scaled ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_add_scaled(BGC_FP32_Matrix3x3* sum, const BGC_FP32_Matrix3x3* basic_matrix, const BGC_FP32_Matrix3x3* scalable_matrix, const float scale)
|
||||
inline void bgc_fp32_matrix3x3_add_scaled(BGC_FP32_Matrix3x3* const sum, const BGC_FP32_Matrix3x3* const basic_matrix, const BGC_FP32_Matrix3x3* const scalable_matrix, const float scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -705,7 +705,7 @@ inline void bgc_fp32_matrix3x3_add_scaled(BGC_FP32_Matrix3x3* sum, const BGC_FP3
|
|||
sum->r3c3 = basic_matrix->r3c3 + scalable_matrix->r3c3 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_add_scaled(BGC_FP64_Matrix3x3* sum, const BGC_FP64_Matrix3x3* basic_matrix, const BGC_FP64_Matrix3x3* scalable_matrix, const double scale)
|
||||
inline void bgc_fp64_matrix3x3_add_scaled(BGC_FP64_Matrix3x3* const sum, const BGC_FP64_Matrix3x3* const basic_matrix, const BGC_FP64_Matrix3x3* const scalable_matrix, const double scale)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -722,7 +722,7 @@ inline void bgc_fp64_matrix3x3_add_scaled(BGC_FP64_Matrix3x3* sum, const BGC_FP6
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_subtract(BGC_FP32_Matrix3x3* difference, const BGC_FP32_Matrix3x3* minuend, const BGC_FP32_Matrix3x3* subtrahend)
|
||||
inline void bgc_fp32_matrix3x3_subtract(BGC_FP32_Matrix3x3* const difference, const BGC_FP32_Matrix3x3* const minuend, const BGC_FP32_Matrix3x3* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -737,7 +737,7 @@ inline void bgc_fp32_matrix3x3_subtract(BGC_FP32_Matrix3x3* difference, const BG
|
|||
difference->r3c3 = minuend->r3c3 - subtrahend->r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_subtract(BGC_FP64_Matrix3x3* difference, const BGC_FP64_Matrix3x3* minuend, const BGC_FP64_Matrix3x3* subtrahend)
|
||||
inline void bgc_fp64_matrix3x3_subtract(BGC_FP64_Matrix3x3* const difference, const BGC_FP64_Matrix3x3* const minuend, const BGC_FP64_Matrix3x3* const subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -754,7 +754,7 @@ inline void bgc_fp64_matrix3x3_subtract(BGC_FP64_Matrix3x3* difference, const BG
|
|||
|
||||
// ============== Subtract Scaled =============== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_subtract_scaled(BGC_FP32_Matrix3x3* difference, const BGC_FP32_Matrix3x3* basic_matrix, const BGC_FP32_Matrix3x3* scalable_matrix, const float scale)
|
||||
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)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -769,7 +769,7 @@ inline void bgc_fp32_matrix3x3_subtract_scaled(BGC_FP32_Matrix3x3* difference, c
|
|||
difference->r3c3 = basic_matrix->r3c3 - scalable_matrix->r3c3 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_subtract_scaled(BGC_FP64_Matrix3x3* difference, const BGC_FP64_Matrix3x3* basic_matrix, const BGC_FP64_Matrix3x3* scalable_matrix, const double scale)
|
||||
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)
|
||||
{
|
||||
difference->r1c1 = basic_matrix->r1c1 - scalable_matrix->r1c1 * scale;
|
||||
difference->r1c2 = basic_matrix->r1c2 - scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -786,7 +786,7 @@ inline void bgc_fp64_matrix3x3_subtract_scaled(BGC_FP64_Matrix3x3* difference, c
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_real(BGC_FP32_Matrix3x3* product, const BGC_FP32_Matrix3x3* multiplicand, const float multiplier)
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_real(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* product, con
|
|||
product->r3c3 = multiplicand->r3c3 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_real(BGC_FP64_Matrix3x3* product, const BGC_FP64_Matrix3x3* multiplicand, const double multiplier)
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_real(BGC_FP64_Matrix3x3* const product, const BGC_FP64_Matrix3x3* const multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -818,7 +818,7 @@ inline void bgc_fp64_matrix3x3_multiply_by_real(BGC_FP64_Matrix3x3* product, con
|
|||
|
||||
// ============ Right Vector Product ============ //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_vector3(BGC_FP32_Vector3* product, const BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Vector3* vector)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
|
@ -829,7 +829,7 @@ inline void bgc_fp32_matrix3x3_multiply_by_vector3(BGC_FP32_Vector3* product, co
|
|||
product->x3 = x3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* product, const BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Vector3* vector)
|
||||
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)
|
||||
{
|
||||
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;
|
||||
|
|
@ -843,7 +843,7 @@ inline void bgc_fp64_matrix3x3_multiply_by_vector3(BGC_FP64_Vector3* product, co
|
|||
|
||||
// ========== Matrix Product 3x3 at 2x3 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_matrix2x3(BGC_FP32_Matrix2x3* product, const BGC_FP32_Matrix3x3* matrix1, const BGC_FP32_Matrix2x3* matrix2)
|
||||
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)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -864,7 +864,7 @@ inline void bgc_fp32_matrix3x3_multiply_by_matrix2x3(BGC_FP32_Matrix2x3* product
|
|||
product->r3c2 = r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_matrix2x3(BGC_FP64_Matrix2x3* product, const BGC_FP64_Matrix3x3* matrix1, const BGC_FP64_Matrix2x3* matrix2)
|
||||
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)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -887,7 +887,7 @@ inline void bgc_fp64_matrix3x3_multiply_by_matrix2x3(BGC_FP64_Matrix2x3* product
|
|||
|
||||
// ========== Matrix Product 3x3 at 3x3 ========= //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_multiply_by_matrix3x3(BGC_FP32_Matrix3x3* product, const BGC_FP32_Matrix3x3* matrix1, const BGC_FP32_Matrix3x3* matrix2)
|
||||
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)
|
||||
{
|
||||
const float r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const float r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -914,7 +914,7 @@ inline void bgc_fp32_matrix3x3_multiply_by_matrix3x3(BGC_FP32_Matrix3x3* product
|
|||
product->r3c3 = r3c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_multiply_by_matrix3x3(BGC_FP64_Matrix3x3* product, const BGC_FP64_Matrix3x3* matrix1, const BGC_FP64_Matrix3x3* matrix2)
|
||||
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)
|
||||
{
|
||||
const double r1c1 = matrix1->r1c1 * matrix2->r1c1 + matrix1->r1c2 * matrix2->r2c1 + matrix1->r1c3 * matrix2->r3c1;
|
||||
const double r1c2 = matrix1->r1c1 * matrix2->r1c2 + matrix1->r1c2 * matrix2->r2c2 + matrix1->r1c3 * matrix2->r3c2;
|
||||
|
|
@ -943,7 +943,7 @@ inline void bgc_fp64_matrix3x3_multiply_by_matrix3x3(BGC_FP64_Matrix3x3* product
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline int bgc_fp32_matrix3x3_divide_by_real(BGC_FP32_Matrix3x3* quotient, const BGC_FP32_Matrix3x3* dividend, const float divisor)
|
||||
inline int bgc_fp32_matrix3x3_divide_by_real(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;
|
||||
|
|
@ -953,7 +953,7 @@ inline int bgc_fp32_matrix3x3_divide_by_real(BGC_FP32_Matrix3x3* quotient, const
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix3x3_divide_by_real(BGC_FP64_Matrix3x3* quotient, const BGC_FP64_Matrix3x3* dividend, const double divisor)
|
||||
inline int bgc_fp64_matrix3x3_divide_by_real(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;
|
||||
|
|
@ -965,7 +965,7 @@ inline int bgc_fp64_matrix3x3_divide_by_real(BGC_FP64_Matrix3x3* quotient, const
|
|||
|
||||
// ================== Average2 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_get_mean2(BGC_FP32_Matrix3x3* mean, const BGC_FP32_Matrix3x3* term1, const BGC_FP32_Matrix3x3* term2)
|
||||
inline void bgc_fp32_matrix3x3_get_mean2(BGC_FP32_Matrix3x3* const mean, const BGC_FP32_Matrix3x3* const term1, const BGC_FP32_Matrix3x3* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5f;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5f;
|
||||
|
|
@ -980,7 +980,7 @@ inline void bgc_fp32_matrix3x3_get_mean2(BGC_FP32_Matrix3x3* mean, const BGC_FP3
|
|||
mean->r3c3 = (term1->r3c3 + term2->r3c3) * 0.5f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_get_mean2(BGC_FP64_Matrix3x3* mean, const BGC_FP64_Matrix3x3* term1, const BGC_FP64_Matrix3x3* term2)
|
||||
inline void bgc_fp64_matrix3x3_get_mean2(BGC_FP64_Matrix3x3* const mean, const BGC_FP64_Matrix3x3* const term1, const BGC_FP64_Matrix3x3* const term2)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1) * 0.5;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2) * 0.5;
|
||||
|
|
@ -997,7 +997,7 @@ inline void bgc_fp64_matrix3x3_get_mean2(BGC_FP64_Matrix3x3* mean, const BGC_FP6
|
|||
|
||||
// ================== Average3 ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_get_mean3(BGC_FP32_Matrix3x3* mean, const BGC_FP32_Matrix3x3* term1, const BGC_FP32_Matrix3x3* term2, const BGC_FP32_Matrix3x3* term3)
|
||||
inline void bgc_fp32_matrix3x3_get_mean3(BGC_FP32_Matrix3x3* const mean, const BGC_FP32_Matrix3x3* const term1, const BGC_FP32_Matrix3x3* const term2, const BGC_FP32_Matrix3x3* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP32_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP32_ONE_THIRD;
|
||||
|
|
@ -1012,7 +1012,7 @@ inline void bgc_fp32_matrix3x3_get_mean3(BGC_FP32_Matrix3x3* mean, const BGC_FP3
|
|||
mean->r3c3 = (term1->r3c3 + term2->r3c3 + term3->r3c3) * BGC_FP32_ONE_THIRD;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_get_mean3(BGC_FP64_Matrix3x3* mean, const BGC_FP64_Matrix3x3* term1, const BGC_FP64_Matrix3x3* term2, const BGC_FP64_Matrix3x3* term3)
|
||||
inline void bgc_fp64_matrix3x3_get_mean3(BGC_FP64_Matrix3x3* const mean, const BGC_FP64_Matrix3x3* const term1, const BGC_FP64_Matrix3x3* const term2, const BGC_FP64_Matrix3x3* const term3)
|
||||
{
|
||||
mean->r1c1 = (term1->r1c1 + term2->r1c1 + term3->r1c1) * BGC_FP64_ONE_THIRD;
|
||||
mean->r1c2 = (term1->r1c2 + term2->r1c2 + term3->r1c2) * BGC_FP64_ONE_THIRD;
|
||||
|
|
@ -1029,7 +1029,7 @@ inline void bgc_fp64_matrix3x3_get_mean3(BGC_FP64_Matrix3x3* mean, const BGC_FP6
|
|||
|
||||
// ================ Interpolate ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x3_interpolate(BGC_FP32_Matrix3x3* interpolation, const BGC_FP32_Matrix3x3* first, const BGC_FP32_Matrix3x3* second, const float phase)
|
||||
inline void bgc_fp32_matrix3x3_interpolate(BGC_FP32_Matrix3x3* const interpolation, const BGC_FP32_Matrix3x3* const first, const BGC_FP32_Matrix3x3* const second, const float phase)
|
||||
{
|
||||
const float counter_phase = 1.0f - phase;
|
||||
|
||||
|
|
@ -1046,7 +1046,7 @@ inline void bgc_fp32_matrix3x3_interpolate(BGC_FP32_Matrix3x3* interpolation, co
|
|||
interpolation->r3c3 = first->r3c3 * counter_phase + second->r3c3 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x3_interpolate(BGC_FP64_Matrix3x3* interpolation, const BGC_FP64_Matrix3x3* first, const BGC_FP64_Matrix3x3* second, const double phase)
|
||||
inline void bgc_fp64_matrix3x3_interpolate(BGC_FP64_Matrix3x3* const interpolation, const BGC_FP64_Matrix3x3* const first, const BGC_FP64_Matrix3x3* const second, const double phase)
|
||||
{
|
||||
const double counter_phase = 1.0 - phase;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,49 +1,49 @@
|
|||
#include "./position2.h"
|
||||
|
||||
extern inline void bgc_fp32_position2_reset(BGC_FP32_Position2* node);
|
||||
extern inline void bgc_fp64_position2_reset(BGC_FP64_Position2* node);
|
||||
extern inline void bgc_fp32_position2_reset(BGC_FP32_Position2* const node);
|
||||
extern inline void bgc_fp64_position2_reset(BGC_FP64_Position2* const node);
|
||||
|
||||
extern inline void bgc_fp32_position2_make(BGC_FP32_Position2* position, const BGC_FP32_Turn2* turn, const BGC_FP32_Vector2* shift);
|
||||
extern inline void bgc_fp64_position2_make(BGC_FP64_Position2* position, const BGC_FP64_Turn2* turn, const BGC_FP64_Vector2* shift);
|
||||
extern inline void bgc_fp32_position2_make(BGC_FP32_Position2* const position, const BGC_FP32_Turn2* const turn, const BGC_FP32_Vector2* const shift);
|
||||
extern inline void bgc_fp64_position2_make(BGC_FP64_Position2* const position, const BGC_FP64_Turn2* const turn, const BGC_FP64_Vector2* const shift);
|
||||
|
||||
extern inline void bgc_fp32_position2_copy(BGC_FP32_Position2* destination, const BGC_FP32_Position2* source);
|
||||
extern inline void bgc_fp64_position2_copy(BGC_FP64_Position2* destination, const BGC_FP64_Position2* source);
|
||||
extern inline void bgc_fp32_position2_copy(BGC_FP32_Position2* const destination, const BGC_FP32_Position2* const source);
|
||||
extern inline void bgc_fp64_position2_copy(BGC_FP64_Position2* const destination, const BGC_FP64_Position2* const source);
|
||||
|
||||
extern inline void bgc_fp32_position2_swap(BGC_FP32_Position2* first, BGC_FP32_Position2* second);
|
||||
extern inline void bgc_fp64_position2_swap(BGC_FP64_Position2* first, BGC_FP64_Position2* second);
|
||||
extern inline void bgc_fp32_position2_swap(BGC_FP32_Position2* const first, BGC_FP32_Position2* const second);
|
||||
extern inline void bgc_fp64_position2_swap(BGC_FP64_Position2* const first, BGC_FP64_Position2* const second);
|
||||
|
||||
extern inline void bgc_fp64_position2_convert_to_fp32(BGC_FP32_Position2* destination, const BGC_FP64_Position2* source);
|
||||
extern inline void bgc_fp32_position2_convert_to_fp64(BGC_FP64_Position2* destination, const BGC_FP32_Position2* source);
|
||||
extern inline void bgc_fp64_position2_convert_to_fp32(BGC_FP32_Position2* const destination, const BGC_FP64_Position2* const source);
|
||||
extern inline void bgc_fp32_position2_convert_to_fp64(BGC_FP64_Position2* const destination, const BGC_FP32_Position2* const source);
|
||||
|
||||
extern inline int bgc_fp32_position2_is_idle(const BGC_FP32_Position2* position);
|
||||
extern inline int bgc_fp64_position2_is_idle(const BGC_FP64_Position2* position);
|
||||
extern inline int bgc_fp32_position2_is_idle(const BGC_FP32_Position2* const position);
|
||||
extern inline int bgc_fp64_position2_is_idle(const BGC_FP64_Position2* const position);
|
||||
|
||||
extern inline void bgc_fp32_position2_invert(BGC_FP32_Position2* position);
|
||||
extern inline void bgc_fp64_position2_invert(BGC_FP64_Position2* position);
|
||||
extern inline void bgc_fp32_position2_invert(BGC_FP32_Position2* const position);
|
||||
extern inline void bgc_fp64_position2_invert(BGC_FP64_Position2* const position);
|
||||
|
||||
extern inline void bgc_fp32_position2_get_inverse(BGC_FP32_Position2* inverted, const BGC_FP32_Position2* position);
|
||||
extern inline void bgc_fp64_position2_get_inverse(BGC_FP64_Position2* inverted, const BGC_FP64_Position2* position);
|
||||
extern inline void bgc_fp32_position2_get_inverse(BGC_FP32_Position2* const inverted, const BGC_FP32_Position2* const position);
|
||||
extern inline void bgc_fp64_position2_get_inverse(BGC_FP64_Position2* const inverted, const BGC_FP64_Position2* const position);
|
||||
|
||||
extern inline void bgc_fp32_position2_combine(BGC_FP32_Position2* combination, const BGC_FP32_Position2* first, const BGC_FP32_Position2* second);
|
||||
extern inline void bgc_fp64_position2_combine(BGC_FP64_Position2* combination, const BGC_FP64_Position2* first, const BGC_FP64_Position2* second);
|
||||
extern inline void bgc_fp32_position2_combine(BGC_FP32_Position2* const combination, const BGC_FP32_Position2* const first, const BGC_FP32_Position2* const second);
|
||||
extern inline void bgc_fp64_position2_combine(BGC_FP64_Position2* const combination, const BGC_FP64_Position2* const first, const BGC_FP64_Position2* const second);
|
||||
|
||||
extern inline void bgc_fp32_position2_exclude(BGC_FP32_Position2* difference, const BGC_FP32_Position2* base, const BGC_FP32_Position2* excludand);
|
||||
extern inline void bgc_fp64_position2_exclude(BGC_FP64_Position2* difference, const BGC_FP64_Position2* base, const BGC_FP64_Position2* excludand);
|
||||
extern inline void bgc_fp32_position2_exclude(BGC_FP32_Position2* const difference, const BGC_FP32_Position2* const base, const BGC_FP32_Position2* const excludand);
|
||||
extern inline void bgc_fp64_position2_exclude(BGC_FP64_Position2* const difference, const BGC_FP64_Position2* const base, const BGC_FP64_Position2* const excludand);
|
||||
|
||||
extern inline void bgc_fp32_position2_get_outward_affine(BGC_FP32_Affine2* outward_affine_map, const BGC_FP32_Position2* position);
|
||||
extern inline void bgc_fp64_position2_get_outward_affine(BGC_FP64_Affine2* outward_affine_map, const BGC_FP64_Position2* position);
|
||||
extern inline void bgc_fp32_position2_get_outward_affine(BGC_FP32_Affine2* const outward_affine_map, const BGC_FP32_Position2* const position);
|
||||
extern inline void bgc_fp64_position2_get_outward_affine(BGC_FP64_Affine2* const outward_affine_map, const BGC_FP64_Position2* const position);
|
||||
|
||||
extern inline void bgc_fp32_position2_get_inward_affine(BGC_FP32_Affine2* inward_affine_map, const BGC_FP32_Position2* position);
|
||||
extern inline void bgc_fp64_position2_get_inward_affine(BGC_FP64_Affine2* inward_affine_map, const BGC_FP64_Position2* position);
|
||||
extern inline void bgc_fp32_position2_get_inward_affine(BGC_FP32_Affine2* const inward_affine_map, const BGC_FP32_Position2* const position);
|
||||
extern inline void bgc_fp64_position2_get_inward_affine(BGC_FP64_Affine2* const inward_affine_map, const BGC_FP64_Position2* const position);
|
||||
|
||||
extern inline void bgc_fp32_position2_transform_point_outwards(BGC_FP32_Vector2* outer_point, const BGC_FP32_Position2* position, const BGC_FP32_Vector2* inner_point);
|
||||
extern inline void bgc_fp64_position2_transform_point_outwards(BGC_FP64_Vector2* outer_point, const BGC_FP64_Position2* position, const BGC_FP64_Vector2* inner_point);
|
||||
extern inline void bgc_fp32_position2_transform_point_outwards(BGC_FP32_Vector2* const outer_point, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const inner_point);
|
||||
extern inline void bgc_fp64_position2_transform_point_outwards(BGC_FP64_Vector2* const outer_point, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const inner_point);
|
||||
|
||||
extern inline void bgc_fp32_position2_transform_point_inwards(BGC_FP32_Vector2* inner_point, const BGC_FP32_Position2* position, const BGC_FP32_Vector2* outer_point);
|
||||
extern inline void bgc_fp64_position2_transform_point_inwards(BGC_FP64_Vector2* inner_point, const BGC_FP64_Position2* position, const BGC_FP64_Vector2* outer_point);
|
||||
extern inline void bgc_fp32_position2_transform_point_inwards(BGC_FP32_Vector2* const inner_point, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const outer_point);
|
||||
extern inline void bgc_fp64_position2_transform_point_inwards(BGC_FP64_Vector2* const inner_point, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const outer_point);
|
||||
|
||||
extern inline void bgc_fp32_position2_transform_vector_outwards(BGC_FP32_Vector2* outer_vector, const BGC_FP32_Position2* position, const BGC_FP32_Vector2* inner_vector);
|
||||
extern inline void bgc_fp64_position2_transform_vector_outwards(BGC_FP64_Vector2* outer_vector, const BGC_FP64_Position2* position, const BGC_FP64_Vector2* inner_vector);
|
||||
extern inline void bgc_fp32_position2_transform_vector_outwards(BGC_FP32_Vector2* const outer_vector, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const inner_vector);
|
||||
extern inline void bgc_fp64_position2_transform_vector_outwards(BGC_FP64_Vector2* const outer_vector, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const inner_vector);
|
||||
|
||||
extern inline void bgc_fp32_position2_transform_vector_inwards(BGC_FP32_Vector2* inner_vector, const BGC_FP32_Position2* position, const BGC_FP32_Vector2* outer_vector);
|
||||
extern inline void bgc_fp64_position2_transform_vector_inwards(BGC_FP64_Vector2* inner_vector, const BGC_FP64_Position2* position, const BGC_FP64_Vector2* outer_vector);
|
||||
extern inline void bgc_fp32_position2_transform_vector_inwards(BGC_FP32_Vector2* const inner_vector, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const outer_vector);
|
||||
extern inline void bgc_fp64_position2_transform_vector_inwards(BGC_FP64_Vector2* const inner_vector, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const outer_vector);
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
// ==================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_position2_reset(BGC_FP32_Position2* position)
|
||||
inline void bgc_fp32_position2_reset(BGC_FP32_Position2* const position)
|
||||
{
|
||||
bgc_fp32_turn2_reset(&position->turn);
|
||||
bgc_fp32_vector2_reset(&position->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_reset(BGC_FP64_Position2* position)
|
||||
inline void bgc_fp64_position2_reset(BGC_FP64_Position2* const position)
|
||||
{
|
||||
bgc_fp64_turn2_reset(&position->turn);
|
||||
bgc_fp64_vector2_reset(&position->shift);
|
||||
|
|
@ -22,13 +22,13 @@ inline void bgc_fp64_position2_reset(BGC_FP64_Position2* position)
|
|||
|
||||
// ==================== Make ===================== //
|
||||
|
||||
inline void bgc_fp32_position2_make(BGC_FP32_Position2* position, const BGC_FP32_Turn2* turn, const BGC_FP32_Vector2* shift)
|
||||
inline void bgc_fp32_position2_make(BGC_FP32_Position2* const position, const BGC_FP32_Turn2* const turn, const BGC_FP32_Vector2* const shift)
|
||||
{
|
||||
bgc_fp32_turn2_copy(&position->turn, turn);
|
||||
bgc_fp32_vector2_copy(&position->shift, shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_make(BGC_FP64_Position2* position, const BGC_FP64_Turn2* turn, const BGC_FP64_Vector2* shift)
|
||||
inline void bgc_fp64_position2_make(BGC_FP64_Position2* const position, const BGC_FP64_Turn2* const turn, const BGC_FP64_Vector2* const shift)
|
||||
{
|
||||
bgc_fp64_turn2_copy(&position->turn, turn);
|
||||
bgc_fp64_vector2_copy(&position->shift, shift);
|
||||
|
|
@ -37,13 +37,13 @@ inline void bgc_fp64_position2_make(BGC_FP64_Position2* position, const BGC_FP64
|
|||
|
||||
// ==================== Copy ===================== //
|
||||
|
||||
inline void bgc_fp32_position2_copy(BGC_FP32_Position2* destination, const BGC_FP32_Position2* source)
|
||||
inline void bgc_fp32_position2_copy(BGC_FP32_Position2* const destination, const BGC_FP32_Position2* const source)
|
||||
{
|
||||
bgc_fp32_turn2_copy(&destination->turn, &source->turn);
|
||||
bgc_fp32_vector2_copy(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_copy(BGC_FP64_Position2* destination, const BGC_FP64_Position2* source)
|
||||
inline void bgc_fp64_position2_copy(BGC_FP64_Position2* const destination, const BGC_FP64_Position2* const source)
|
||||
{
|
||||
bgc_fp64_turn2_copy(&destination->turn, &source->turn);
|
||||
bgc_fp64_vector2_copy(&destination->shift, &source->shift);
|
||||
|
|
@ -51,13 +51,13 @@ inline void bgc_fp64_position2_copy(BGC_FP64_Position2* destination, const BGC_F
|
|||
|
||||
// ==================== Swap ===================== //
|
||||
|
||||
inline void bgc_fp32_position2_swap(BGC_FP32_Position2 * first, BGC_FP32_Position2 * second)
|
||||
inline void bgc_fp32_position2_swap(BGC_FP32_Position2* const first, BGC_FP32_Position2* const second)
|
||||
{
|
||||
bgc_fp32_turn2_swap(&first->turn, &second->turn);
|
||||
bgc_fp32_vector2_swap(&first->shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_swap(BGC_FP64_Position2 * first, BGC_FP64_Position2 * second)
|
||||
inline void bgc_fp64_position2_swap(BGC_FP64_Position2* const first, BGC_FP64_Position2* const second)
|
||||
{
|
||||
bgc_fp64_turn2_swap(&first->turn, &second->turn);
|
||||
bgc_fp64_vector2_swap(&first->shift, &second->shift);
|
||||
|
|
@ -65,13 +65,13 @@ inline void bgc_fp64_position2_swap(BGC_FP64_Position2 * first, BGC_FP64_Positio
|
|||
|
||||
// =================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_position2_convert_to_fp32(BGC_FP32_Position2* destination, const BGC_FP64_Position2 * source)
|
||||
inline void bgc_fp64_position2_convert_to_fp32(BGC_FP32_Position2* const destination, const BGC_FP64_Position2* const source)
|
||||
{
|
||||
bgc_fp64_turn2_convert_to_fp32(&destination->turn, &source->turn);
|
||||
bgc_fp64_vector2_convert_to_fp32(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp32_position2_convert_to_fp64(BGC_FP64_Position2* destination, const BGC_FP32_Position2 * source)
|
||||
inline void bgc_fp32_position2_convert_to_fp64(BGC_FP64_Position2* const destination, const BGC_FP32_Position2* const source)
|
||||
{
|
||||
bgc_fp32_turn2_convert_to_fp64(&destination->turn, &source->turn);
|
||||
bgc_fp32_vector2_convert_to_fp64(&destination->shift, &source->shift);
|
||||
|
|
@ -79,26 +79,26 @@ inline void bgc_fp32_position2_convert_to_fp64(BGC_FP64_Position2* destination,
|
|||
|
||||
// =================== Is Idle =================== //
|
||||
|
||||
inline int bgc_fp32_position2_is_idle(const BGC_FP32_Position2 * position)
|
||||
inline int bgc_fp32_position2_is_idle(const BGC_FP32_Position2* const position)
|
||||
{
|
||||
return bgc_fp32_vector2_is_zero(&position->shift) && bgc_fp32_turn2_is_idle(&position->turn);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_position2_is_idle(const BGC_FP64_Position2 * position)
|
||||
inline int bgc_fp64_position2_is_idle(const BGC_FP64_Position2* const position)
|
||||
{
|
||||
return bgc_fp64_vector2_is_zero(&position->shift) && bgc_fp64_turn2_is_idle(&position->turn);
|
||||
}
|
||||
|
||||
// =================== Invert ==================== //
|
||||
|
||||
inline void bgc_fp32_position2_invert(BGC_FP32_Position2 * position)
|
||||
inline void bgc_fp32_position2_invert(BGC_FP32_Position2* const position)
|
||||
{
|
||||
bgc_fp32_turn2_vector_back(&position->shift, &position->turn, &position->shift);
|
||||
bgc_fp32_turn2_revert(&position->turn);
|
||||
bgc_fp32_vector2_revert(&position->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_invert(BGC_FP64_Position2 * position)
|
||||
inline void bgc_fp64_position2_invert(BGC_FP64_Position2* const position)
|
||||
{
|
||||
bgc_fp64_turn2_vector_back(&position->shift, &position->turn, &position->shift);
|
||||
bgc_fp64_turn2_revert(&position->turn);
|
||||
|
|
@ -107,14 +107,14 @@ inline void bgc_fp64_position2_invert(BGC_FP64_Position2 * position)
|
|||
|
||||
// ================= Get Inverse ================= //
|
||||
|
||||
inline void bgc_fp32_position2_get_inverse(BGC_FP32_Position2* inverted, const BGC_FP32_Position2 * position)
|
||||
inline void bgc_fp32_position2_get_inverse(BGC_FP32_Position2* const inverted, const BGC_FP32_Position2* const position)
|
||||
{
|
||||
bgc_fp32_turn2_vector_back(&inverted->shift, &position->turn, &position->shift);
|
||||
bgc_fp32_turn2_get_reverse(&inverted->turn, &position->turn);
|
||||
bgc_fp32_vector2_revert(&inverted->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_get_inverse(BGC_FP64_Position2* inverted, const BGC_FP64_Position2 * position)
|
||||
inline void bgc_fp64_position2_get_inverse(BGC_FP64_Position2* const inverted, const BGC_FP64_Position2* const position)
|
||||
{
|
||||
bgc_fp64_turn2_vector_back(&inverted->shift, &position->turn, &position->shift);
|
||||
bgc_fp64_turn2_get_reverse(&inverted->turn, &position->turn);
|
||||
|
|
@ -123,7 +123,7 @@ inline void bgc_fp64_position2_get_inverse(BGC_FP64_Position2* inverted, const B
|
|||
|
||||
// =================== Combine =================== //
|
||||
|
||||
inline void bgc_fp32_position2_combine(BGC_FP32_Position2* combination, const BGC_FP32_Position2 * first, const BGC_FP32_Position2 * second)
|
||||
inline void bgc_fp32_position2_combine(BGC_FP32_Position2* const combination, const BGC_FP32_Position2* const first, const BGC_FP32_Position2* const second)
|
||||
{
|
||||
BGC_FP32_Vector2 relative_shift;
|
||||
bgc_fp32_turn2_vector(&relative_shift, &second->turn, &first->shift);
|
||||
|
|
@ -131,7 +131,7 @@ inline void bgc_fp32_position2_combine(BGC_FP32_Position2* combination, const BG
|
|||
bgc_fp32_vector2_add(&combination->shift, &second->shift, &relative_shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_combine(BGC_FP64_Position2* combination, const BGC_FP64_Position2 * first, const BGC_FP64_Position2 * second)
|
||||
inline void bgc_fp64_position2_combine(BGC_FP64_Position2* const combination, const BGC_FP64_Position2* const first, const BGC_FP64_Position2* const second)
|
||||
{
|
||||
BGC_FP64_Vector2 relative_shift;
|
||||
bgc_fp64_turn2_vector(&relative_shift, &second->turn, &first->shift);
|
||||
|
|
@ -141,7 +141,7 @@ inline void bgc_fp64_position2_combine(BGC_FP64_Position2* combination, const BG
|
|||
|
||||
// =================== Exclude =================== //
|
||||
|
||||
inline void bgc_fp32_position2_exclude(BGC_FP32_Position2* difference, const BGC_FP32_Position2 * base, const BGC_FP32_Position2 * excludand)
|
||||
inline void bgc_fp32_position2_exclude(BGC_FP32_Position2* const difference, const BGC_FP32_Position2* const base, const BGC_FP32_Position2* const excludand)
|
||||
{
|
||||
BGC_FP32_Vector2 relative_shift;
|
||||
bgc_fp32_vector2_subtract(&relative_shift, &base->shift, &excludand->shift);
|
||||
|
|
@ -149,7 +149,7 @@ inline void bgc_fp32_position2_exclude(BGC_FP32_Position2* difference, const BGC
|
|||
bgc_fp32_turn2_exclude(&difference->turn, &base->turn, &excludand->turn);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_exclude(BGC_FP64_Position2* difference, const BGC_FP64_Position2 * base, const BGC_FP64_Position2 * excludand)
|
||||
inline void bgc_fp64_position2_exclude(BGC_FP64_Position2* const difference, const BGC_FP64_Position2* const base, const BGC_FP64_Position2* const excludand)
|
||||
{
|
||||
BGC_FP64_Vector2 relative_shift;
|
||||
bgc_fp64_vector2_subtract(&relative_shift, &base->shift, &excludand->shift);
|
||||
|
|
@ -159,13 +159,13 @@ inline void bgc_fp64_position2_exclude(BGC_FP64_Position2* difference, const BGC
|
|||
|
||||
// ============= Get Outward Affine ============== //
|
||||
|
||||
inline void bgc_fp32_position2_get_outward_affine(BGC_FP32_Affine2* outward_affine_map, const BGC_FP32_Position2 * position)
|
||||
inline void bgc_fp32_position2_get_outward_affine(BGC_FP32_Affine2* const outward_affine_map, const BGC_FP32_Position2* const position)
|
||||
{
|
||||
bgc_fp32_turn2_get_rotation_matrix(&outward_affine_map->distortion, &position->turn);
|
||||
bgc_fp32_vector2_copy(&outward_affine_map->shift, &position->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_get_outward_affine(BGC_FP64_Affine2* outward_affine_map, const BGC_FP64_Position2 * position)
|
||||
inline void bgc_fp64_position2_get_outward_affine(BGC_FP64_Affine2* const outward_affine_map, const BGC_FP64_Position2* const position)
|
||||
{
|
||||
bgc_fp64_turn2_get_rotation_matrix(&outward_affine_map->distortion, &position->turn);
|
||||
bgc_fp64_vector2_copy(&outward_affine_map->shift, &position->shift);
|
||||
|
|
@ -173,14 +173,14 @@ inline void bgc_fp64_position2_get_outward_affine(BGC_FP64_Affine2* outward_affi
|
|||
|
||||
// ============== Get Inward Affine ============== //
|
||||
|
||||
inline void bgc_fp32_position2_get_inward_affine(BGC_FP32_Affine2* inward_affine_map, const BGC_FP32_Position2 * position)
|
||||
inline void bgc_fp32_position2_get_inward_affine(BGC_FP32_Affine2* const inward_affine_map, const BGC_FP32_Position2* const position)
|
||||
{
|
||||
bgc_fp32_turn2_get_reverse_matrix(&inward_affine_map->distortion, &position->turn);
|
||||
bgc_fp32_matrix2x2_multiply_by_vector2(&inward_affine_map->shift, &inward_affine_map->distortion, &position->shift);
|
||||
bgc_fp32_vector2_revert(&inward_affine_map->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_get_inward_affine(BGC_FP64_Affine2* inward_affine_map, const BGC_FP64_Position2 * position)
|
||||
inline void bgc_fp64_position2_get_inward_affine(BGC_FP64_Affine2* const inward_affine_map, const BGC_FP64_Position2* const position)
|
||||
{
|
||||
bgc_fp64_turn2_get_reverse_matrix(&inward_affine_map->distortion, &position->turn);
|
||||
bgc_fp64_matrix2x2_multiply_by_vector2(&inward_affine_map->shift, &inward_affine_map->distortion, &position->shift);
|
||||
|
|
@ -189,14 +189,14 @@ inline void bgc_fp64_position2_get_inward_affine(BGC_FP64_Affine2* inward_affine
|
|||
|
||||
// ========== Transform Point Outwards =========== //
|
||||
|
||||
inline void bgc_fp32_position2_transform_point_outwards(BGC_FP32_Vector2* outer_point, const BGC_FP32_Position2 * position, const BGC_FP32_Vector2 * inner_point)
|
||||
inline void bgc_fp32_position2_transform_point_outwards(BGC_FP32_Vector2* const outer_point, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const inner_point)
|
||||
{
|
||||
BGC_FP32_Vector2 turned_point;
|
||||
bgc_fp32_turn2_vector(&turned_point, &position->turn, inner_point);
|
||||
bgc_fp32_vector2_add(outer_point, &position->shift, &turned_point);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_transform_point_outwards(BGC_FP64_Vector2* outer_point, const BGC_FP64_Position2 * position, const BGC_FP64_Vector2 * inner_point)
|
||||
inline void bgc_fp64_position2_transform_point_outwards(BGC_FP64_Vector2* const outer_point, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const inner_point)
|
||||
{
|
||||
BGC_FP64_Vector2 turned_point;
|
||||
bgc_fp64_turn2_vector(&turned_point, &position->turn, inner_point);
|
||||
|
|
@ -205,7 +205,7 @@ inline void bgc_fp64_position2_transform_point_outwards(BGC_FP64_Vector2* outer_
|
|||
|
||||
// =========== Transform Point Inwards =========== //
|
||||
|
||||
inline void bgc_fp32_position2_transform_point_inwards(BGC_FP32_Vector2* inner_point, const BGC_FP32_Position2 * position, const BGC_FP32_Vector2 * outer_point)
|
||||
inline void bgc_fp32_position2_transform_point_inwards(BGC_FP32_Vector2* const inner_point, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const outer_point)
|
||||
{
|
||||
BGC_FP32_Vector2 relative_point;
|
||||
bgc_fp32_vector2_subtract(&relative_point, outer_point, &position->shift);
|
||||
|
|
@ -213,7 +213,7 @@ inline void bgc_fp32_position2_transform_point_inwards(BGC_FP32_Vector2* inner_p
|
|||
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_transform_point_inwards(BGC_FP64_Vector2* inner_point, const BGC_FP64_Position2 * position, const BGC_FP64_Vector2 * outer_point)
|
||||
inline void bgc_fp64_position2_transform_point_inwards(BGC_FP64_Vector2* const inner_point, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const outer_point)
|
||||
{
|
||||
BGC_FP64_Vector2 relative_point;
|
||||
bgc_fp64_vector2_subtract(&relative_point, outer_point, &position->shift);
|
||||
|
|
@ -223,24 +223,24 @@ inline void bgc_fp64_position2_transform_point_inwards(BGC_FP64_Vector2* inner_p
|
|||
|
||||
// ========== Transform Vector Outwards ========== //
|
||||
|
||||
inline void bgc_fp32_position2_transform_vector_outwards(BGC_FP32_Vector2* outer_vector, const BGC_FP32_Position2 * position, const BGC_FP32_Vector2 * inner_vector)
|
||||
inline void bgc_fp32_position2_transform_vector_outwards(BGC_FP32_Vector2* const outer_vector, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const inner_vector)
|
||||
{
|
||||
bgc_fp32_turn2_vector(outer_vector, &position->turn, inner_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_transform_vector_outwards(BGC_FP64_Vector2* outer_vector, const BGC_FP64_Position2 * position, const BGC_FP64_Vector2 * inner_vector)
|
||||
inline void bgc_fp64_position2_transform_vector_outwards(BGC_FP64_Vector2* const outer_vector, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const inner_vector)
|
||||
{
|
||||
bgc_fp64_turn2_vector(outer_vector, &position->turn, inner_vector);
|
||||
}
|
||||
|
||||
// ========== Transform Vector Inwards =========== //
|
||||
|
||||
inline void bgc_fp32_position2_transform_vector_inwards(BGC_FP32_Vector2* inner_vector, const BGC_FP32_Position2 * position, const BGC_FP32_Vector2 * outer_vector)
|
||||
inline void bgc_fp32_position2_transform_vector_inwards(BGC_FP32_Vector2* const inner_vector, const BGC_FP32_Position2* const position, const BGC_FP32_Vector2* const outer_vector)
|
||||
{
|
||||
bgc_fp32_turn2_vector_back(inner_vector, &position->turn, outer_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position2_transform_vector_inwards(BGC_FP64_Vector2* inner_vector, const BGC_FP64_Position2 * position, const BGC_FP64_Vector2 * outer_vector)
|
||||
inline void bgc_fp64_position2_transform_vector_inwards(BGC_FP64_Vector2* const inner_vector, const BGC_FP64_Position2* const position, const BGC_FP64_Vector2* const outer_vector)
|
||||
{
|
||||
bgc_fp64_turn2_vector_back(inner_vector, &position->turn, outer_vector);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,49 +1,49 @@
|
|||
#include "./position3.h"
|
||||
|
||||
extern inline void bgc_fp32_position3_reset(BGC_FP32_Position3 * node);
|
||||
extern inline void bgc_fp64_position3_reset(BGC_FP64_Position3 * node);
|
||||
extern inline void bgc_fp32_position3_reset(BGC_FP32_Position3* const node);
|
||||
extern inline void bgc_fp64_position3_reset(BGC_FP64_Position3* const node);
|
||||
|
||||
extern inline void bgc_fp32_position3_make(BGC_FP32_Position3* position, const BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* shift);
|
||||
extern inline void bgc_fp64_position3_make(BGC_FP64_Position3* position, const BGC_FP64_Turn3 * turn, const BGC_FP64_Vector3 * shift);
|
||||
extern inline void bgc_fp32_position3_make(BGC_FP32_Position3* const position, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const shift);
|
||||
extern inline void bgc_fp64_position3_make(BGC_FP64_Position3* const position, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const shift);
|
||||
|
||||
extern inline void bgc_fp32_position3_copy(BGC_FP32_Position3* destination, const BGC_FP32_Position3* source);
|
||||
extern inline void bgc_fp64_position3_copy(BGC_FP64_Position3* destination, const BGC_FP64_Position3 * source);
|
||||
extern inline void bgc_fp32_position3_copy(BGC_FP32_Position3* const destination, const BGC_FP32_Position3* const source);
|
||||
extern inline void bgc_fp64_position3_copy(BGC_FP64_Position3* const destination, const BGC_FP64_Position3* const source);
|
||||
|
||||
extern inline void bgc_fp32_position3_swap(BGC_FP32_Position3 * first, BGC_FP32_Position3 * second);
|
||||
extern inline void bgc_fp64_position3_swap(BGC_FP64_Position3 * first, BGC_FP64_Position3 * second);
|
||||
extern inline void bgc_fp32_position3_swap(BGC_FP32_Position3* const first, BGC_FP32_Position3* const second);
|
||||
extern inline void bgc_fp64_position3_swap(BGC_FP64_Position3* const first, BGC_FP64_Position3* const second);
|
||||
|
||||
extern inline void bgc_fp32_position3_convert_to_fp64(BGC_FP64_Position3* destination,const BGC_FP32_Position3 * source);
|
||||
extern inline void bgc_fp64_position3_convert_to_fp32(BGC_FP32_Position3* destination, const BGC_FP64_Position3* source);
|
||||
extern inline void bgc_fp32_position3_convert_to_fp64(BGC_FP64_Position3* const destination, const BGC_FP32_Position3* const source);
|
||||
extern inline void bgc_fp64_position3_convert_to_fp32(BGC_FP32_Position3* const destination, const BGC_FP64_Position3* const source);
|
||||
|
||||
extern inline int bgc_fp32_position3_is_idle(const BGC_FP32_Position3 * position);
|
||||
extern inline int bgc_fp64_position3_is_idle(const BGC_FP64_Position3 * position);
|
||||
extern inline int bgc_fp32_position3_is_idle(const BGC_FP32_Position3* const position);
|
||||
extern inline int bgc_fp64_position3_is_idle(const BGC_FP64_Position3* const position);
|
||||
|
||||
extern inline void bgc_fp32_position3_invert(BGC_FP32_Position3 * position);
|
||||
extern inline void bgc_fp64_position3_invert(BGC_FP64_Position3 * position);
|
||||
extern inline void bgc_fp32_position3_invert(BGC_FP32_Position3* const position);
|
||||
extern inline void bgc_fp64_position3_invert(BGC_FP64_Position3* const position);
|
||||
|
||||
extern inline void bgc_fp32_position3_get_inverse(BGC_FP32_Position3* inverse, const BGC_FP32_Position3* position);
|
||||
extern inline void bgc_fp64_position3_get_inverse(BGC_FP64_Position3* inverse, const BGC_FP64_Position3 * position);
|
||||
extern inline void bgc_fp32_position3_get_inverse(BGC_FP32_Position3* const inverse, const BGC_FP32_Position3* const position);
|
||||
extern inline void bgc_fp64_position3_get_inverse(BGC_FP64_Position3* const inverse, const BGC_FP64_Position3* const position);
|
||||
|
||||
extern inline void bgc_fp32_position3_combine(BGC_FP32_Position3* combination, const BGC_FP32_Position3* first, const BGC_FP32_Position3* second);
|
||||
extern inline void bgc_fp64_position3_combine(BGC_FP64_Position3* combination, const BGC_FP64_Position3 * first, const BGC_FP64_Position3 * second);
|
||||
extern inline void bgc_fp32_position3_combine(BGC_FP32_Position3* const combination, const BGC_FP32_Position3* const first, const BGC_FP32_Position3* const second);
|
||||
extern inline void bgc_fp64_position3_combine(BGC_FP64_Position3* const combination, const BGC_FP64_Position3* const first, const BGC_FP64_Position3* const second);
|
||||
|
||||
extern inline void bgc_fp32_position3_exclude(BGC_FP32_Position3* difference, const BGC_FP32_Position3* base, const BGC_FP32_Position3* excludant);
|
||||
extern inline void bgc_fp64_position3_exclude(BGC_FP64_Position3* difference, const BGC_FP64_Position3 * base, const BGC_FP64_Position3 * excludant);
|
||||
extern inline void bgc_fp32_position3_exclude(BGC_FP32_Position3* const difference, const BGC_FP32_Position3* const base, const BGC_FP32_Position3* const excludant);
|
||||
extern inline void bgc_fp64_position3_exclude(BGC_FP64_Position3* const difference, const BGC_FP64_Position3* const base, const BGC_FP64_Position3* const excludant);
|
||||
|
||||
extern inline void bgc_fp32_position3_get_outward_affine(BGC_FP32_Affine3* outward_affine_map, const BGC_FP32_Position3* position);
|
||||
extern inline void bgc_fp64_position3_get_outward_affine(BGC_FP64_Affine3* outward_affine_map, const BGC_FP64_Position3 * position);
|
||||
extern inline void bgc_fp32_position3_get_outward_affine(BGC_FP32_Affine3* const outward_affine_map, const BGC_FP32_Position3* const position);
|
||||
extern inline void bgc_fp64_position3_get_outward_affine(BGC_FP64_Affine3* const outward_affine_map, const BGC_FP64_Position3* const position);
|
||||
|
||||
extern inline void bgc_fp32_position3_get_inward_affine(BGC_FP32_Affine3* inward_affine_map, const BGC_FP32_Position3* position);
|
||||
extern inline void bgc_fp64_position3_get_inward_affine(BGC_FP64_Affine3* inward_affine_map, const BGC_FP64_Position3 * position);
|
||||
extern inline void bgc_fp32_position3_get_inward_affine(BGC_FP32_Affine3* const inward_affine_map, const BGC_FP32_Position3* const position);
|
||||
extern inline void bgc_fp64_position3_get_inward_affine(BGC_FP64_Affine3* const inward_affine_map, const BGC_FP64_Position3* const position);
|
||||
|
||||
extern inline void bgc_fp32_position3_transform_point_outwards(BGC_FP32_Vector3* outer_point, const BGC_FP32_Position3* position, const BGC_FP32_Vector3* inner_point);
|
||||
extern inline void bgc_fp64_position3_transform_point_outwards(BGC_FP64_Vector3* outer_point, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * inner_point);
|
||||
extern inline void bgc_fp32_position3_transform_point_outwards(BGC_FP32_Vector3* const outer_point, const BGC_FP32_Position3* const position, const BGC_FP32_Vector3* const inner_point);
|
||||
extern inline void bgc_fp64_position3_transform_point_outwards(BGC_FP64_Vector3* const outer_point, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const inner_point);
|
||||
|
||||
extern inline void bgc_fp32_position3_transform_point_inwards(BGC_FP32_Vector3* inner_point, const BGC_FP32_Position3* position, const BGC_FP32_Vector3* outer_point);
|
||||
extern inline void bgc_fp64_position3_transform_point_inwards(BGC_FP64_Vector3* inner_point, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * outer_point);
|
||||
extern inline void bgc_fp32_position3_transform_point_inwards(BGC_FP32_Vector3* const inner_point, const BGC_FP32_Position3* const position, const BGC_FP32_Vector3* const outer_point);
|
||||
extern inline void bgc_fp64_position3_transform_point_inwards(BGC_FP64_Vector3* const inner_point, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const outer_point);
|
||||
|
||||
extern inline void bgc_fp32_position3_transform_vector_outwards(BGC_FP32_Vector3* outer_vector, const BGC_FP32_Position3* position, const BGC_FP32_Vector3* inner_vector);
|
||||
extern inline void bgc_fp64_position3_transform_vector_outwards(BGC_FP64_Vector3* outer_vector, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * inner_vector);
|
||||
extern inline void bgc_fp32_position3_transform_vector_outwards(BGC_FP32_Vector3* const outer_vector, const BGC_FP32_Position3* const position, const BGC_FP32_Vector3* const inner_vector);
|
||||
extern inline void bgc_fp64_position3_transform_vector_outwards(BGC_FP64_Vector3* const outer_vector, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const inner_vector);
|
||||
|
||||
extern inline void bgc_fp32_position3_transform_vector_inwards(BGC_FP32_Vector3* inner_vector, const BGC_FP32_Position3* position, const BGC_FP32_Vector3* outer_vector);
|
||||
extern inline void bgc_fp64_position3_transform_vector_inwards(BGC_FP64_Vector3* inner_vector, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * outer_vector);
|
||||
extern inline void bgc_fp32_position3_transform_vector_inwards(BGC_FP32_Vector3* const inner_vector, const BGC_FP32_Position3* const position, const BGC_FP32_Vector3* const outer_vector);
|
||||
extern inline void bgc_fp64_position3_transform_vector_inwards(BGC_FP64_Vector3* const inner_vector, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const outer_vector);
|
||||
|
|
|
|||
|
|
@ -8,13 +8,13 @@
|
|||
|
||||
// ==================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_position3_reset(BGC_FP32_Position3 * position)
|
||||
inline void bgc_fp32_position3_reset(BGC_FP32_Position3* const position)
|
||||
{
|
||||
bgc_fp32_turn3_reset(&position->turn);
|
||||
bgc_fp32_vector3_reset(&position->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_reset(BGC_FP64_Position3 * position)
|
||||
inline void bgc_fp64_position3_reset(BGC_FP64_Position3* const position)
|
||||
{
|
||||
bgc_fp64_turn3_reset(&position->turn);
|
||||
bgc_fp64_vector3_reset(&position->shift);
|
||||
|
|
@ -22,13 +22,13 @@ inline void bgc_fp64_position3_reset(BGC_FP64_Position3 * position)
|
|||
|
||||
// ==================== Make ===================== //
|
||||
|
||||
inline void bgc_fp32_position3_make(BGC_FP32_Position3* position, const BGC_FP32_Turn3 * turn, const BGC_FP32_Vector3 * shift)
|
||||
inline void bgc_fp32_position3_make(BGC_FP32_Position3* const position, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const shift)
|
||||
{
|
||||
bgc_fp32_turn3_copy(&position->turn, turn);
|
||||
bgc_fp32_vector3_copy(&position->shift, shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_make(BGC_FP64_Position3* position, const BGC_FP64_Turn3 * turn, const BGC_FP64_Vector3 * shift)
|
||||
inline void bgc_fp64_position3_make(BGC_FP64_Position3* const position, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const shift)
|
||||
{
|
||||
bgc_fp64_turn3_copy(&position->turn, turn);
|
||||
bgc_fp64_vector3_copy(&position->shift, shift);
|
||||
|
|
@ -36,13 +36,13 @@ inline void bgc_fp64_position3_make(BGC_FP64_Position3* position, const BGC_FP64
|
|||
|
||||
// ==================== Copy ===================== //
|
||||
|
||||
inline void bgc_fp32_position3_copy(BGC_FP32_Position3* destination, const BGC_FP32_Position3 * source)
|
||||
inline void bgc_fp32_position3_copy(BGC_FP32_Position3* const destination, const BGC_FP32_Position3* const source)
|
||||
{
|
||||
bgc_fp32_turn3_copy(&destination->turn, &source->turn);
|
||||
bgc_fp32_vector3_copy(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_copy(BGC_FP64_Position3* destination, const BGC_FP64_Position3 * source)
|
||||
inline void bgc_fp64_position3_copy(BGC_FP64_Position3* const destination, const BGC_FP64_Position3* const source)
|
||||
{
|
||||
bgc_fp64_turn3_copy(&destination->turn, &source->turn);
|
||||
bgc_fp64_vector3_copy(&destination->shift, &source->shift);
|
||||
|
|
@ -50,13 +50,13 @@ inline void bgc_fp64_position3_copy(BGC_FP64_Position3* destination, const BGC_F
|
|||
|
||||
// ==================== Swap ===================== //
|
||||
|
||||
inline void bgc_fp32_position3_swap(BGC_FP32_Position3 * first, BGC_FP32_Position3 * second)
|
||||
inline void bgc_fp32_position3_swap(BGC_FP32_Position3* const first, BGC_FP32_Position3* const second)
|
||||
{
|
||||
bgc_fp32_turn3_swap(&first->turn, &second->turn);
|
||||
bgc_fp32_vector3_swap(&first->shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_swap(BGC_FP64_Position3 * first, BGC_FP64_Position3 * second)
|
||||
inline void bgc_fp64_position3_swap(BGC_FP64_Position3* const first, BGC_FP64_Position3* const second)
|
||||
{
|
||||
bgc_fp64_turn3_swap(&first->turn, &second->turn);
|
||||
bgc_fp64_vector3_swap(&first->shift, &second->shift);
|
||||
|
|
@ -64,13 +64,13 @@ inline void bgc_fp64_position3_swap(BGC_FP64_Position3 * first, BGC_FP64_Positio
|
|||
|
||||
// =================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_position3_convert_to_fp64(BGC_FP64_Position3* destination, const BGC_FP32_Position3 * source)
|
||||
inline void bgc_fp32_position3_convert_to_fp64(BGC_FP64_Position3* const destination, const BGC_FP32_Position3* const source)
|
||||
{
|
||||
bgc_fp32_turn3_convert_to_fp64(&destination->turn, &source->turn);
|
||||
bgc_fp32_vector3_convert_to_fp64(&destination->shift, &source->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_convert_to_fp32(BGC_FP32_Position3* destination, const BGC_FP64_Position3* source)
|
||||
inline void bgc_fp64_position3_convert_to_fp32(BGC_FP32_Position3* const destination, const BGC_FP64_Position3* const source)
|
||||
{
|
||||
bgc_fp64_turn3_convert_to_fp32(&destination->turn, &source->turn);
|
||||
bgc_fp64_vector3_convert_to_fp32(&destination->shift, &source->shift);
|
||||
|
|
@ -78,26 +78,26 @@ inline void bgc_fp64_position3_convert_to_fp32(BGC_FP32_Position3* destination,
|
|||
|
||||
// =================== Is Idle =================== //
|
||||
|
||||
inline int bgc_fp32_position3_is_idle(const BGC_FP32_Position3 * position)
|
||||
inline int bgc_fp32_position3_is_idle(const BGC_FP32_Position3* const position)
|
||||
{
|
||||
return bgc_fp32_vector3_is_zero(&position->shift) && bgc_fp32_turn3_is_idle(&position->turn);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_position3_is_idle(const BGC_FP64_Position3 * position)
|
||||
inline int bgc_fp64_position3_is_idle(const BGC_FP64_Position3* const position)
|
||||
{
|
||||
return bgc_fp64_vector3_is_zero(&position->shift) && bgc_fp64_turn3_is_idle(&position->turn);
|
||||
}
|
||||
|
||||
// =================== Invert ==================== //
|
||||
|
||||
inline void bgc_fp32_position3_invert(BGC_FP32_Position3 * position)
|
||||
inline void bgc_fp32_position3_invert(BGC_FP32_Position3* const position)
|
||||
{
|
||||
bgc_fp32_turn3_vector_back(&position->shift, &position->turn, &position->shift);
|
||||
bgc_fp32_turn3_revert(&position->turn);
|
||||
bgc_fp32_vector3_revert(&position->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_invert(BGC_FP64_Position3 * position)
|
||||
inline void bgc_fp64_position3_invert(BGC_FP64_Position3* const position)
|
||||
{
|
||||
bgc_fp64_turn3_vector_back(&position->shift, &position->turn, &position->shift);
|
||||
bgc_fp64_turn3_revert(&position->turn);
|
||||
|
|
@ -106,14 +106,14 @@ inline void bgc_fp64_position3_invert(BGC_FP64_Position3 * position)
|
|||
|
||||
// ================= Get Inverse ================= //
|
||||
|
||||
inline void bgc_fp32_position3_get_inverse(BGC_FP32_Position3* inverse, const BGC_FP32_Position3 * position)
|
||||
inline void bgc_fp32_position3_get_inverse(BGC_FP32_Position3* const inverse, const BGC_FP32_Position3* const position)
|
||||
{
|
||||
bgc_fp32_turn3_vector_back(&inverse->shift, &position->turn, &position->shift);
|
||||
bgc_fp32_turn3_get_reverse(&inverse->turn, &position->turn);
|
||||
bgc_fp32_vector3_revert(&inverse->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_get_inverse(BGC_FP64_Position3* inverse, const BGC_FP64_Position3 * position)
|
||||
inline void bgc_fp64_position3_get_inverse(BGC_FP64_Position3* const inverse, const BGC_FP64_Position3* const position)
|
||||
{
|
||||
bgc_fp64_turn3_vector_back(&inverse->shift, &position->turn, &position->shift);
|
||||
bgc_fp64_turn3_get_reverse(&inverse->turn, &position->turn);
|
||||
|
|
@ -122,7 +122,7 @@ inline void bgc_fp64_position3_get_inverse(BGC_FP64_Position3* inverse, const BG
|
|||
|
||||
// =================== Combine =================== //
|
||||
|
||||
inline void bgc_fp32_position3_combine(BGC_FP32_Position3* combination, const BGC_FP32_Position3 * first, const BGC_FP32_Position3 * second)
|
||||
inline void bgc_fp32_position3_combine(BGC_FP32_Position3* const combination, const BGC_FP32_Position3* const first, const BGC_FP32_Position3* const second)
|
||||
{
|
||||
BGC_FP32_Vector3 relative_shift;
|
||||
bgc_fp32_turn3_vector(&relative_shift, &second->turn, &first->shift);
|
||||
|
|
@ -130,7 +130,7 @@ inline void bgc_fp32_position3_combine(BGC_FP32_Position3* combination, const BG
|
|||
bgc_fp32_vector3_add(&combination->shift, &relative_shift, &second->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_combine(BGC_FP64_Position3* combination, const BGC_FP64_Position3 * first, const BGC_FP64_Position3 * second)
|
||||
inline void bgc_fp64_position3_combine(BGC_FP64_Position3* const combination, const BGC_FP64_Position3* const first, const BGC_FP64_Position3* const second)
|
||||
{
|
||||
BGC_FP64_Vector3 relative_shift;
|
||||
bgc_fp64_turn3_vector(&relative_shift, &second->turn, &first->shift);
|
||||
|
|
@ -140,7 +140,7 @@ inline void bgc_fp64_position3_combine(BGC_FP64_Position3* combination, const BG
|
|||
|
||||
// =================== Exclude =================== //
|
||||
|
||||
inline void bgc_fp32_position3_exclude(BGC_FP32_Position3* difference, const BGC_FP32_Position3 * base, const BGC_FP32_Position3 * excludant)
|
||||
inline void bgc_fp32_position3_exclude(BGC_FP32_Position3* const difference, const BGC_FP32_Position3* const base, const BGC_FP32_Position3* const excludant)
|
||||
{
|
||||
BGC_FP32_Vector3 relative_shift;
|
||||
bgc_fp32_vector3_subtract(&relative_shift, &base->shift, &excludant->shift);
|
||||
|
|
@ -148,7 +148,7 @@ inline void bgc_fp32_position3_exclude(BGC_FP32_Position3* difference, const BGC
|
|||
bgc_fp32_turn3_exclude(&difference->turn, &base->turn, &excludant->turn);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_exclude(BGC_FP64_Position3* difference, const BGC_FP64_Position3 * base, const BGC_FP64_Position3 * excludant)
|
||||
inline void bgc_fp64_position3_exclude(BGC_FP64_Position3* const difference, const BGC_FP64_Position3* const base, const BGC_FP64_Position3* const excludant)
|
||||
{
|
||||
BGC_FP64_Vector3 relative_shift;
|
||||
bgc_fp64_vector3_subtract(&relative_shift, &base->shift, &excludant->shift);
|
||||
|
|
@ -158,13 +158,13 @@ inline void bgc_fp64_position3_exclude(BGC_FP64_Position3* difference, const BGC
|
|||
|
||||
// ============= Get Outward Affine ============== //
|
||||
|
||||
inline void bgc_fp32_position3_get_outward_affine(BGC_FP32_Affine3* outward_affine_map, const BGC_FP32_Position3 * position)
|
||||
inline void bgc_fp32_position3_get_outward_affine(BGC_FP32_Affine3* const outward_affine_map, const BGC_FP32_Position3* const position)
|
||||
{
|
||||
bgc_fp32_turn3_get_rotation_matrix(&outward_affine_map->distortion, &position->turn);
|
||||
bgc_fp32_vector3_copy(&outward_affine_map->shift, &position->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_get_outward_affine(BGC_FP64_Affine3* outward_affine_map, const BGC_FP64_Position3 * position)
|
||||
inline void bgc_fp64_position3_get_outward_affine(BGC_FP64_Affine3* const outward_affine_map, const BGC_FP64_Position3* const position)
|
||||
{
|
||||
bgc_fp64_turn3_get_rotation_matrix(&outward_affine_map->distortion, &position->turn);
|
||||
bgc_fp64_vector3_copy(&outward_affine_map->shift, &position->shift);
|
||||
|
|
@ -172,14 +172,14 @@ inline void bgc_fp64_position3_get_outward_affine(BGC_FP64_Affine3* outward_affi
|
|||
|
||||
// ============== Get Inward Affine ============== //
|
||||
|
||||
inline void bgc_fp32_position3_get_inward_affine(BGC_FP32_Affine3* inward_affine_map, const BGC_FP32_Position3 * position)
|
||||
inline void bgc_fp32_position3_get_inward_affine(BGC_FP32_Affine3* const inward_affine_map, const BGC_FP32_Position3* const position)
|
||||
{
|
||||
bgc_fp32_turn3_get_reverse_matrix(&inward_affine_map->distortion, &position->turn);
|
||||
bgc_fp32_matrix3x3_multiply_by_vector3(&inward_affine_map->shift, &inward_affine_map->distortion, &position->shift);
|
||||
bgc_fp32_vector3_revert(&inward_affine_map->shift);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_get_inward_affine(BGC_FP64_Affine3* inward_affine_map, const BGC_FP64_Position3 * position)
|
||||
inline void bgc_fp64_position3_get_inward_affine(BGC_FP64_Affine3* const inward_affine_map, const BGC_FP64_Position3* const position)
|
||||
{
|
||||
bgc_fp64_turn3_get_reverse_matrix(&inward_affine_map->distortion, &position->turn);
|
||||
bgc_fp64_matrix3x3_multiply_by_vector3(&inward_affine_map->shift, &inward_affine_map->distortion, &position->shift);
|
||||
|
|
@ -188,14 +188,14 @@ inline void bgc_fp64_position3_get_inward_affine(BGC_FP64_Affine3* inward_affine
|
|||
|
||||
// ========== Transform Point Outwards =========== //
|
||||
|
||||
inline void bgc_fp32_position3_transform_point_outwards(BGC_FP32_Vector3* outer_point, const BGC_FP32_Position3 * position, const BGC_FP32_Vector3 * inner_point)
|
||||
inline void bgc_fp32_position3_transform_point_outwards(BGC_FP32_Vector3* const outer_point, const BGC_FP32_Position3* const position, const BGC_FP32_Vector3* const inner_point)
|
||||
{
|
||||
BGC_FP32_Vector3 turned_point;
|
||||
bgc_fp32_turn3_vector(&turned_point, &position->turn, inner_point);
|
||||
bgc_fp32_vector3_add(outer_point, &position->shift, &turned_point);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_transform_point_outwards(BGC_FP64_Vector3* outer_point, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * inner_point)
|
||||
inline void bgc_fp64_position3_transform_point_outwards(BGC_FP64_Vector3* const outer_point, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const inner_point)
|
||||
{
|
||||
BGC_FP64_Vector3 turned_point;
|
||||
bgc_fp64_turn3_vector(&turned_point, &position->turn, inner_point);
|
||||
|
|
@ -204,7 +204,7 @@ inline void bgc_fp64_position3_transform_point_outwards(BGC_FP64_Vector3* outer_
|
|||
|
||||
// =========== Transform Point Inwards =========== //
|
||||
|
||||
inline void bgc_fp32_position3_transform_point_inwards(BGC_FP32_Vector3* inner_point, const BGC_FP32_Position3 * position, const BGC_FP32_Vector3 * outer_point)
|
||||
inline void bgc_fp32_position3_transform_point_inwards(BGC_FP32_Vector3* const inner_point, const BGC_FP32_Position3 * const position, const BGC_FP32_Vector3 * const outer_point)
|
||||
{
|
||||
BGC_FP32_Vector3 relative_point;
|
||||
bgc_fp32_vector3_subtract(&relative_point, outer_point, &position->shift);
|
||||
|
|
@ -212,7 +212,7 @@ inline void bgc_fp32_position3_transform_point_inwards(BGC_FP32_Vector3* inner_p
|
|||
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_transform_point_inwards(BGC_FP64_Vector3* inner_point, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * outer_point)
|
||||
inline void bgc_fp64_position3_transform_point_inwards(BGC_FP64_Vector3* const inner_point, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const outer_point)
|
||||
{
|
||||
BGC_FP64_Vector3 relative_point;
|
||||
bgc_fp64_vector3_subtract(&relative_point, outer_point, &position->shift);
|
||||
|
|
@ -222,24 +222,24 @@ inline void bgc_fp64_position3_transform_point_inwards(BGC_FP64_Vector3* inner_p
|
|||
|
||||
// ========== Transform Vector Outwards ========== //
|
||||
|
||||
inline void bgc_fp32_position3_transform_vector_outwards(BGC_FP32_Vector3* outer_vector, const BGC_FP32_Position3 * position, const BGC_FP32_Vector3 * inner_vector)
|
||||
inline void bgc_fp32_position3_transform_vector_outwards(BGC_FP32_Vector3* const outer_vector, const BGC_FP32_Position3* const position, const BGC_FP32_Vector3* const inner_vector)
|
||||
{
|
||||
bgc_fp32_turn3_vector(outer_vector, &position->turn, inner_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_transform_vector_outwards(BGC_FP64_Vector3* outer_vector, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * inner_vector)
|
||||
inline void bgc_fp64_position3_transform_vector_outwards(BGC_FP64_Vector3* const outer_vector, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const inner_vector)
|
||||
{
|
||||
bgc_fp64_turn3_vector(outer_vector, &position->turn, inner_vector);
|
||||
}
|
||||
|
||||
// ========== Transform Vector Inwards =========== //
|
||||
|
||||
inline void bgc_fp32_position3_transform_vector_inwards(BGC_FP32_Vector3* inner_vector, const BGC_FP32_Position3 * position, const BGC_FP32_Vector3 * outer_vector)
|
||||
inline void bgc_fp32_position3_transform_vector_inwards(BGC_FP32_Vector3* const inner_vector, const BGC_FP32_Position3* const position, const BGC_FP32_Vector3* const outer_vector)
|
||||
{
|
||||
bgc_fp32_turn3_vector_back(inner_vector, &position->turn, outer_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_position3_transform_vector_inwards(BGC_FP64_Vector3* inner_vector, const BGC_FP64_Position3 * position, const BGC_FP64_Vector3 * outer_vector)
|
||||
inline void bgc_fp64_position3_transform_vector_inwards(BGC_FP64_Vector3* const inner_vector, const BGC_FP64_Position3* const position, const BGC_FP64_Vector3* const outer_vector)
|
||||
{
|
||||
bgc_fp64_turn3_vector_back(inner_vector, &position->turn, outer_vector);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,27 @@
|
|||
#include "./slerp3.h"
|
||||
|
||||
extern inline void bgc_fp32_slerp3_reset(BGC_FP32_Slerp3* slerp);
|
||||
extern inline void bgc_fp64_slerp3_reset(BGC_FP64_Slerp3* slerp);
|
||||
extern inline void bgc_fp32_slerp3_reset(BGC_FP32_Slerp3* const slerp);
|
||||
extern inline void bgc_fp64_slerp3_reset(BGC_FP64_Slerp3* const slerp);
|
||||
|
||||
extern inline void bgc_fp32_slerp3_make_full(BGC_FP32_Slerp3* slerp, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* end);
|
||||
extern inline void bgc_fp64_slerp3_make_full(BGC_FP64_Slerp3* slerp, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* end);
|
||||
extern inline void bgc_fp32_slerp3_make_full(BGC_FP32_Slerp3* const slerp, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const end);
|
||||
extern inline void bgc_fp64_slerp3_make_full(BGC_FP64_Slerp3* const slerp, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const end);
|
||||
|
||||
extern inline void bgc_fp32_slerp3_make_shortened(BGC_FP32_Slerp3* slerp, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* end);
|
||||
extern inline void bgc_fp64_slerp3_make_shortened(BGC_FP64_Slerp3* slerp, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* end);
|
||||
extern inline void bgc_fp32_slerp3_make_shortened(BGC_FP32_Slerp3* const slerp, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const end);
|
||||
extern inline void bgc_fp64_slerp3_make_shortened(BGC_FP64_Slerp3* const slerp, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const end);
|
||||
|
||||
extern inline void bgc_fp32_slerp3_get_phase_turn(BGC_FP32_Turn3* versor, const BGC_FP32_Slerp3* slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_turn(BGC_FP64_Turn3* versor, const BGC_FP64_Slerp3* slerp, const double phase);
|
||||
extern inline void bgc_fp32_slerp3_get_phase_turn(BGC_FP32_Turn3* const versor, const BGC_FP32_Slerp3* const slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_turn(BGC_FP64_Turn3* const versor, const BGC_FP64_Slerp3* const slerp, const double phase);
|
||||
|
||||
extern inline void bgc_fp32_slerp3_get_phase_rotation_matrix(BGC_FP32_Matrix3x3* rotation_matrix, const BGC_FP32_Slerp3* slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_rotation_matrix(BGC_FP64_Matrix3x3* rotation_matrix, const BGC_FP64_Slerp3* slerp, const double phase);
|
||||
extern inline void bgc_fp32_slerp3_get_phase_rotation_matrix(BGC_FP32_Matrix3x3* const rotation_matrix, const BGC_FP32_Slerp3* const slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_rotation_matrix(BGC_FP64_Matrix3x3* const rotation_matrix, const BGC_FP64_Slerp3* const slerp, const double phase);
|
||||
|
||||
extern inline void bgc_fp32_slerp3_get_phase_reverse_matrix(BGC_FP32_Matrix3x3* reverse_matrix, const BGC_FP32_Slerp3* slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_rotation_matrix(BGC_FP64_Matrix3x3* reverse_matrix, const BGC_FP64_Slerp3* slerp, const double phase);
|
||||
extern inline void bgc_fp32_slerp3_get_phase_reverse_matrix(BGC_FP32_Matrix3x3* const reverse_matrix, const BGC_FP32_Slerp3* const slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_reverse_matrix(BGC_FP64_Matrix3x3* const reverse_matrix, const BGC_FP64_Slerp3* const slerp, const double phase);
|
||||
|
||||
extern inline void bgc_fp32_slerp3_get_phase_both_matrices(BGC_FP32_Matrix3x3* rotation_matrix, BGC_FP32_Matrix3x3* reverse_matrix, const BGC_FP32_Slerp3* slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_both_matrices(BGC_FP64_Matrix3x3* rotation_matrix, BGC_FP64_Matrix3x3* reverse_matrix, const BGC_FP64_Slerp3* slerp, const double phase);
|
||||
extern inline void bgc_fp32_slerp3_get_phase_both_matrices(BGC_FP32_Matrix3x3* const rotation_matrix, BGC_FP32_Matrix3x3* const reverse_matrix, const BGC_FP32_Slerp3* const slerp, const float phase);
|
||||
extern inline void bgc_fp64_slerp3_get_phase_both_matrices(BGC_FP64_Matrix3x3* const rotation_matrix, BGC_FP64_Matrix3x3* const reverse_matrix, const BGC_FP64_Slerp3* const slerp, const double phase);
|
||||
|
||||
void bgc_fp32_slerp3_make(BGC_FP32_Slerp3* slerp, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* augment)
|
||||
void bgc_fp32_slerp3_make(BGC_FP32_Slerp3* const slerp, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const augment)
|
||||
{
|
||||
const float square_vector = augment->_versor.x1 * augment->_versor.x1 + augment->_versor.x2 * augment->_versor.x2 + augment->_versor.x3 * augment->_versor.x3;
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ void bgc_fp32_slerp3_make(BGC_FP32_Slerp3* slerp, const BGC_FP32_Turn3* start, c
|
|||
slerp->_sine_weight.x3 = multiplier * (augment->_versor.x3 * start->_versor.s0 - augment->_versor.x2 * start->_versor.x1 + augment->_versor.x1 * start->_versor.x2);
|
||||
}
|
||||
|
||||
void bgc_fp64_slerp3_make(BGC_FP64_Slerp3* slerp, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* augment)
|
||||
void bgc_fp64_slerp3_make(BGC_FP64_Slerp3* const slerp, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const augment)
|
||||
{
|
||||
const double square_vector = augment->_versor.x1 * augment->_versor.x1 + augment->_versor.x2 * augment->_versor.x2 + augment->_versor.x3 * augment->_versor.x3;
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_slerp3_reset(BGC_FP32_Slerp3* slerp)
|
||||
inline void bgc_fp32_slerp3_reset(BGC_FP32_Slerp3* const slerp)
|
||||
{
|
||||
slerp->_cosine_weight.s0 = 1.0f;
|
||||
slerp->_cosine_weight.x1 = 0.0f;
|
||||
|
|
@ -22,7 +22,7 @@ inline void bgc_fp32_slerp3_reset(BGC_FP32_Slerp3* slerp)
|
|||
slerp->radians = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_slerp3_reset(BGC_FP64_Slerp3* slerp)
|
||||
inline void bgc_fp64_slerp3_reset(BGC_FP64_Slerp3* const slerp)
|
||||
{
|
||||
slerp->_cosine_weight.s0 = 1.0;
|
||||
slerp->_cosine_weight.x1 = 0.0;
|
||||
|
|
@ -39,12 +39,12 @@ inline void bgc_fp64_slerp3_reset(BGC_FP64_Slerp3* slerp)
|
|||
|
||||
// ==================== Make ==================== //
|
||||
|
||||
void bgc_fp32_slerp3_make(BGC_FP32_Slerp3* slerp, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* augment);
|
||||
void bgc_fp64_slerp3_make(BGC_FP64_Slerp3* slerp, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* augment);
|
||||
void bgc_fp32_slerp3_make(BGC_FP32_Slerp3* const slerp, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const augment);
|
||||
void bgc_fp64_slerp3_make(BGC_FP64_Slerp3* const slerp, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const augment);
|
||||
|
||||
// ================= Make Full ================== //
|
||||
|
||||
inline void bgc_fp32_slerp3_make_full(BGC_FP32_Slerp3* slerp, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* end)
|
||||
inline void bgc_fp32_slerp3_make_full(BGC_FP32_Slerp3* const slerp, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const end)
|
||||
{
|
||||
BGC_FP32_Turn3 augment;
|
||||
|
||||
|
|
@ -53,7 +53,7 @@ inline void bgc_fp32_slerp3_make_full(BGC_FP32_Slerp3* slerp, const BGC_FP32_Tur
|
|||
bgc_fp32_slerp3_make(slerp, start, &augment);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_slerp3_make_full(BGC_FP64_Slerp3* slerp, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* end)
|
||||
inline void bgc_fp64_slerp3_make_full(BGC_FP64_Slerp3* const slerp, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const end)
|
||||
{
|
||||
BGC_FP64_Turn3 augment;
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ inline void bgc_fp64_slerp3_make_full(BGC_FP64_Slerp3* slerp, const BGC_FP64_Tur
|
|||
|
||||
// =============== Make Shortened =============== //
|
||||
|
||||
inline void bgc_fp32_slerp3_make_shortened(BGC_FP32_Slerp3* slerp, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* end)
|
||||
inline void bgc_fp32_slerp3_make_shortened(BGC_FP32_Slerp3* const slerp, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const end)
|
||||
{
|
||||
BGC_FP32_Turn3 augment;
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ inline void bgc_fp32_slerp3_make_shortened(BGC_FP32_Slerp3* slerp, const BGC_FP3
|
|||
bgc_fp32_slerp3_make(slerp, start, &augment);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_slerp3_make_shortened(BGC_FP64_Slerp3* slerp, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* end)
|
||||
inline void bgc_fp64_slerp3_make_shortened(BGC_FP64_Slerp3* const slerp, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const end)
|
||||
{
|
||||
BGC_FP64_Turn3 augment;
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ inline void bgc_fp64_slerp3_make_shortened(BGC_FP64_Slerp3* slerp, const BGC_FP6
|
|||
|
||||
// =============== Get Phase Turn =============== //
|
||||
|
||||
inline void bgc_fp32_slerp3_get_phase_turn(BGC_FP32_Turn3* turn, const BGC_FP32_Slerp3* slerp, const float phase)
|
||||
inline void bgc_fp32_slerp3_get_phase_turn(BGC_FP32_Turn3* const turn, const BGC_FP32_Slerp3* const slerp, const float phase)
|
||||
{
|
||||
const float angle = slerp->radians * phase;
|
||||
const float cosine = cosf(angle);
|
||||
|
|
@ -100,7 +100,7 @@ inline void bgc_fp32_slerp3_get_phase_turn(BGC_FP32_Turn3* turn, const BGC_FP32_
|
|||
bgc_fp32_turn3_set_quaternion(turn, &q);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_slerp3_get_phase_turn(BGC_FP64_Turn3* turn, const BGC_FP64_Slerp3* slerp, const double phase)
|
||||
inline void bgc_fp64_slerp3_get_phase_turn(BGC_FP64_Turn3* const turn, const BGC_FP64_Slerp3* const slerp, const double phase)
|
||||
{
|
||||
const double angle = slerp->radians * phase;
|
||||
const double cosine = cos(angle);
|
||||
|
|
@ -116,7 +116,7 @@ inline void bgc_fp64_slerp3_get_phase_turn(BGC_FP64_Turn3* turn, const BGC_FP64_
|
|||
|
||||
// ========= Get Phase Rotation Matrix ========== //
|
||||
|
||||
inline void bgc_fp32_slerp3_get_phase_rotation_matrix(BGC_FP32_Matrix3x3* rotation_matrix, const BGC_FP32_Slerp3* slerp, const float phase)
|
||||
inline void bgc_fp32_slerp3_get_phase_rotation_matrix(BGC_FP32_Matrix3x3* const rotation_matrix, const BGC_FP32_Slerp3* const slerp, const float phase)
|
||||
{
|
||||
const float angle = slerp->radians * phase;
|
||||
const float cosine = cosf(angle);
|
||||
|
|
@ -130,7 +130,7 @@ inline void bgc_fp32_slerp3_get_phase_rotation_matrix(BGC_FP32_Matrix3x3* rotati
|
|||
bgc_fp32_quaternion_get_rotation_matrix(rotation_matrix, &q);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_slerp3_get_phase_rotation_matrix(BGC_FP64_Matrix3x3* rotation_matrix, const BGC_FP64_Slerp3* slerp, const double phase)
|
||||
inline void bgc_fp64_slerp3_get_phase_rotation_matrix(BGC_FP64_Matrix3x3* const rotation_matrix, const BGC_FP64_Slerp3* const slerp, const double phase)
|
||||
{
|
||||
const double angle = slerp->radians * phase;
|
||||
const double cosine = cos(angle);
|
||||
|
|
@ -146,7 +146,7 @@ inline void bgc_fp64_slerp3_get_phase_rotation_matrix(BGC_FP64_Matrix3x3* rotati
|
|||
|
||||
// ========== Get Phase Reverse Matrix ========== //
|
||||
|
||||
inline void bgc_fp32_slerp3_get_phase_reverse_matrix(BGC_FP32_Matrix3x3* reverse_matrix, const BGC_FP32_Slerp3* slerp, const float phase)
|
||||
inline void bgc_fp32_slerp3_get_phase_reverse_matrix(BGC_FP32_Matrix3x3* const reverse_matrix, const BGC_FP32_Slerp3* const slerp, const float phase)
|
||||
{
|
||||
const float angle = slerp->radians * phase;
|
||||
const float cosine = cosf(angle);
|
||||
|
|
@ -160,7 +160,7 @@ inline void bgc_fp32_slerp3_get_phase_reverse_matrix(BGC_FP32_Matrix3x3* reverse
|
|||
bgc_fp32_quaternion_get_reverse_matrix(reverse_matrix, &q);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_slerp3_get_phase_reverse_matrix(BGC_FP64_Matrix3x3* reverse_matrix, const BGC_FP64_Slerp3* slerp, const double phase)
|
||||
inline void bgc_fp64_slerp3_get_phase_reverse_matrix(BGC_FP64_Matrix3x3* const reverse_matrix, const BGC_FP64_Slerp3* const slerp, const double phase)
|
||||
{
|
||||
const double angle = slerp->radians * phase;
|
||||
const double cosine = cos(angle);
|
||||
|
|
@ -176,7 +176,7 @@ inline void bgc_fp64_slerp3_get_phase_reverse_matrix(BGC_FP64_Matrix3x3* reverse
|
|||
|
||||
// ========== Get Phase Both Matrices =========== //
|
||||
|
||||
inline void bgc_fp32_slerp3_get_phase_both_matrices(BGC_FP32_Matrix3x3* rotation_matrix, BGC_FP32_Matrix3x3* reverse_matrix, const BGC_FP32_Slerp3* slerp, const float phase)
|
||||
inline void bgc_fp32_slerp3_get_phase_both_matrices(BGC_FP32_Matrix3x3* const rotation_matrix, BGC_FP32_Matrix3x3* const reverse_matrix, const BGC_FP32_Slerp3* const slerp, const float phase)
|
||||
{
|
||||
const float angle = slerp->radians * phase;
|
||||
const float cosine = cosf(angle);
|
||||
|
|
@ -190,7 +190,7 @@ inline void bgc_fp32_slerp3_get_phase_both_matrices(BGC_FP32_Matrix3x3* rotation
|
|||
bgc_fp32_quaternion_get_both_matrices(rotation_matrix, reverse_matrix, &q);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_slerp3_get_phase_both_matrices(BGC_FP64_Matrix3x3* rotation_matrix, BGC_FP64_Matrix3x3* reverse_matrix, const BGC_FP64_Slerp3* slerp, const double phase)
|
||||
inline void bgc_fp64_slerp3_get_phase_both_matrices(BGC_FP64_Matrix3x3* const rotation_matrix, BGC_FP64_Matrix3x3* const reverse_matrix, const BGC_FP64_Slerp3* const slerp, const double phase)
|
||||
{
|
||||
const double angle = slerp->radians * phase;
|
||||
const double cosine = cos(angle);
|
||||
|
|
|
|||
|
|
@ -4,61 +4,61 @@ const BGC_FP32_Turn2 BGC_FP32_IDLE_TURN2 = { 1.0f, 0.0f };
|
|||
|
||||
const BGC_FP64_Turn2 BGC_FP64_IDLE_TURN2 = { 1.0, 0.0 };
|
||||
|
||||
extern inline void bgc_fp32_turn2_reset(BGC_FP32_Turn2* turn);
|
||||
extern inline void bgc_fp64_turn2_reset(BGC_FP64_Turn2* turn);
|
||||
extern inline void bgc_fp32_turn2_reset(BGC_FP32_Turn2* const turn);
|
||||
extern inline void bgc_fp64_turn2_reset(BGC_FP64_Turn2* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn2_make(BGC_FP32_Turn2* turn, const float x1, const float x2);
|
||||
extern inline void bgc_fp64_turn2_make(BGC_FP64_Turn2* turn, const double x1, const double x2);
|
||||
extern inline void bgc_fp32_turn2_make(BGC_FP32_Turn2* const turn, const float x1, const float x2);
|
||||
extern inline void bgc_fp64_turn2_make(BGC_FP64_Turn2* const turn, const double x1, const double x2);
|
||||
|
||||
extern inline void bgc_fp32_turn2_make_for_angle(BGC_FP32_Turn2* turn, const float angle, const int angle_unit);
|
||||
extern inline void bgc_fp64_turn2_make_for_angle(BGC_FP64_Turn2* turn, const double angle, const int angle_unit);
|
||||
extern inline void bgc_fp32_turn2_make_for_angle(BGC_FP32_Turn2* const turn, const float angle, const int angle_unit);
|
||||
extern inline void bgc_fp64_turn2_make_for_angle(BGC_FP64_Turn2* const turn, const double angle, const int angle_unit);
|
||||
|
||||
extern inline int bgc_fp32_turn2_is_idle(const BGC_FP32_Turn2* turn);
|
||||
extern inline int bgc_fp64_turn2_is_idle(const BGC_FP64_Turn2* turn);
|
||||
extern inline int bgc_fp32_turn2_is_idle(const BGC_FP32_Turn2* const turn);
|
||||
extern inline int bgc_fp64_turn2_is_idle(const BGC_FP64_Turn2* const turn);
|
||||
|
||||
extern inline float bgc_fp32_turn2_get_angle(const BGC_FP32_Turn2* turn, const int angle_unit);
|
||||
extern inline double bgc_fp64_turn2_get_angle(const BGC_FP64_Turn2* turn, const int angle_unit);
|
||||
extern inline float bgc_fp32_turn2_get_angle(const BGC_FP32_Turn2* const turn, const int angle_unit);
|
||||
extern inline double bgc_fp64_turn2_get_angle(const BGC_FP64_Turn2* const turn, const int angle_unit);
|
||||
|
||||
extern inline void bgc_fp32_turn2_copy(BGC_FP32_Turn2* destination, const BGC_FP32_Turn2* source);
|
||||
extern inline void bgc_fp64_turn2_copy(BGC_FP64_Turn2* destination, const BGC_FP64_Turn2* source);
|
||||
extern inline void bgc_fp32_turn2_copy(BGC_FP32_Turn2* const destination, const BGC_FP32_Turn2* const source);
|
||||
extern inline void bgc_fp64_turn2_copy(BGC_FP64_Turn2* const destination, const BGC_FP64_Turn2* const source);
|
||||
|
||||
extern inline void bgc_fp32_turn2_swap(BGC_FP32_Turn2* turn1, BGC_FP32_Turn2* turn2);
|
||||
extern inline void bgc_fp64_turn2_swap(BGC_FP64_Turn2* turn1, BGC_FP64_Turn2* turn2);
|
||||
extern inline void bgc_fp32_turn2_swap(BGC_FP32_Turn2* const turn1, BGC_FP32_Turn2* const turn2);
|
||||
extern inline void bgc_fp64_turn2_swap(BGC_FP64_Turn2* const turn1, BGC_FP64_Turn2* const turn2);
|
||||
|
||||
extern inline void bgc_fp64_turn2_convert_to_fp32(BGC_FP32_Turn2* destination, const BGC_FP64_Turn2* source);
|
||||
extern inline void bgc_fp32_turn2_convert_to_fp64(BGC_FP64_Turn2* destination, const BGC_FP32_Turn2* source);
|
||||
extern inline void bgc_fp64_turn2_convert_to_fp32(BGC_FP32_Turn2* const destination, const BGC_FP64_Turn2* const source);
|
||||
extern inline void bgc_fp32_turn2_convert_to_fp64(BGC_FP64_Turn2* const destination, const BGC_FP32_Turn2* const source);
|
||||
|
||||
extern inline void bgc_fp32_turn2_revert(BGC_FP32_Turn2* turn);
|
||||
extern inline void bgc_fp64_turn2_revert(BGC_FP64_Turn2* turn);
|
||||
extern inline void bgc_fp32_turn2_revert(BGC_FP32_Turn2* const turn);
|
||||
extern inline void bgc_fp64_turn2_revert(BGC_FP64_Turn2* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn2_get_reverse(BGC_FP32_Turn2* reverse, const BGC_FP32_Turn2* turn);
|
||||
extern inline void bgc_fp64_turn2_get_reverse(BGC_FP64_Turn2* reverse, const BGC_FP64_Turn2* turn);
|
||||
extern inline void bgc_fp32_turn2_get_reverse(BGC_FP32_Turn2* const reverse, const BGC_FP32_Turn2* const turn);
|
||||
extern inline void bgc_fp64_turn2_get_reverse(BGC_FP64_Turn2* const reverse, const BGC_FP64_Turn2* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn2_get_power(BGC_FP32_Turn2* power, const BGC_FP32_Turn2* base, const float exponent);
|
||||
extern inline void bgc_fp64_turn2_get_power(BGC_FP64_Turn2* power, const BGC_FP64_Turn2* base, const double exponent);
|
||||
extern inline void bgc_fp32_turn2_get_power(BGC_FP32_Turn2* const power, const BGC_FP32_Turn2* const base, const float exponent);
|
||||
extern inline void bgc_fp64_turn2_get_power(BGC_FP64_Turn2* const power, const BGC_FP64_Turn2* const base, const double exponent);
|
||||
|
||||
extern inline void bgc_fp32_turn2_combine(BGC_FP32_Turn2* combination, const BGC_FP32_Turn2* turn1, const BGC_FP32_Turn2* turn2);
|
||||
extern inline void bgc_fp64_turn2_combine(BGC_FP64_Turn2* combination, const BGC_FP64_Turn2* turn1, const BGC_FP64_Turn2* turn2);
|
||||
extern inline void bgc_fp32_turn2_combine(BGC_FP32_Turn2* const combination, const BGC_FP32_Turn2* const turn1, const BGC_FP32_Turn2* const turn2);
|
||||
extern inline void bgc_fp64_turn2_combine(BGC_FP64_Turn2* const combination, const BGC_FP64_Turn2* const turn1, const BGC_FP64_Turn2* const turn2);
|
||||
|
||||
extern inline void bgc_fp32_turn2_exclude(BGC_FP32_Turn2* difference, const BGC_FP32_Turn2* base, const BGC_FP32_Turn2* excludant);
|
||||
extern inline void bgc_fp64_turn2_exclude(BGC_FP64_Turn2* difference, const BGC_FP64_Turn2* base, const BGC_FP64_Turn2* excludant);
|
||||
extern inline void bgc_fp32_turn2_exclude(BGC_FP32_Turn2* const difference, const BGC_FP32_Turn2* const base, const BGC_FP32_Turn2* const excludant);
|
||||
extern inline void bgc_fp64_turn2_exclude(BGC_FP64_Turn2* const difference, const BGC_FP64_Turn2* const base, const BGC_FP64_Turn2* const excludant);
|
||||
|
||||
extern inline void bgc_fp32_turn2_get_rotation_matrix(BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Turn2* turn);
|
||||
extern inline void bgc_fp64_turn2_get_rotation_matrix(BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Turn2* turn);
|
||||
extern inline void bgc_fp32_turn2_get_rotation_matrix(BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Turn2* const turn);
|
||||
extern inline void bgc_fp64_turn2_get_rotation_matrix(BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Turn2* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn2_get_reverse_matrix(BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Turn2* turn);
|
||||
extern inline void bgc_fp64_turn2_get_reverse_matrix(BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Turn2* turn);
|
||||
extern inline void bgc_fp32_turn2_get_reverse_matrix(BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Turn2* const turn);
|
||||
extern inline void bgc_fp64_turn2_get_reverse_matrix(BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Turn2* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn2_vector(BGC_FP32_Vector2* turned_vector, const BGC_FP32_Turn2* turn, const BGC_FP32_Vector2* vector);
|
||||
extern inline void bgc_fp64_turn2_vector(BGC_FP64_Vector2* turned_vector, const BGC_FP64_Turn2* turn, const BGC_FP64_Vector2* vector);
|
||||
extern inline void bgc_fp32_turn2_vector(BGC_FP32_Vector2* const turned_vector, const BGC_FP32_Turn2* const turn, const BGC_FP32_Vector2* const vector);
|
||||
extern inline void bgc_fp64_turn2_vector(BGC_FP64_Vector2* const turned_vector, const BGC_FP64_Turn2* const turn, const BGC_FP64_Vector2* const vector);
|
||||
|
||||
extern inline void bgc_fp32_turn2_vector_back(BGC_FP32_Vector2* turned_vector, const BGC_FP32_Turn2* turn, const BGC_FP32_Vector2* vector);
|
||||
extern inline void bgc_fp64_turn2_vector_back(BGC_FP64_Vector2* turned_vector, const BGC_FP64_Turn2* turn, const BGC_FP64_Vector2* vector);
|
||||
extern inline void bgc_fp32_turn2_vector_back(BGC_FP32_Vector2* const turned_vector, const BGC_FP32_Turn2* const turn, const BGC_FP32_Vector2* const vector);
|
||||
extern inline void bgc_fp64_turn2_vector_back(BGC_FP64_Vector2* const turned_vector, const BGC_FP64_Turn2* const turn, const BGC_FP64_Vector2* const vector);
|
||||
|
||||
extern inline int bgc_fp32_turn2_are_close(const BGC_FP32_Turn2* turn1, const BGC_FP32_Turn2* turn2);
|
||||
extern inline int bgc_fp64_turn2_are_close(const BGC_FP64_Turn2* turn1, const BGC_FP64_Turn2* turn2);
|
||||
extern inline int bgc_fp32_turn2_are_close(const BGC_FP32_Turn2* const turn1, const BGC_FP32_Turn2* const turn2);
|
||||
extern inline int bgc_fp64_turn2_are_close(const BGC_FP64_Turn2* const turn1, const BGC_FP64_Turn2* const turn2);
|
||||
|
||||
void _bgc_fp32_turn2_normalize(BGC_FP32_Turn2* turn)
|
||||
void _bgc_fp32_turn2_normalize(BGC_FP32_Turn2* const turn)
|
||||
{
|
||||
const float square_modulus = turn->_cos * turn->_cos + turn->_sin * turn->_sin;
|
||||
|
||||
|
|
@ -74,7 +74,7 @@ void _bgc_fp32_turn2_normalize(BGC_FP32_Turn2* turn)
|
|||
turn->_sin *= multiplier;
|
||||
}
|
||||
|
||||
void _bgc_fp64_turn2_normalize(BGC_FP64_Turn2* turn)
|
||||
void _bgc_fp64_turn2_normalize(BGC_FP64_Turn2* const turn)
|
||||
{
|
||||
const double square_modulus = turn->_cos * turn->_cos + turn->_sin * turn->_sin;
|
||||
|
||||
|
|
|
|||
|
|
@ -14,13 +14,13 @@ extern const BGC_FP64_Turn2 BGC_FP64_IDLE_TURN2;
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_turn2_reset(BGC_FP32_Turn2* turn)
|
||||
inline void bgc_fp32_turn2_reset(BGC_FP32_Turn2* const turn)
|
||||
{
|
||||
turn->_cos = 1.0f;
|
||||
turn->_sin = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_reset(BGC_FP64_Turn2* turn)
|
||||
inline void bgc_fp64_turn2_reset(BGC_FP64_Turn2* const turn)
|
||||
{
|
||||
turn->_cos = 1.0;
|
||||
turn->_sin = 0.0;
|
||||
|
|
@ -28,7 +28,7 @@ inline void bgc_fp64_turn2_reset(BGC_FP64_Turn2* turn)
|
|||
|
||||
// ================== Set Turn ================== //
|
||||
|
||||
inline void bgc_fp32_turn2_make_for_angle(BGC_FP32_Turn2* turn, const float angle, const int angle_unit)
|
||||
inline void bgc_fp32_turn2_make_for_angle(BGC_FP32_Turn2* const turn, const float angle, const int angle_unit)
|
||||
{
|
||||
const float radians = bgc_fp32_angle_to_radians(angle, angle_unit);
|
||||
|
||||
|
|
@ -36,7 +36,7 @@ inline void bgc_fp32_turn2_make_for_angle(BGC_FP32_Turn2* turn, const float angl
|
|||
turn->_sin = sinf(radians);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_make_for_angle(BGC_FP64_Turn2* turn, const double angle, const int angle_unit)
|
||||
inline void bgc_fp64_turn2_make_for_angle(BGC_FP64_Turn2* const turn, const double angle, const int angle_unit)
|
||||
{
|
||||
const double radians = bgc_fp64_angle_to_radians(angle, angle_unit);
|
||||
|
||||
|
|
@ -47,23 +47,23 @@ inline void bgc_fp64_turn2_make_for_angle(BGC_FP64_Turn2* turn, const double ang
|
|||
|
||||
// ================== Set Turn ================== //
|
||||
|
||||
inline int bgc_fp32_turn2_is_idle(const BGC_FP32_Turn2* turn)
|
||||
inline int bgc_fp32_turn2_is_idle(const BGC_FP32_Turn2* const turn)
|
||||
{
|
||||
return bgc_fp32_is_unit(turn->_cos) && bgc_fp32_is_zero(turn->_sin);
|
||||
}
|
||||
|
||||
inline int bgc_fp64_turn2_is_idle(const BGC_FP64_Turn2* turn)
|
||||
inline int bgc_fp64_turn2_is_idle(const BGC_FP64_Turn2* const turn)
|
||||
{
|
||||
return bgc_fp64_is_unit(turn->_cos) && bgc_fp64_is_zero(turn->_sin);
|
||||
}
|
||||
|
||||
// ==================== Set ===================== //
|
||||
|
||||
void _bgc_fp32_turn2_normalize(BGC_FP32_Turn2* twin);
|
||||
void _bgc_fp32_turn2_normalize(BGC_FP32_Turn2* const twin);
|
||||
|
||||
void _bgc_fp64_turn2_normalize(BGC_FP64_Turn2* twin);
|
||||
void _bgc_fp64_turn2_normalize(BGC_FP64_Turn2* const twin);
|
||||
|
||||
inline void bgc_fp32_turn2_make(BGC_FP32_Turn2* turn, const float x1, const float x2)
|
||||
inline void bgc_fp32_turn2_make(BGC_FP32_Turn2* const turn, const float x1, const float x2)
|
||||
{
|
||||
const float square_modulus = x1 * x1 + x2 * x2;
|
||||
|
||||
|
|
@ -75,7 +75,7 @@ inline void bgc_fp32_turn2_make(BGC_FP32_Turn2* turn, const float x1, const floa
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_make(BGC_FP64_Turn2* turn, const double x1, const double x2)
|
||||
inline void bgc_fp64_turn2_make(BGC_FP64_Turn2* const turn, const double x1, const double x2)
|
||||
{
|
||||
const double square_modulus = x1 * x1 + x2 * x2;
|
||||
|
||||
|
|
@ -89,25 +89,25 @@ inline void bgc_fp64_turn2_make(BGC_FP64_Turn2* turn, const double x1, const dou
|
|||
|
||||
// =================== Angle =================== //
|
||||
|
||||
inline float bgc_fp32_turn2_get_angle(const BGC_FP32_Turn2* turn, const int angle_unit)
|
||||
inline float bgc_fp32_turn2_get_angle(const BGC_FP32_Turn2* const turn, const int angle_unit)
|
||||
{
|
||||
return bgc_fp32_radians_to_units(atan2f(turn->_sin, turn->_cos), angle_unit);
|
||||
}
|
||||
|
||||
inline double bgc_fp64_turn2_get_angle(const BGC_FP64_Turn2* turn, const int angle_unit)
|
||||
inline double bgc_fp64_turn2_get_angle(const BGC_FP64_Turn2* const turn, const int angle_unit)
|
||||
{
|
||||
return bgc_fp64_radians_to_units(atan2(turn->_sin, turn->_cos), angle_unit);
|
||||
}
|
||||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_turn2_copy(BGC_FP32_Turn2* destination, const BGC_FP32_Turn2* source)
|
||||
inline void bgc_fp32_turn2_copy(BGC_FP32_Turn2* const destination, const BGC_FP32_Turn2* const source)
|
||||
{
|
||||
destination->_cos = source->_cos;
|
||||
destination->_sin = source->_sin;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_copy(BGC_FP64_Turn2* destination, const BGC_FP64_Turn2* source)
|
||||
inline void bgc_fp64_turn2_copy(BGC_FP64_Turn2* const destination, const BGC_FP64_Turn2* const source)
|
||||
{
|
||||
destination->_cos = source->_cos;
|
||||
destination->_sin = source->_sin;
|
||||
|
|
@ -115,7 +115,7 @@ inline void bgc_fp64_turn2_copy(BGC_FP64_Turn2* destination, const BGC_FP64_Turn
|
|||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_turn2_swap(BGC_FP32_Turn2* turn1, BGC_FP32_Turn2* turn2)
|
||||
inline void bgc_fp32_turn2_swap(BGC_FP32_Turn2* const turn1, BGC_FP32_Turn2* const turn2)
|
||||
{
|
||||
const float cos = turn1->_cos;
|
||||
const float sin = turn1->_sin;
|
||||
|
|
@ -127,7 +127,7 @@ inline void bgc_fp32_turn2_swap(BGC_FP32_Turn2* turn1, BGC_FP32_Turn2* turn2)
|
|||
turn2->_sin = sin;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_swap(BGC_FP64_Turn2* turn1, BGC_FP64_Turn2* turn2)
|
||||
inline void bgc_fp64_turn2_swap(BGC_FP64_Turn2* const turn1, BGC_FP64_Turn2* const turn2)
|
||||
{
|
||||
const double cos = turn1->_cos;
|
||||
const double sin = turn1->_sin;
|
||||
|
|
@ -141,35 +141,35 @@ inline void bgc_fp64_turn2_swap(BGC_FP64_Turn2* turn1, BGC_FP64_Turn2* turn2)
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_turn2_convert_to_fp32(BGC_FP32_Turn2* destination, const BGC_FP64_Turn2* source)
|
||||
inline void bgc_fp64_turn2_convert_to_fp32(BGC_FP32_Turn2* const destination, const BGC_FP64_Turn2* const source)
|
||||
{
|
||||
bgc_fp32_turn2_make(destination, (float)source->_cos, (float)source->_sin);
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn2_convert_to_fp64(BGC_FP64_Turn2* destination, const BGC_FP32_Turn2* source)
|
||||
inline void bgc_fp32_turn2_convert_to_fp64(BGC_FP64_Turn2* const destination, const BGC_FP32_Turn2* const source)
|
||||
{
|
||||
bgc_fp64_turn2_make(destination, (double)source->_cos, (double)source->_sin);
|
||||
}
|
||||
|
||||
// =================== Revert =================== //
|
||||
|
||||
inline void bgc_fp32_turn2_revert(BGC_FP32_Turn2* turn)
|
||||
inline void bgc_fp32_turn2_revert(BGC_FP32_Turn2* const turn)
|
||||
{
|
||||
turn->_sin = -turn->_sin;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_revert(BGC_FP64_Turn2* turn)
|
||||
inline void bgc_fp64_turn2_revert(BGC_FP64_Turn2* const turn)
|
||||
{
|
||||
turn->_sin = -turn->_sin;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn2_get_reverse(BGC_FP32_Turn2* reverse, const BGC_FP32_Turn2* turn)
|
||||
inline void bgc_fp32_turn2_get_reverse(BGC_FP32_Turn2* const reverse, const BGC_FP32_Turn2* const turn)
|
||||
{
|
||||
reverse->_cos = turn->_cos;
|
||||
reverse->_sin = -turn->_sin;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_get_reverse(BGC_FP64_Turn2* reverse, const BGC_FP64_Turn2* turn)
|
||||
inline void bgc_fp64_turn2_get_reverse(BGC_FP64_Turn2* const reverse, const BGC_FP64_Turn2* const turn)
|
||||
{
|
||||
reverse->_cos = turn->_cos;
|
||||
reverse->_sin = -turn->_sin;
|
||||
|
|
@ -177,7 +177,7 @@ inline void bgc_fp64_turn2_get_reverse(BGC_FP64_Turn2* reverse, const BGC_FP64_T
|
|||
|
||||
// ================= Exponation ================= //
|
||||
|
||||
inline void bgc_fp32_turn2_get_power(BGC_FP32_Turn2* power, const BGC_FP32_Turn2* base, const float exponent)
|
||||
inline void bgc_fp32_turn2_get_power(BGC_FP32_Turn2* const power, const BGC_FP32_Turn2* const base, const float exponent)
|
||||
{
|
||||
const float power_angle = exponent * atan2f(base->_sin, base->_cos);
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ inline void bgc_fp32_turn2_get_power(BGC_FP32_Turn2* power, const BGC_FP32_Turn2
|
|||
power->_sin = sinf(power_angle);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_get_power(BGC_FP64_Turn2* power, const BGC_FP64_Turn2* base, const double exponent)
|
||||
inline void bgc_fp64_turn2_get_power(BGC_FP64_Turn2* const power, const BGC_FP64_Turn2* const base, const double exponent)
|
||||
{
|
||||
const double power_angle = exponent * atan2(base->_sin, base->_cos);
|
||||
|
||||
|
|
@ -195,7 +195,7 @@ inline void bgc_fp64_turn2_get_power(BGC_FP64_Turn2* power, const BGC_FP64_Turn2
|
|||
|
||||
// ================ Combination ================= //
|
||||
|
||||
inline void bgc_fp32_turn2_combine(BGC_FP32_Turn2* combination, const BGC_FP32_Turn2* turn1, const BGC_FP32_Turn2* turn2)
|
||||
inline void bgc_fp32_turn2_combine(BGC_FP32_Turn2* const combination, const BGC_FP32_Turn2* const turn1, const BGC_FP32_Turn2* const turn2)
|
||||
{
|
||||
bgc_fp32_turn2_make(
|
||||
combination,
|
||||
|
|
@ -204,7 +204,7 @@ inline void bgc_fp32_turn2_combine(BGC_FP32_Turn2* combination, const BGC_FP32_T
|
|||
);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_combine(BGC_FP64_Turn2* combination, const BGC_FP64_Turn2* turn1, const BGC_FP64_Turn2* turn2)
|
||||
inline void bgc_fp64_turn2_combine(BGC_FP64_Turn2* const combination, const BGC_FP64_Turn2* const turn1, const BGC_FP64_Turn2* const turn2)
|
||||
{
|
||||
bgc_fp64_turn2_make(
|
||||
combination,
|
||||
|
|
@ -215,7 +215,7 @@ inline void bgc_fp64_turn2_combine(BGC_FP64_Turn2* combination, const BGC_FP64_T
|
|||
|
||||
// ================= Exclusion ================== //
|
||||
|
||||
inline void bgc_fp32_turn2_exclude(BGC_FP32_Turn2* difference, const BGC_FP32_Turn2* base, const BGC_FP32_Turn2* excludant)
|
||||
inline void bgc_fp32_turn2_exclude(BGC_FP32_Turn2* const difference, const BGC_FP32_Turn2* const base, const BGC_FP32_Turn2* const excludant)
|
||||
{
|
||||
bgc_fp32_turn2_make(
|
||||
difference,
|
||||
|
|
@ -224,7 +224,7 @@ inline void bgc_fp32_turn2_exclude(BGC_FP32_Turn2* difference, const BGC_FP32_Tu
|
|||
);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_exclude(BGC_FP64_Turn2* difference, const BGC_FP64_Turn2* base, const BGC_FP64_Turn2* excludant)
|
||||
inline void bgc_fp64_turn2_exclude(BGC_FP64_Turn2* const difference, const BGC_FP64_Turn2* const base, const BGC_FP64_Turn2* const excludant)
|
||||
{
|
||||
bgc_fp64_turn2_make(
|
||||
difference,
|
||||
|
|
@ -235,7 +235,7 @@ inline void bgc_fp64_turn2_exclude(BGC_FP64_Turn2* difference, const BGC_FP64_Tu
|
|||
|
||||
// ============== Rotation Matrix =============== //
|
||||
|
||||
inline void bgc_fp32_turn2_get_rotation_matrix(BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Turn2* turn)
|
||||
inline void bgc_fp32_turn2_get_rotation_matrix(BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Turn2* const turn)
|
||||
{
|
||||
matrix->r1c1 = turn->_cos;
|
||||
matrix->r1c2 = -turn->_sin;
|
||||
|
|
@ -243,7 +243,7 @@ inline void bgc_fp32_turn2_get_rotation_matrix(BGC_FP32_Matrix2x2* matrix, const
|
|||
matrix->r2c2 = turn->_cos;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_get_rotation_matrix(BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Turn2* turn)
|
||||
inline void bgc_fp64_turn2_get_rotation_matrix(BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Turn2* const turn)
|
||||
{
|
||||
matrix->r1c1 = turn->_cos;
|
||||
matrix->r1c2 = -turn->_sin;
|
||||
|
|
@ -253,7 +253,7 @@ inline void bgc_fp64_turn2_get_rotation_matrix(BGC_FP64_Matrix2x2* matrix, const
|
|||
|
||||
// ============== Reverse Matrix ================ //
|
||||
|
||||
inline void bgc_fp32_turn2_get_reverse_matrix(BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Turn2* turn)
|
||||
inline void bgc_fp32_turn2_get_reverse_matrix(BGC_FP32_Matrix2x2* const matrix, const BGC_FP32_Turn2* const turn)
|
||||
{
|
||||
matrix->r1c1 = turn->_cos;
|
||||
matrix->r1c2 = turn->_sin;
|
||||
|
|
@ -261,7 +261,7 @@ inline void bgc_fp32_turn2_get_reverse_matrix(BGC_FP32_Matrix2x2* matrix, const
|
|||
matrix->r2c2 = turn->_cos;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_get_reverse_matrix(BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Turn2* turn)
|
||||
inline void bgc_fp64_turn2_get_reverse_matrix(BGC_FP64_Matrix2x2* const matrix, const BGC_FP64_Turn2* const turn)
|
||||
{
|
||||
matrix->r1c1 = turn->_cos;
|
||||
matrix->r1c2 = turn->_sin;
|
||||
|
|
@ -271,7 +271,7 @@ inline void bgc_fp64_turn2_get_reverse_matrix(BGC_FP64_Matrix2x2* matrix, const
|
|||
|
||||
// ================ Turn Vector ================= //
|
||||
|
||||
inline void bgc_fp32_turn2_vector(BGC_FP32_Vector2* turned_vector, const BGC_FP32_Turn2* turn, const BGC_FP32_Vector2* vector)
|
||||
inline void bgc_fp32_turn2_vector(BGC_FP32_Vector2* const turned_vector, const BGC_FP32_Turn2* const turn, const BGC_FP32_Vector2* const vector)
|
||||
{
|
||||
const float x1 = turn->_cos * vector->x1 - turn->_sin * vector->x2;
|
||||
const float x2 = turn->_sin * vector->x1 + turn->_cos * vector->x2;
|
||||
|
|
@ -280,7 +280,7 @@ inline void bgc_fp32_turn2_vector(BGC_FP32_Vector2* turned_vector, const BGC_FP3
|
|||
turned_vector->x2 = x2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_vector(BGC_FP64_Vector2* turned_vector, const BGC_FP64_Turn2* turn, const BGC_FP64_Vector2* vector)
|
||||
inline void bgc_fp64_turn2_vector(BGC_FP64_Vector2* const turned_vector, const BGC_FP64_Turn2* const turn, const BGC_FP64_Vector2* const vector)
|
||||
{
|
||||
const double x1 = turn->_cos * vector->x1 - turn->_sin * vector->x2;
|
||||
const double x2 = turn->_sin * vector->x1 + turn->_cos * vector->x2;
|
||||
|
|
@ -291,7 +291,7 @@ inline void bgc_fp64_turn2_vector(BGC_FP64_Vector2* turned_vector, const BGC_FP6
|
|||
|
||||
// ============ Turn Vector Backward ============ //
|
||||
|
||||
inline void bgc_fp32_turn2_vector_back(BGC_FP32_Vector2* turned_vector, const BGC_FP32_Turn2* turn, const BGC_FP32_Vector2* vector)
|
||||
inline void bgc_fp32_turn2_vector_back(BGC_FP32_Vector2* const turned_vector, const BGC_FP32_Turn2* const turn, const BGC_FP32_Vector2* const vector)
|
||||
{
|
||||
const float x1 = turn->_sin * vector->x2 + turn->_cos * vector->x1;
|
||||
const float x2 = turn->_cos * vector->x2 - turn->_sin * vector->x1;
|
||||
|
|
@ -300,7 +300,7 @@ inline void bgc_fp32_turn2_vector_back(BGC_FP32_Vector2* turned_vector, const BG
|
|||
turned_vector->x2 = x2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn2_vector_back(BGC_FP64_Vector2* turned_vector, const BGC_FP64_Turn2* turn, const BGC_FP64_Vector2* vector)
|
||||
inline void bgc_fp64_turn2_vector_back(BGC_FP64_Vector2* const turned_vector, const BGC_FP64_Turn2* const turn, const BGC_FP64_Vector2* const vector)
|
||||
{
|
||||
const double x1 = turn->_sin * vector->x2 + turn->_cos * vector->x1;
|
||||
const double x2 = turn->_cos * vector->x2 - turn->_sin * vector->x1;
|
||||
|
|
@ -311,7 +311,7 @@ inline void bgc_fp64_turn2_vector_back(BGC_FP64_Vector2* turned_vector, const BG
|
|||
|
||||
// ================== Are Close ================= //
|
||||
|
||||
inline int bgc_fp32_turn2_are_close(const BGC_FP32_Turn2* turn1, const BGC_FP32_Turn2* turn2)
|
||||
inline int bgc_fp32_turn2_are_close(const BGC_FP32_Turn2* const turn1, const BGC_FP32_Turn2* const turn2)
|
||||
{
|
||||
const float d_cos = turn1->_cos - turn2->_cos;
|
||||
const float d_sin = turn1->_sin - turn2->_sin;
|
||||
|
|
@ -319,7 +319,7 @@ inline int bgc_fp32_turn2_are_close(const BGC_FP32_Turn2* turn1, const BGC_FP32_
|
|||
return d_cos * d_cos + d_sin * d_sin <= BGC_FP32_SQUARE_EPSILON;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_turn2_are_close(const BGC_FP64_Turn2* turn1, const BGC_FP64_Turn2* turn2)
|
||||
inline int bgc_fp64_turn2_are_close(const BGC_FP64_Turn2* const turn1, const BGC_FP64_Turn2* const turn2)
|
||||
{
|
||||
const double d_cos = turn1->_cos - turn2->_cos;
|
||||
const double d_sin = turn1->_sin - turn2->_sin;
|
||||
|
|
|
|||
|
|
@ -8,78 +8,78 @@ const BGC_FP32_Turn3 BGC_FP32_IDLE_TURN3 = {{ 1.0f, 0.0f, 0.0f, 0.0f }};
|
|||
|
||||
const BGC_FP64_Turn3 BGC_FP64_IDLE_TURN3 = {{ 1.0, 0.0, 0.0, 0.0 }};
|
||||
|
||||
extern inline void bgc_fp32_turn3_reset(BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_reset(BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_reset(BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_reset(BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* turn, const float s0, const float x1, const float x2, const float x3);
|
||||
extern inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* turn, const double s0, const double x1, const double x2, const double x3);
|
||||
extern inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* const turn, const float s0, const float x1, const float x2, const float x3);
|
||||
extern inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* const turn, const double s0, const double x1, const double x2, const double x3);
|
||||
|
||||
extern inline void bgc_fp32_turn3_get_quaternion(BGC_FP32_Quaternion* quaternion, const BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_get_quaternion(BGC_FP64_Quaternion* quaternion, const BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_get_quaternion(BGC_FP32_Quaternion* const quaternion, const BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_get_quaternion(BGC_FP64_Quaternion* const quaternion, const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* turn, const BGC_FP32_Quaternion* quaternion);
|
||||
extern inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* turn, const BGC_FP64_Quaternion* quaternion);
|
||||
extern inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* const turn, const BGC_FP32_Quaternion* const quaternion);
|
||||
extern inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* const turn, const BGC_FP64_Quaternion* const quaternion);
|
||||
|
||||
extern inline void bgc_fp32_turn3_copy(BGC_FP32_Turn3* destination, const BGC_FP32_Turn3* source);
|
||||
extern inline void bgc_fp64_turn3_copy(BGC_FP64_Turn3* destination, const BGC_FP64_Turn3* source);
|
||||
extern inline void bgc_fp32_turn3_copy(BGC_FP32_Turn3* const destination, const BGC_FP32_Turn3* const source);
|
||||
extern inline void bgc_fp64_turn3_copy(BGC_FP64_Turn3* const destination, const BGC_FP64_Turn3* const source);
|
||||
|
||||
extern inline void bgc_fp32_turn3_swap(BGC_FP32_Turn3* turn1, BGC_FP32_Turn3* turn2);
|
||||
extern inline void bgc_fp64_turn3_swap(BGC_FP64_Turn3* turn1, BGC_FP64_Turn3* turn2);
|
||||
extern inline void bgc_fp32_turn3_swap(BGC_FP32_Turn3* const turn1, BGC_FP32_Turn3* const turn2);
|
||||
extern inline void bgc_fp64_turn3_swap(BGC_FP64_Turn3* const turn1, BGC_FP64_Turn3* const turn2);
|
||||
|
||||
extern inline int bgc_fp32_turn3_is_idle(const BGC_FP32_Turn3* turn);
|
||||
extern inline int bgc_fp64_turn3_is_idle(const BGC_FP64_Turn3* turn);
|
||||
extern inline int bgc_fp32_turn3_is_idle(const BGC_FP32_Turn3* const turn);
|
||||
extern inline int bgc_fp64_turn3_is_idle(const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* destination, const BGC_FP32_Turn3* source);
|
||||
extern inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* destination, const BGC_FP64_Turn3* source);
|
||||
extern inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* const destination, const BGC_FP32_Turn3* const source);
|
||||
extern inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* const destination, const BGC_FP64_Turn3* const source);
|
||||
|
||||
extern inline void bgc_fp32_turn3_shorten(BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_shorten(BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_shorten(BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_shorten(BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* shortened, const BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* shortened, const BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* const shortened, const BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* const shortened, const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_alternate(BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_alternate(BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_alternate(BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_alternate(BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_get_alternative(BGC_FP32_Turn3* alternative, const BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_get_alternative(BGC_FP64_Turn3* alternative, const BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_get_alternative(BGC_FP32_Turn3* const alternative, const BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_get_alternative(BGC_FP64_Turn3* const alternative, const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_revert(BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_revert(BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_revert(BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_revert(BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_get_reverse(BGC_FP32_Turn3* inverse, const BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_get_reverse(BGC_FP64_Turn3* inverse, const BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_get_reverse(BGC_FP32_Turn3* const inverse, const BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_get_reverse(BGC_FP64_Turn3* const inverse, const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* combination, const BGC_FP32_Turn3* first, const BGC_FP32_Turn3* second);
|
||||
extern inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* combination, const BGC_FP64_Turn3* first, const BGC_FP64_Turn3* second);
|
||||
extern inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* const combination, const BGC_FP32_Turn3* const first, const BGC_FP32_Turn3* const second);
|
||||
extern inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* const combination, const BGC_FP64_Turn3* const first, const BGC_FP64_Turn3* const second);
|
||||
|
||||
extern inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* combination, const BGC_FP32_Turn3* first, const BGC_FP32_Turn3* second, const BGC_FP32_Turn3* third);
|
||||
extern inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* combination, const BGC_FP64_Turn3* first, const BGC_FP64_Turn3* second, const BGC_FP64_Turn3* third);
|
||||
extern inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* const combination, const BGC_FP32_Turn3* const first, const BGC_FP32_Turn3* const second, const BGC_FP32_Turn3* const third);
|
||||
extern inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* const combination, const BGC_FP64_Turn3* const first, const BGC_FP64_Turn3* const second, const BGC_FP64_Turn3* const third);
|
||||
|
||||
extern inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* difference, const BGC_FP32_Turn3* base, const BGC_FP32_Turn3* excludant);
|
||||
extern inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* difference, const BGC_FP64_Turn3* base, const BGC_FP64_Turn3* excludant);
|
||||
extern inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* const difference, const BGC_FP32_Turn3* const base, const BGC_FP32_Turn3* const excludant);
|
||||
extern inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* const difference, const BGC_FP64_Turn3* const base, const BGC_FP64_Turn3* const excludant);
|
||||
|
||||
extern inline void bgc_fp32_turn3_get_rotation_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_get_rotation_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_get_rotation_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_get_rotation_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_get_reverse_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_get_reverse_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_get_reverse_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_get_reverse_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_get_both_matrices(BGC_FP32_Matrix3x3* rotation, BGC_FP32_Matrix3x3* reverse, const BGC_FP32_Turn3* turn);
|
||||
extern inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* rotation, BGC_FP64_Matrix3x3* reverse, const BGC_FP64_Turn3* turn);
|
||||
extern inline void bgc_fp32_turn3_get_both_matrices(BGC_FP32_Matrix3x3* const rotation, BGC_FP32_Matrix3x3* const reverse, const BGC_FP32_Turn3* const turn);
|
||||
extern inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* const rotation, BGC_FP64_Matrix3x3* const reverse, const BGC_FP64_Turn3* const turn);
|
||||
|
||||
extern inline void bgc_fp32_turn3_vector(BGC_FP32_Vector3* turned_vector, const BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* vector);
|
||||
extern inline void bgc_fp64_turn3_vector(BGC_FP64_Vector3* turned_vector, const BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* vector);
|
||||
extern inline void bgc_fp32_turn3_vector(BGC_FP32_Vector3* const turned_vector, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const vector);
|
||||
extern inline void bgc_fp64_turn3_vector(BGC_FP64_Vector3* const turned_vector, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const vector);
|
||||
|
||||
extern inline void bgc_fp32_turn3_vector_back(BGC_FP32_Vector3* turned_vector, const BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* vector);
|
||||
extern inline void bgc_fp64_turn3_vector_back(BGC_FP64_Vector3* turned_vector, const BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* vector);
|
||||
extern inline void bgc_fp32_turn3_vector_back(BGC_FP32_Vector3* const turned_vector, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const vector);
|
||||
extern inline void bgc_fp64_turn3_vector_back(BGC_FP64_Vector3* const turned_vector, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const vector);
|
||||
|
||||
extern inline int bgc_fp32_turn3_are_close(const BGC_FP32_Turn3* turn1, const BGC_FP32_Turn3* turn2);
|
||||
extern inline int bgc_fp64_turn3_are_close(const BGC_FP64_Turn3* turn1, const BGC_FP64_Turn3* turn2);
|
||||
extern inline int bgc_fp32_turn3_are_close(const BGC_FP32_Turn3* const turn1, const BGC_FP32_Turn3* const turn2);
|
||||
extern inline int bgc_fp64_turn3_are_close(const BGC_FP64_Turn3* const turn1, const BGC_FP64_Turn3* const turn2);
|
||||
|
||||
// ================= Normalize ================== //
|
||||
|
||||
void _bgc_fp32_turn3_normalize(BGC_FP32_Turn3* turn, const float square_modulus)
|
||||
void _bgc_fp32_turn3_normalize(BGC_FP32_Turn3* const turn, const float square_modulus)
|
||||
{
|
||||
if (square_modulus <= BGC_FP32_SQUARE_EPSILON || isnan(square_modulus)) {
|
||||
bgc_fp32_turn3_reset(turn);
|
||||
|
|
@ -89,7 +89,7 @@ void _bgc_fp32_turn3_normalize(BGC_FP32_Turn3* turn, const float square_modulus)
|
|||
bgc_fp32_quaternion_multiply_by_real_number(&turn->_versor, &turn->_versor, sqrtf(1.0f / square_modulus));
|
||||
}
|
||||
|
||||
void _bgc_fp64_turn3_normalize(BGC_FP64_Turn3* turn, const double square_modulus)
|
||||
void _bgc_fp64_turn3_normalize(BGC_FP64_Turn3* const turn, const double square_modulus)
|
||||
{
|
||||
if (square_modulus <= BGC_FP64_SQUARE_EPSILON || isnan(square_modulus)) {
|
||||
bgc_fp64_turn3_reset(turn);
|
||||
|
|
@ -102,7 +102,7 @@ void _bgc_fp64_turn3_normalize(BGC_FP64_Turn3* turn, const double square_modulus
|
|||
|
||||
// ================ Get Rotation ================ //
|
||||
|
||||
float bgc_fp32_turn3_get_rotation(BGC_FP32_Vector3* axis, const BGC_FP32_Turn3* turn, const int angle_unit)
|
||||
float bgc_fp32_turn3_get_rotation(BGC_FP32_Vector3* const axis, const BGC_FP32_Turn3* const turn, const int angle_unit)
|
||||
{
|
||||
const float square_vector_modulus = turn->_versor.x1 * turn->_versor.x1 + turn->_versor.x2 * turn->_versor.x2 + turn->_versor.x3 * turn->_versor.x3;
|
||||
|
||||
|
|
@ -122,7 +122,7 @@ float bgc_fp32_turn3_get_rotation(BGC_FP32_Vector3* axis, const BGC_FP32_Turn3*
|
|||
return 2.0f * atan2f(vector_modulus, turn->_versor.s0);
|
||||
}
|
||||
|
||||
double bgc_fp64_turn3_get_rotation(BGC_FP64_Vector3* axis, const BGC_FP64_Turn3* turn, const int angle_unit)
|
||||
double bgc_fp64_turn3_get_rotation(BGC_FP64_Vector3* const axis, const BGC_FP64_Turn3* const turn, const int angle_unit)
|
||||
{
|
||||
const double square_vector_modulus = turn->_versor.x1 * turn->_versor.x1 + turn->_versor.x2 * turn->_versor.x2 + turn->_versor.x3 * turn->_versor.x3;
|
||||
|
||||
|
|
@ -144,7 +144,7 @@ double bgc_fp64_turn3_get_rotation(BGC_FP64_Vector3* axis, const BGC_FP64_Turn3*
|
|||
|
||||
// ================ Set Rotation ================ //
|
||||
|
||||
void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* turn, const float x1, const float x2, const float x3, const float angle, const int angle_unit)
|
||||
void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* const turn, const float x1, const float x2, const float x3, const float angle, const int angle_unit)
|
||||
{
|
||||
const float square_vector = x1 * x1 + x2 * x2 + x3 * x3;
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* turn, const float x1, const flo
|
|||
}
|
||||
}
|
||||
|
||||
void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* turn, const double x1, const double x2, const double x3, const double angle, const int angle_unit)
|
||||
void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* const turn, const double x1, const double x2, const double x3, const double angle, const int angle_unit)
|
||||
{
|
||||
const double square_vector = x1 * x1 + x2 * x2 + x3 * x3;
|
||||
|
||||
|
|
@ -204,7 +204,7 @@ void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* turn, const double x1, const do
|
|||
|
||||
// ========= Find Direction Difference ========== //
|
||||
|
||||
int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* first, const BGC_FP32_Vector3* second)
|
||||
int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const first, const BGC_FP32_Vector3* const second)
|
||||
{
|
||||
const float first_square_modulus = bgc_fp32_vector3_get_squared_length(first);
|
||||
|
||||
|
|
@ -248,7 +248,7 @@ int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP3
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* first, const BGC_FP64_Vector3* second)
|
||||
int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const first, const BGC_FP64_Vector3* const second)
|
||||
{
|
||||
const double first_square_modulus = bgc_fp64_vector3_get_squared_length(first);
|
||||
|
||||
|
|
@ -295,7 +295,7 @@ int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP6
|
|||
|
||||
// ============ Make Orthogonal Pair ============ //
|
||||
|
||||
static inline int _bgc_fp32_turn3_get_orthogonal_pair(BGC_FP32_Vector3* unit_main, BGC_FP32_Vector3* unit_branch, const BGC_FP32_Vector3* main, const BGC_FP32_Vector3* branch)
|
||||
static inline int _bgc_fp32_turn3_get_orthogonal_pair(BGC_FP32_Vector3* const unit_main, BGC_FP32_Vector3* const unit_branch, const BGC_FP32_Vector3* const main, const BGC_FP32_Vector3* const branch)
|
||||
{
|
||||
const float main_square_modulus = bgc_fp32_vector3_get_squared_length(main);
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ static inline int _bgc_fp32_turn3_get_orthogonal_pair(BGC_FP32_Vector3* unit_mai
|
|||
return BGC_SUCCESS;
|
||||
}
|
||||
|
||||
static inline int _bgc_fp64_turn3_get_orthogonal_pair(BGC_FP64_Vector3* unit_main, BGC_FP64_Vector3* unit_branch, const BGC_FP64_Vector3* main, const BGC_FP64_Vector3* branch)
|
||||
static inline int _bgc_fp64_turn3_get_orthogonal_pair(BGC_FP64_Vector3* const unit_main, BGC_FP64_Vector3* const unit_branch, const BGC_FP64_Vector3* const main, const BGC_FP64_Vector3* const branch)
|
||||
{
|
||||
const double main_square_modulus = bgc_fp64_vector3_get_squared_length(main);
|
||||
|
||||
|
|
@ -355,7 +355,7 @@ static inline int _bgc_fp64_turn3_get_orthogonal_pair(BGC_FP64_Vector3* unit_mai
|
|||
|
||||
// ========= Make Direction Difference ========== //
|
||||
|
||||
static inline void _bgc_fp32_turn3_get_turning_quaternion(BGC_FP32_Quaternion* quaternion, const BGC_FP32_Vector3* unit_start, const BGC_FP32_Vector3* unit_end, const BGC_FP32_Vector3* unit_orthogonal)
|
||||
static inline void _bgc_fp32_turn3_get_turning_quaternion(BGC_FP32_Quaternion* const quaternion, const BGC_FP32_Vector3* const unit_start, const BGC_FP32_Vector3* const unit_end, const BGC_FP32_Vector3* const unit_orthogonal)
|
||||
{
|
||||
BGC_FP32_Vector3 axis;
|
||||
|
||||
|
|
@ -396,7 +396,7 @@ static inline void _bgc_fp32_turn3_get_turning_quaternion(BGC_FP32_Quaternion* q
|
|||
quaternion->x3 = axis.x3 * multiplier;
|
||||
}
|
||||
|
||||
static inline void _bgc_fp64_turn3_get_turning_quaternion(BGC_FP64_Quaternion* quaternion, const BGC_FP64_Vector3* unit_start, const BGC_FP64_Vector3* unit_end, const BGC_FP64_Vector3* unit_orthogonal)
|
||||
static inline void _bgc_fp64_turn3_get_turning_quaternion(BGC_FP64_Quaternion* const quaternion, const BGC_FP64_Vector3* const unit_start, const BGC_FP64_Vector3* const unit_end, const BGC_FP64_Vector3* const unit_orthogonal)
|
||||
{
|
||||
BGC_FP64_Vector3 axis;
|
||||
|
||||
|
|
@ -440,11 +440,11 @@ static inline void _bgc_fp64_turn3_get_turning_quaternion(BGC_FP64_Quaternion* q
|
|||
// ============ Make Pair Difference ============ //
|
||||
|
||||
int bgc_fp32_turn3_find_pair_difference(
|
||||
BGC_FP32_Turn3* turn,
|
||||
const BGC_FP32_Vector3* first_pair_main,
|
||||
const BGC_FP32_Vector3* first_pair_branch,
|
||||
const BGC_FP32_Vector3* second_pair_main,
|
||||
const BGC_FP32_Vector3* second_pair_branch
|
||||
BGC_FP32_Turn3* const turn,
|
||||
const BGC_FP32_Vector3* const first_pair_main,
|
||||
const BGC_FP32_Vector3* const first_pair_branch,
|
||||
const BGC_FP32_Vector3* const second_pair_main,
|
||||
const BGC_FP32_Vector3* const second_pair_branch
|
||||
) {
|
||||
BGC_FP32_Vector3 first_fixed_main, first_fixed_branch, first_turned_branch, second_fixed_main, second_fixed_branch;
|
||||
|
||||
|
|
@ -487,11 +487,11 @@ int bgc_fp32_turn3_find_pair_difference(
|
|||
}
|
||||
|
||||
int bgc_fp64_turn3_find_pair_difference(
|
||||
BGC_FP64_Turn3* turn,
|
||||
const BGC_FP64_Vector3* first_pair_main,
|
||||
const BGC_FP64_Vector3* first_pair_branch,
|
||||
const BGC_FP64_Vector3* second_pair_main,
|
||||
const BGC_FP64_Vector3* second_pair_branch
|
||||
BGC_FP64_Turn3* const turn,
|
||||
const BGC_FP64_Vector3* const first_pair_main,
|
||||
const BGC_FP64_Vector3* const first_pair_branch,
|
||||
const BGC_FP64_Vector3* const second_pair_main,
|
||||
const BGC_FP64_Vector3* const second_pair_branch
|
||||
) {
|
||||
BGC_FP64_Vector3 first_fixed_main, first_fixed_branch, first_turned_branch, second_fixed_main, second_fixed_branch;
|
||||
|
||||
|
|
@ -535,7 +535,7 @@ int bgc_fp64_turn3_find_pair_difference(
|
|||
|
||||
// =============== Get Exponation =============== //
|
||||
|
||||
void bgc_fp32_turn3_get_power(BGC_FP32_Turn3* power, const BGC_FP32_Turn3* base, const float exponent)
|
||||
void bgc_fp32_turn3_get_power(BGC_FP32_Turn3* const power, const BGC_FP32_Turn3* const base, const float exponent)
|
||||
{
|
||||
const float square_vector = base->_versor.x1 * base->_versor.x1 + base->_versor.x2 * base->_versor.x2 + base->_versor.x3 * base->_versor.x3;
|
||||
|
||||
|
|
@ -553,7 +553,7 @@ void bgc_fp32_turn3_get_power(BGC_FP32_Turn3* power, const BGC_FP32_Turn3* base,
|
|||
bgc_fp32_turn3_set_raw_values(power, cosf(angle), base->_versor.x1 * multiplier, base->_versor.x2 * multiplier, base->_versor.x3 * multiplier);
|
||||
}
|
||||
|
||||
void bgc_fp64_turn3_get_power(BGC_FP64_Turn3* power, const BGC_FP64_Turn3* base, const double exponent)
|
||||
void bgc_fp64_turn3_get_power(BGC_FP64_Turn3* const power, const BGC_FP64_Turn3* const base, const double exponent)
|
||||
{
|
||||
const double square_vector = base->_versor.x1 * base->_versor.x1 + base->_versor.x2 * base->_versor.x2 + base->_versor.x3 * base->_versor.x3;
|
||||
|
||||
|
|
@ -573,7 +573,7 @@ void bgc_fp64_turn3_get_power(BGC_FP64_Turn3* power, const BGC_FP64_Turn3* base,
|
|||
|
||||
// ============ Sphere Interpolation ============ //
|
||||
|
||||
void bgc_fp32_turn3_spherically_interpolate(BGC_FP32_Turn3* interpolation, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* end, const float phase)
|
||||
void bgc_fp32_turn3_spherically_interpolate(BGC_FP32_Turn3* const interpolation, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const end, const float phase)
|
||||
{
|
||||
const float delta_s0 = (end->_versor.s0 * start->_versor.s0 + end->_versor.x1 * start->_versor.x1) + (end->_versor.x2 * start->_versor.x2 + end->_versor.x3 * start->_versor.x3);
|
||||
const float delta_x1 = (end->_versor.x1 * start->_versor.s0 + end->_versor.x3 * start->_versor.x2) - (end->_versor.s0 * start->_versor.x1 + end->_versor.x2 * start->_versor.x3);
|
||||
|
|
@ -608,7 +608,7 @@ void bgc_fp32_turn3_spherically_interpolate(BGC_FP32_Turn3* interpolation, const
|
|||
);
|
||||
}
|
||||
|
||||
void bgc_fp64_turn3_spherically_interpolate(BGC_FP64_Turn3* interpolation, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* end, const double phase)
|
||||
void bgc_fp64_turn3_spherically_interpolate(BGC_FP64_Turn3* const interpolation, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const end, const double phase)
|
||||
{
|
||||
const double delta_s0 = (end->_versor.s0 * start->_versor.s0 + end->_versor.x1 * start->_versor.x1) + (end->_versor.x2 * start->_versor.x2 + end->_versor.x3 * start->_versor.x3);
|
||||
const double delta_x1 = (end->_versor.x1 * start->_versor.s0 + end->_versor.x3 * start->_versor.x2) - (end->_versor.s0 * start->_versor.x1 + end->_versor.x2 * start->_versor.x3);
|
||||
|
|
|
|||
|
|
@ -33,25 +33,25 @@ extern const BGC_FP64_Turn3 BGC_FP64_IDLE_TURN3;
|
|||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
inline void bgc_fp32_turn3_reset(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_reset(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_make(&turn->_versor, 1.0f, 0.0f, 0.0f, 0.0f);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_reset(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_reset(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_make(&turn->_versor, 1.0, 0.0, 0.0, 0.0);
|
||||
}
|
||||
|
||||
// ============= Private: Normalize ============= //
|
||||
|
||||
void _bgc_fp32_turn3_normalize(BGC_FP32_Turn3* turn, const float square_modulus);
|
||||
void _bgc_fp32_turn3_normalize(BGC_FP32_Turn3* const turn, const float square_modulus);
|
||||
|
||||
void _bgc_fp64_turn3_normalize(BGC_FP64_Turn3* turn, const double square_modulus);
|
||||
void _bgc_fp64_turn3_normalize(BGC_FP64_Turn3* const turn, const double square_modulus);
|
||||
|
||||
// ================= Set Values ================= //
|
||||
|
||||
inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* turn, const float s0, const float x1, const float x2, const float x3)
|
||||
inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* const turn, const float s0, const float x1, const float x2, const float x3)
|
||||
{
|
||||
bgc_fp32_quaternion_make(&turn->_versor, s0, x1, x2, x3);
|
||||
|
||||
|
|
@ -62,7 +62,7 @@ inline void bgc_fp32_turn3_set_raw_values(BGC_FP32_Turn3* turn, const float s0,
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* turn, const double s0, const double x1, const double x2, const double x3)
|
||||
inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* const turn, const double s0, const double x1, const double x2, const double x3)
|
||||
{
|
||||
bgc_fp64_quaternion_make(&turn->_versor, s0, x1, x2, x3);
|
||||
|
||||
|
|
@ -75,19 +75,19 @@ inline void bgc_fp64_turn3_set_raw_values(BGC_FP64_Turn3* turn, const double s0,
|
|||
|
||||
// =============== Get Quaternion =============== //
|
||||
|
||||
inline void bgc_fp32_turn3_get_quaternion(BGC_FP32_Quaternion* quaternion, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_quaternion(BGC_FP32_Quaternion* const quaternion, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(quaternion, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_quaternion(BGC_FP64_Quaternion* quaternion, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_quaternion(BGC_FP64_Quaternion* const quaternion, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(quaternion, &turn->_versor);
|
||||
}
|
||||
|
||||
// =============== Set Quaternion =============== //
|
||||
|
||||
inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* turn, const BGC_FP32_Quaternion* quaternion)
|
||||
inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* const turn, const BGC_FP32_Quaternion* const quaternion)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(&turn->_versor, quaternion);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ inline void bgc_fp32_turn3_set_quaternion(BGC_FP32_Turn3* turn, const BGC_FP32_Q
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* turn, const BGC_FP64_Quaternion* quaternion)
|
||||
inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* const turn, const BGC_FP64_Quaternion* const quaternion)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(&turn->_versor, quaternion);
|
||||
|
||||
|
|
@ -111,79 +111,79 @@ inline void bgc_fp64_turn3_set_quaternion(BGC_FP64_Turn3* turn, const BGC_FP64_Q
|
|||
|
||||
// ================ Get Rotation ================ //
|
||||
|
||||
float bgc_fp32_turn3_get_rotation(BGC_FP32_Vector3* axis, const BGC_FP32_Turn3* turn, const int angle_unit);
|
||||
float bgc_fp32_turn3_get_rotation(BGC_FP32_Vector3* const axis, const BGC_FP32_Turn3* const turn, const int angle_unit);
|
||||
|
||||
double bgc_fp64_turn3_get_rotation(BGC_FP64_Vector3* axis, const BGC_FP64_Turn3* turn, const int angle_unit);
|
||||
double bgc_fp64_turn3_get_rotation(BGC_FP64_Vector3* const axis, const BGC_FP64_Turn3* const turn, const int angle_unit);
|
||||
|
||||
// ================ Set Rotation ================ //
|
||||
|
||||
void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* turn, const float x1, const float x2, const float x3, const float angle, const int angle_unit);
|
||||
void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* const turn, const float x1, const float x2, const float x3, const float angle, const int angle_unit);
|
||||
|
||||
void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* turn, const double x1, const double x2, const double x3, const double angle, const int angle_unit);
|
||||
void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* const turn, const double x1, const double x2, const double x3, const double angle, const int angle_unit);
|
||||
|
||||
// ========= Find Direction Difference ========== //
|
||||
|
||||
int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* start, const BGC_FP32_Vector3* end);
|
||||
int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const start, const BGC_FP32_Vector3* const end);
|
||||
|
||||
int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* start, const BGC_FP64_Vector3* end);
|
||||
int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const start, const BGC_FP64_Vector3* const end);
|
||||
|
||||
// ======= Find Direction Pair Difference ======= //
|
||||
|
||||
int bgc_fp32_turn3_find_pair_difference(
|
||||
BGC_FP32_Turn3* turn,
|
||||
const BGC_FP32_Vector3* first_pair_main,
|
||||
const BGC_FP32_Vector3* first_pair_branch,
|
||||
const BGC_FP32_Vector3* second_pair_main,
|
||||
const BGC_FP32_Vector3* second_pair_branch
|
||||
BGC_FP32_Turn3* const turn,
|
||||
const BGC_FP32_Vector3* const first_pair_main,
|
||||
const BGC_FP32_Vector3* const first_pair_branch,
|
||||
const BGC_FP32_Vector3* const second_pair_main,
|
||||
const BGC_FP32_Vector3* const second_pair_branch
|
||||
);
|
||||
|
||||
int bgc_fp64_turn3_find_pair_difference(
|
||||
BGC_FP64_Turn3* turn,
|
||||
const BGC_FP64_Vector3* first_pair_main,
|
||||
const BGC_FP64_Vector3* first_pair_branch,
|
||||
const BGC_FP64_Vector3* second_pair_main,
|
||||
const BGC_FP64_Vector3* second_pair_branch
|
||||
BGC_FP64_Turn3* const turn,
|
||||
const BGC_FP64_Vector3* const first_pair_main,
|
||||
const BGC_FP64_Vector3* const first_pair_branch,
|
||||
const BGC_FP64_Vector3* const second_pair_main,
|
||||
const BGC_FP64_Vector3* const second_pair_branch
|
||||
);
|
||||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_turn3_copy(BGC_FP32_Turn3* destination, const BGC_FP32_Turn3* source)
|
||||
inline void bgc_fp32_turn3_copy(BGC_FP32_Turn3* const destination, const BGC_FP32_Turn3* const source)
|
||||
{
|
||||
bgc_fp32_quaternion_copy(&destination->_versor, &source->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_copy(BGC_FP64_Turn3* destination, const BGC_FP64_Turn3* source)
|
||||
inline void bgc_fp64_turn3_copy(BGC_FP64_Turn3* const destination, const BGC_FP64_Turn3* const source)
|
||||
{
|
||||
bgc_fp64_quaternion_copy(&destination->_versor, &source->_versor);
|
||||
}
|
||||
|
||||
// ==================== Swap ==================== //
|
||||
|
||||
inline void bgc_fp32_turn3_swap(BGC_FP32_Turn3* turn1, BGC_FP32_Turn3* turn2)
|
||||
inline void bgc_fp32_turn3_swap(BGC_FP32_Turn3* const turn1, BGC_FP32_Turn3* const turn2)
|
||||
{
|
||||
bgc_fp32_quaternion_swap(&turn1->_versor, &turn2->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_swap(BGC_FP64_Turn3* turn1, BGC_FP64_Turn3* turn2)
|
||||
inline void bgc_fp64_turn3_swap(BGC_FP64_Turn3* const turn1, BGC_FP64_Turn3* const turn2)
|
||||
{
|
||||
bgc_fp64_quaternion_swap(&turn1->_versor, &turn2->_versor);
|
||||
}
|
||||
|
||||
// ================= Comparison ================= //
|
||||
|
||||
inline int bgc_fp32_turn3_is_idle(const BGC_FP32_Turn3* turn)
|
||||
inline int bgc_fp32_turn3_is_idle(const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
return turn->_versor.x1 * turn->_versor.x1 + turn->_versor.x2 * turn->_versor.x2 + turn->_versor.x3 * turn->_versor.x3 <= BGC_FP32_SQUARE_EPSILON;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_turn3_is_idle(const BGC_FP64_Turn3* turn)
|
||||
inline int bgc_fp64_turn3_is_idle(const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
return turn->_versor.x1 * turn->_versor.x1 + turn->_versor.x2 * turn->_versor.x2 + turn->_versor.x3 * turn->_versor.x3 <= BGC_FP64_SQUARE_EPSILON;
|
||||
}
|
||||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* destination, const BGC_FP32_Turn3* source)
|
||||
inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* const destination, const BGC_FP32_Turn3* const source)
|
||||
{
|
||||
bgc_fp32_quaternion_convert_to_fp64(&destination->_versor, &source->_versor);
|
||||
|
||||
|
|
@ -194,7 +194,7 @@ inline void bgc_fp32_turn3_convert_to_fp64(BGC_FP64_Turn3* destination, const BG
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* destination, const BGC_FP64_Turn3* source)
|
||||
inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* const destination, const BGC_FP64_Turn3* const source)
|
||||
{
|
||||
bgc_fp64_quaternion_convert_to_fp32(&destination->_versor, &source->_versor);
|
||||
|
||||
|
|
@ -207,21 +207,21 @@ inline void bgc_fp64_turn3_convert_to_fp32(BGC_FP32_Turn3* destination, const BG
|
|||
|
||||
// ================== Shorten =================== //
|
||||
|
||||
inline void bgc_fp32_turn3_shorten(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_shorten(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 < 0.0f) {
|
||||
bgc_fp32_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_shorten(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_shorten(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 < 0.0) {
|
||||
bgc_fp64_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* shortened, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* const shortened, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 >= 0.0f) {
|
||||
bgc_fp32_quaternion_copy(&shortened->_versor, &turn->_versor);
|
||||
|
|
@ -231,7 +231,7 @@ inline void bgc_fp32_turn3_get_shortened(BGC_FP32_Turn3* shortened, const BGC_FP
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* shortened, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* const shortened, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
if (turn->_versor.s0 >= 0.0) {
|
||||
bgc_fp64_quaternion_copy(&shortened->_versor, &turn->_versor);
|
||||
|
|
@ -243,57 +243,57 @@ inline void bgc_fp64_turn3_get_shortened(BGC_FP64_Turn3* shortened, const BGC_FP
|
|||
|
||||
// ================= Alternate ================== //
|
||||
|
||||
inline void bgc_fp32_turn3_alternate(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_alternate(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_alternate(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_alternate(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_revert(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn3_get_alternative(BGC_FP32_Turn3* alternative, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_alternative(BGC_FP32_Turn3* const alternative, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_get_reverse(&alternative->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_alternative(BGC_FP64_Turn3* alternative, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_alternative(BGC_FP64_Turn3* const alternative, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_get_reverse(&alternative->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
// =================== Revert =================== //
|
||||
|
||||
inline void bgc_fp32_turn3_revert(BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_revert(BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_conjugate(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_revert(BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_revert(BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_conjugate(&turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp32_turn3_get_reverse(BGC_FP32_Turn3* inverse, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_reverse(BGC_FP32_Turn3* const inverse, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
bgc_fp32_quaternion_get_conjugate(&inverse->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_reverse(BGC_FP64_Turn3* inverse, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_reverse(BGC_FP64_Turn3* const inverse, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
bgc_fp64_quaternion_get_conjugate(&inverse->_versor, &turn->_versor);
|
||||
}
|
||||
|
||||
// =============== Get Exponation =============== //
|
||||
|
||||
void bgc_fp32_turn3_get_power(BGC_FP32_Turn3* power, const BGC_FP32_Turn3* base, const float exponent);
|
||||
void bgc_fp32_turn3_get_power(BGC_FP32_Turn3* const power, const BGC_FP32_Turn3* const base, const float exponent);
|
||||
|
||||
void bgc_fp64_turn3_get_power(BGC_FP64_Turn3* power, const BGC_FP64_Turn3* base, const double exponent);
|
||||
void bgc_fp64_turn3_get_power(BGC_FP64_Turn3* const power, const BGC_FP64_Turn3* const base, const double exponent);
|
||||
|
||||
// ================ Combination ================= //
|
||||
|
||||
inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* combination, const BGC_FP32_Turn3* first, const BGC_FP32_Turn3* second)
|
||||
inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* const combination, const BGC_FP32_Turn3* const first, const BGC_FP32_Turn3* const second)
|
||||
{
|
||||
bgc_fp32_quaternion_multiply_by_quaternion(&combination->_versor, &second->_versor, &first->_versor);
|
||||
|
||||
|
|
@ -304,7 +304,7 @@ inline void bgc_fp32_turn3_combine(BGC_FP32_Turn3* combination, const BGC_FP32_T
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* combination, const BGC_FP64_Turn3* first, const BGC_FP64_Turn3* second)
|
||||
inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* const combination, const BGC_FP64_Turn3* const first, const BGC_FP64_Turn3* const second)
|
||||
{
|
||||
bgc_fp64_quaternion_multiply_by_quaternion(&combination->_versor, &second->_versor, &first->_versor);
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ inline void bgc_fp64_turn3_combine(BGC_FP64_Turn3* combination, const BGC_FP64_T
|
|||
|
||||
// ============ Combination of three ============ //
|
||||
|
||||
inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* combination, const BGC_FP32_Turn3* first, const BGC_FP32_Turn3* second, const BGC_FP32_Turn3* third)
|
||||
inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* const combination, const BGC_FP32_Turn3* const first, const BGC_FP32_Turn3* const second, const BGC_FP32_Turn3* const third)
|
||||
{
|
||||
BGC_FP32_Quaternion product;
|
||||
|
||||
|
|
@ -332,7 +332,7 @@ inline void bgc_fp32_turn3_combine3(BGC_FP32_Turn3* combination, const BGC_FP32_
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* combination, const BGC_FP64_Turn3* first, const BGC_FP64_Turn3* second, const BGC_FP64_Turn3* third)
|
||||
inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* const combination, const BGC_FP64_Turn3* const first, const BGC_FP64_Turn3* const second, const BGC_FP64_Turn3* const third)
|
||||
{
|
||||
BGC_FP64_Quaternion product;
|
||||
|
||||
|
|
@ -349,7 +349,7 @@ inline void bgc_fp64_turn3_combine3(BGC_FP64_Turn3* combination, const BGC_FP64_
|
|||
|
||||
// ================= Exclusion ================== //
|
||||
|
||||
inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* difference, const BGC_FP32_Turn3* base, const BGC_FP32_Turn3* excludant)
|
||||
inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* const difference, const BGC_FP32_Turn3* const base, const BGC_FP32_Turn3* const excludant)
|
||||
{
|
||||
bgc_fp32_quaternion_multiply_by_conjugate(&difference->_versor, &base->_versor, &excludant->_versor);
|
||||
|
||||
|
|
@ -360,7 +360,7 @@ inline void bgc_fp32_turn3_exclude(BGC_FP32_Turn3* difference, const BGC_FP32_Tu
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* difference, const BGC_FP64_Turn3* base, const BGC_FP64_Turn3* excludant)
|
||||
inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* const difference, const BGC_FP64_Turn3* const base, const BGC_FP64_Turn3* const excludant)
|
||||
{
|
||||
bgc_fp64_quaternion_multiply_by_conjugate(&difference->_versor, &base->_versor, &excludant->_versor);
|
||||
|
||||
|
|
@ -373,43 +373,43 @@ inline void bgc_fp64_turn3_exclude(BGC_FP64_Turn3* difference, const BGC_FP64_Tu
|
|||
|
||||
// ============ Sphere Interpolation ============ //
|
||||
|
||||
void bgc_fp32_turn3_spherically_interpolate(BGC_FP32_Turn3* interpolation, const BGC_FP32_Turn3* start, const BGC_FP32_Turn3* end, const float phase);
|
||||
void bgc_fp32_turn3_spherically_interpolate(BGC_FP32_Turn3* const interpolation, const BGC_FP32_Turn3* const start, const BGC_FP32_Turn3* const end, const float phase);
|
||||
|
||||
void bgc_fp64_turn3_spherically_interpolate(BGC_FP64_Turn3* interpolation, const BGC_FP64_Turn3* start, const BGC_FP64_Turn3* end, const double phase);
|
||||
void bgc_fp64_turn3_spherically_interpolate(BGC_FP64_Turn3* const interpolation, const BGC_FP64_Turn3* const start, const BGC_FP64_Turn3* const end, const double phase);
|
||||
|
||||
// ============ Get Rotation Matrix ============= //
|
||||
|
||||
inline void bgc_fp32_turn3_get_rotation_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_rotation_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp32_versor_get_rotation_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_rotation_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_rotation_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp64_versor_get_rotation_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
// ============= Get Reverse Matrix ============= //
|
||||
|
||||
inline void bgc_fp32_turn3_get_reverse_matrix(BGC_FP32_Matrix3x3* matrix, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_reverse_matrix(BGC_FP32_Matrix3x3* const matrix, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp32_versor_get_reverse_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_reverse_matrix(BGC_FP64_Matrix3x3* matrix, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_reverse_matrix(BGC_FP64_Matrix3x3* const matrix, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp64_versor_get_reverse_matrix(matrix, &turn->_versor);
|
||||
}
|
||||
|
||||
// ============= Get Both Matrixes ============== //
|
||||
|
||||
inline void bgc_fp32_turn3_get_both_matrices(BGC_FP32_Matrix3x3* rotation, BGC_FP32_Matrix3x3* reverse, const BGC_FP32_Turn3* turn)
|
||||
inline void bgc_fp32_turn3_get_both_matrices(BGC_FP32_Matrix3x3* const rotation, BGC_FP32_Matrix3x3* const reverse, const BGC_FP32_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp32_versor_get_reverse_matrix(reverse, &turn->_versor);
|
||||
bgc_fp32_matrix3x3_get_transposed(rotation, reverse);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* rotation, BGC_FP64_Matrix3x3* reverse, const BGC_FP64_Turn3* turn)
|
||||
inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* const rotation, BGC_FP64_Matrix3x3* const reverse, const BGC_FP64_Turn3* const turn)
|
||||
{
|
||||
_bgc_fp64_versor_get_reverse_matrix(reverse, &turn->_versor);
|
||||
bgc_fp64_matrix3x3_get_transposed(rotation, reverse);
|
||||
|
|
@ -417,38 +417,38 @@ inline void bgc_fp64_turn3_get_both_matrices(BGC_FP64_Matrix3x3* rotation, BGC_F
|
|||
|
||||
// ================ Turn Vector ================= //
|
||||
|
||||
inline void bgc_fp32_turn3_vector(BGC_FP32_Vector3* turned_vector, const BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* original_vector)
|
||||
inline void bgc_fp32_turn3_vector(BGC_FP32_Vector3* const turned_vector, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp32_versor_turn_vector(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_vector(BGC_FP64_Vector3* turned_vector, const BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* original_vector)
|
||||
inline void bgc_fp64_turn3_vector(BGC_FP64_Vector3* const turned_vector, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp64_versor_turn_vector(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
// ============== Turn Vector Back ============== //
|
||||
|
||||
inline void bgc_fp32_turn3_vector_back(BGC_FP32_Vector3* turned_vector, const BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* original_vector)
|
||||
inline void bgc_fp32_turn3_vector_back(BGC_FP32_Vector3* const turned_vector, const BGC_FP32_Turn3* const turn, const BGC_FP32_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp32_versor_turn_vector_back(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_turn3_vector_back(BGC_FP64_Vector3* turned_vector, const BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* original_vector)
|
||||
inline void bgc_fp64_turn3_vector_back(BGC_FP64_Vector3* const turned_vector, const BGC_FP64_Turn3* const turn, const BGC_FP64_Vector3* const original_vector)
|
||||
{
|
||||
_bgc_fp64_versor_turn_vector_back(turned_vector, &turn->_versor, original_vector);
|
||||
}
|
||||
|
||||
// ================== Are Close ================= //
|
||||
|
||||
inline int bgc_fp32_turn3_are_close(const BGC_FP32_Turn3* turn1, const BGC_FP32_Turn3* turn2)
|
||||
inline int bgc_fp32_turn3_are_close(const BGC_FP32_Turn3* const turn1, const BGC_FP32_Turn3* const turn2)
|
||||
{
|
||||
BGC_FP32_Quaternion difference;
|
||||
bgc_fp32_quaternion_subtract(&difference, &turn1->_versor, &turn2->_versor);
|
||||
return bgc_fp32_quaternion_get_square_magnitude(&difference) <= BGC_FP32_SQUARE_EPSILON;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_turn3_are_close(const BGC_FP64_Turn3* turn1, const BGC_FP64_Turn3* turn2)
|
||||
inline int bgc_fp64_turn3_are_close(const BGC_FP64_Turn3* const turn1, const BGC_FP64_Turn3* const turn2)
|
||||
{
|
||||
BGC_FP64_Quaternion difference;
|
||||
bgc_fp64_quaternion_subtract(&difference, &turn1->_versor, &turn2->_versor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue