Переход на парадигму Destination first в порядке параметров функий
This commit is contained in:
parent
f7e41645fe
commit
03627f4401
41 changed files with 1570 additions and 1978 deletions
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
#include "angle.h"
|
||||
#include "vector2.h"
|
||||
#include "matrixes.h"
|
||||
#include "matrices.h"
|
||||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
|
|
@ -43,7 +43,7 @@ inline void bgc_fp64_matrix2x2_make_identity(BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// ================ Set Diagonal ================ //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_make_diagonal(const float d1, const float d2, BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_make_diagonal(BGC_FP32_Matrix2x2* matrix, const float d1, const float d2)
|
||||
{
|
||||
matrix->r1c1 = d1;
|
||||
matrix->r1c2 = 0.0f;
|
||||
|
|
@ -51,7 +51,7 @@ inline void bgc_fp32_matrix2x2_make_diagonal(const float d1, const float d2, BGC
|
|||
matrix->r2c2 = d2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_make_diagonal(const double d1, const double d2, BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_make_diagonal(BGC_FP64_Matrix2x2* matrix, const double d1, const double d2)
|
||||
{
|
||||
matrix->r1c1 = d1;
|
||||
matrix->r1c2 = 0.0;
|
||||
|
|
@ -61,7 +61,7 @@ inline void bgc_fp64_matrix2x2_make_diagonal(const double d1, const double d2, B
|
|||
|
||||
// ============== Rotation Matrix =============== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_make_for_turn(const float angle, const int angle_unit, BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_make_for_turn(BGC_FP32_Matrix2x2* matrix, const float angle, const int angle_unit)
|
||||
{
|
||||
const float radians = bgc_fp32_angle_to_radians(angle, angle_unit);
|
||||
const float cosine = cosf(radians);
|
||||
|
|
@ -73,7 +73,7 @@ inline void bgc_fp32_matrix2x2_make_for_turn(const float angle, const int angle_
|
|||
matrix->r2c2 = cosine;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_make_for_turn(const double angle, const int angle_unit, BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_make_for_turn(BGC_FP64_Matrix2x2* matrix, const double angle, const int angle_unit)
|
||||
{
|
||||
const double radians = bgc_fp64_angle_to_radians(angle, angle_unit);
|
||||
const double cosine = cos(radians);
|
||||
|
|
@ -153,7 +153,7 @@ inline int bgc_fp64_matrix2x2_is_rotation(const BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_copy(const BGC_FP32_Matrix2x2* source, BGC_FP32_Matrix2x2* destination)
|
||||
inline void bgc_fp32_matrix2x2_copy(BGC_FP32_Matrix2x2* destination, const BGC_FP32_Matrix2x2* source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -162,7 +162,7 @@ inline void bgc_fp32_matrix2x2_copy(const BGC_FP32_Matrix2x2* source, BGC_FP32_M
|
|||
destination->r2c2 = source->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_copy(const BGC_FP64_Matrix2x2* source, BGC_FP64_Matrix2x2* destination)
|
||||
inline void bgc_fp64_matrix2x2_copy(BGC_FP64_Matrix2x2* destination, const BGC_FP64_Matrix2x2* source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -217,7 +217,7 @@ inline void bgc_fp64_matrix2x2_swap(BGC_FP64_Matrix2x2* matrix1, BGC_FP64_Matrix
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_matrix2x2_convert_to_fp32(const BGC_FP64_Matrix2x2* source, BGC_FP32_Matrix2x2* destination)
|
||||
inline void bgc_fp64_matrix2x2_convert_to_fp32(BGC_FP32_Matrix2x2* destination, const BGC_FP64_Matrix2x2* source)
|
||||
{
|
||||
destination->r1c1 = (float)source->r1c1;
|
||||
destination->r1c2 = (float)source->r1c2;
|
||||
|
|
@ -226,7 +226,7 @@ inline void bgc_fp64_matrix2x2_convert_to_fp32(const BGC_FP64_Matrix2x2* source,
|
|||
destination->r2c2 = (float)source->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_matrix2x2_convert_to_fp64(const BGC_FP32_Matrix2x2* source, BGC_FP64_Matrix2x2* destination)
|
||||
inline void bgc_fp32_matrix2x2_convert_to_fp64(BGC_FP64_Matrix2x2* destination, const BGC_FP32_Matrix2x2* source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -237,7 +237,7 @@ inline void bgc_fp32_matrix2x2_convert_to_fp64(const BGC_FP32_Matrix2x2* source,
|
|||
|
||||
// ================ Get Inverse ================= //
|
||||
|
||||
inline int bgc_fp32_matrix2x2_get_inverse(const BGC_FP32_Matrix2x2* matrix, BGC_FP32_Matrix2x2* inverse)
|
||||
inline int bgc_fp32_matrix2x2_get_inverse(BGC_FP32_Matrix2x2* inverse, const BGC_FP32_Matrix2x2* matrix)
|
||||
{
|
||||
const float determinant = bgc_fp32_matrix2x2_get_determinant(matrix);
|
||||
|
||||
|
|
@ -262,7 +262,7 @@ inline int bgc_fp32_matrix2x2_get_inverse(const BGC_FP32_Matrix2x2* matrix, BGC_
|
|||
return 1;
|
||||
}
|
||||
|
||||
inline int bgc_fp64_matrix2x2_get_inverse(const BGC_FP64_Matrix2x2* matrix, BGC_FP64_Matrix2x2* inverse)
|
||||
inline int bgc_fp64_matrix2x2_get_inverse(BGC_FP64_Matrix2x2* inverse, const BGC_FP64_Matrix2x2* matrix)
|
||||
{
|
||||
const double determinant = bgc_fp64_matrix2x2_get_determinant(matrix);
|
||||
|
||||
|
|
@ -317,7 +317,7 @@ inline void bgc_fp64_matrix2x2_transpose(BGC_FP64_Matrix2x2* matrix)
|
|||
|
||||
// =============== Get Transpose ================ //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_transposed(const BGC_FP32_Matrix2x2* matrix, BGC_FP32_Matrix2x2* transposed)
|
||||
inline void bgc_fp32_matrix2x2_get_transposed(BGC_FP32_Matrix2x2* transposed, const BGC_FP32_Matrix2x2* matrix)
|
||||
{
|
||||
const float r1c2 = matrix->r1c2;
|
||||
|
||||
|
|
@ -328,7 +328,7 @@ inline void bgc_fp32_matrix2x2_get_transposed(const BGC_FP32_Matrix2x2* matrix,
|
|||
transposed->r2c2 = matrix->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_transposed(const BGC_FP64_Matrix2x2* matrix, BGC_FP64_Matrix2x2* transposed)
|
||||
inline void bgc_fp64_matrix2x2_get_transposed(BGC_FP64_Matrix2x2* transposed, const BGC_FP64_Matrix2x2* matrix)
|
||||
{
|
||||
const double r1c2 = matrix->r1c2;
|
||||
|
||||
|
|
@ -341,15 +341,15 @@ inline void bgc_fp64_matrix2x2_get_transposed(const BGC_FP64_Matrix2x2* matrix,
|
|||
|
||||
// ================== Get Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_row(const int number, const BGC_FP32_Matrix2x2* matrix, BGC_FP32_Vector2* row)
|
||||
inline void bgc_fp32_matrix2x2_get_row(BGC_FP32_Vector2* row, const BGC_FP32_Matrix2x2* matrix, const int row_number)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (row_number == 2) {
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
return;
|
||||
|
|
@ -359,15 +359,15 @@ inline void bgc_fp32_matrix2x2_get_row(const int number, const BGC_FP32_Matrix2x
|
|||
row->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_row(const int number, const BGC_FP64_Matrix2x2* matrix, BGC_FP64_Vector2* row)
|
||||
inline void bgc_fp64_matrix2x2_get_row(BGC_FP64_Vector2* row, const BGC_FP64_Matrix2x2* matrix, const int row_number)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (row_number == 1) {
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (row_number == 2) {
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
return;
|
||||
|
|
@ -379,29 +379,29 @@ inline void bgc_fp64_matrix2x2_get_row(const int number, const BGC_FP64_Matrix2x
|
|||
|
||||
// ================== Set Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_set_row(const int number, const BGC_FP32_Vector2* row, BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_set_row(BGC_FP32_Matrix2x2* matrix, const int row_number, const BGC_FP32_Vector2* row)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (row_number == 2) {
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_set_row(const int number, const BGC_FP64_Vector2* row, BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_set_row(BGC_FP64_Matrix2x2* matrix, const int row_number, const BGC_FP64_Vector2* row)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (row_number == 1) {
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (row_number == 2) {
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
}
|
||||
|
|
@ -409,15 +409,15 @@ inline void bgc_fp64_matrix2x2_set_row(const int number, const BGC_FP64_Vector2*
|
|||
|
||||
// ================= Get Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_get_column(const int number, const BGC_FP32_Matrix2x2* matrix, BGC_FP32_Vector2* column)
|
||||
inline void bgc_fp32_matrix2x2_get_column(BGC_FP32_Vector2* column, const BGC_FP32_Matrix2x2* matrix, const int column_number)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (column_number == 2) {
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
return;
|
||||
|
|
@ -427,15 +427,15 @@ inline void bgc_fp32_matrix2x2_get_column(const int number, const BGC_FP32_Matri
|
|||
column->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_get_column(const int number, const BGC_FP64_Matrix2x2* matrix, BGC_FP64_Vector2* column)
|
||||
inline void bgc_fp64_matrix2x2_get_column(BGC_FP64_Vector2* column, const BGC_FP64_Matrix2x2* matrix, const int column_number)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (column_number == 1) {
|
||||
column->x1 = matrix->r1c1;
|
||||
column->x2 = matrix->r2c1;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (column_number == 2) {
|
||||
column->x1 = matrix->r1c2;
|
||||
column->x2 = matrix->r2c2;
|
||||
return;
|
||||
|
|
@ -447,29 +447,29 @@ inline void bgc_fp64_matrix2x2_get_column(const int number, const BGC_FP64_Matri
|
|||
|
||||
// ================= Set Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_set_column(const int number, const BGC_FP32_Vector2* column, BGC_FP32_Matrix2x2* matrix)
|
||||
inline void bgc_fp32_matrix2x2_set_column(BGC_FP32_Matrix2x2* matrix, const int column_number, const BGC_FP32_Vector2* column)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (column_number == 2) {
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_set_column(const int number, const BGC_FP64_Vector2* column, BGC_FP64_Matrix2x2* matrix)
|
||||
inline void bgc_fp64_matrix2x2_set_column(BGC_FP64_Matrix2x2* matrix, const int column_number, const BGC_FP64_Vector2* column)
|
||||
{
|
||||
if (number == 1) {
|
||||
if (column_number == 1) {
|
||||
matrix->r1c1 = column->x1;
|
||||
matrix->r2c1 = column->x2;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
if (column_number == 2) {
|
||||
matrix->r1c2 = column->x1;
|
||||
matrix->r2c2 = column->x2;
|
||||
}
|
||||
|
|
@ -477,7 +477,7 @@ inline void bgc_fp64_matrix2x2_set_column(const int number, const BGC_FP64_Vecto
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_add(const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix2x2* matrix2, BGC_FP32_Matrix2x2* sum)
|
||||
inline void bgc_fp32_matrix2x2_add(BGC_FP32_Matrix2x2* sum, const BGC_FP32_Matrix2x2* matrix1, const BGC_FP32_Matrix2x2* matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -486,7 +486,7 @@ inline void bgc_fp32_matrix2x2_add(const BGC_FP32_Matrix2x2* matrix1, const BGC_
|
|||
sum->r2c2 = matrix1->r2c2 + matrix2->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_add(const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix2x2* matrix2, BGC_FP64_Matrix2x2* sum)
|
||||
inline void bgc_fp64_matrix2x2_add(BGC_FP64_Matrix2x2* sum, const BGC_FP64_Matrix2x2* matrix1, const BGC_FP64_Matrix2x2* matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -497,7 +497,7 @@ inline void bgc_fp64_matrix2x2_add(const BGC_FP64_Matrix2x2* matrix1, const BGC_
|
|||
|
||||
// ================= Add scaled ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_add_scaled(const BGC_FP32_Matrix2x2* basic_matrix, const BGC_FP32_Matrix2x2* scalable_matrix, const float scale, BGC_FP32_Matrix2x2* sum)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -506,7 +506,7 @@ inline void bgc_fp32_matrix2x2_add_scaled(const BGC_FP32_Matrix2x2* basic_matrix
|
|||
sum->r2c2 = basic_matrix->r2c2 + scalable_matrix->r2c2 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_add_scaled(const BGC_FP64_Matrix2x2* basic_matrix, const BGC_FP64_Matrix2x2* scalable_matrix, const double scale, BGC_FP64_Matrix2x2* sum)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -517,7 +517,7 @@ inline void bgc_fp64_matrix2x2_add_scaled(const BGC_FP64_Matrix2x2* basic_matrix
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_subtract(const BGC_FP32_Matrix2x2* minuend, const BGC_FP32_Matrix2x2* subtrahend, BGC_FP32_Matrix2x2* difference)
|
||||
inline void bgc_fp32_matrix2x2_subtract(BGC_FP32_Matrix2x2* difference, const BGC_FP32_Matrix2x2* minuend, const BGC_FP32_Matrix2x2* subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -526,7 +526,7 @@ inline void bgc_fp32_matrix2x2_subtract(const BGC_FP32_Matrix2x2* minuend, const
|
|||
difference->r2c2 = minuend->r2c2 - subtrahend->r2c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_subtract(const BGC_FP64_Matrix2x2* minuend, const BGC_FP64_Matrix2x2* subtrahend, BGC_FP64_Matrix2x2* difference)
|
||||
inline void bgc_fp64_matrix2x2_subtract(BGC_FP64_Matrix2x2* difference, const BGC_FP64_Matrix2x2* minuend, const BGC_FP64_Matrix2x2* subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -537,7 +537,7 @@ inline void bgc_fp64_matrix2x2_subtract(const BGC_FP64_Matrix2x2* minuend, const
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_multiply(const BGC_FP32_Matrix2x2* multiplicand, const float multiplier, BGC_FP32_Matrix2x2* product)
|
||||
inline void bgc_fp32_matrix2x2_multiply(BGC_FP32_Matrix2x2* product, const BGC_FP32_Matrix2x2* multiplicand, const float multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -546,7 +546,7 @@ inline void bgc_fp32_matrix2x2_multiply(const BGC_FP32_Matrix2x2* multiplicand,
|
|||
product->r2c2 = multiplicand->r2c2 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_multiply(const BGC_FP64_Matrix2x2* multiplicand, const double multiplier, BGC_FP64_Matrix2x2* product)
|
||||
inline void bgc_fp64_matrix2x2_multiply(BGC_FP64_Matrix2x2* product, const BGC_FP64_Matrix2x2* multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -557,19 +557,19 @@ inline void bgc_fp64_matrix2x2_multiply(const BGC_FP64_Matrix2x2* multiplicand,
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_divide(const BGC_FP32_Matrix2x2* dividend, const float divisor, BGC_FP32_Matrix2x2* quotient)
|
||||
inline void bgc_fp32_matrix2x2_divide(BGC_FP32_Matrix2x2* quotient, const BGC_FP32_Matrix2x2* dividend, const float divisor)
|
||||
{
|
||||
bgc_fp32_matrix2x2_multiply(dividend, 1.0f / divisor, quotient);
|
||||
bgc_fp32_matrix2x2_multiply(quotient, dividend, 1.0f / divisor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_divide(const BGC_FP64_Matrix2x2* dividend, const double divisor, BGC_FP64_Matrix2x2* quotient)
|
||||
inline void bgc_fp64_matrix2x2_divide(BGC_FP64_Matrix2x2* quotient, const BGC_FP64_Matrix2x2* dividend, const double divisor)
|
||||
{
|
||||
bgc_fp64_matrix2x2_multiply(dividend, 1.0 / divisor, quotient);
|
||||
bgc_fp64_matrix2x2_multiply(quotient, dividend, 1.0 / divisor);
|
||||
}
|
||||
|
||||
// ================ Interpolate ================= //
|
||||
|
||||
inline void bgc_fp32_matrix2x2_interpolate(const BGC_FP32_Matrix2x2* first, const BGC_FP32_Matrix2x2* second, const float phase, BGC_FP32_Matrix2x2* interpolation)
|
||||
inline void bgc_fp32_matrix2x2_interpolate(BGC_FP32_Matrix2x2* interpolation, const BGC_FP32_Matrix2x2* first, const BGC_FP32_Matrix2x2* second, const float phase)
|
||||
{
|
||||
const float counter_phase = 1.0f - phase;
|
||||
|
||||
|
|
@ -580,7 +580,7 @@ inline void bgc_fp32_matrix2x2_interpolate(const BGC_FP32_Matrix2x2* first, cons
|
|||
interpolation->r2c2 = first->r2c2 * counter_phase + second->r2c2 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix2x2_interpolate(const BGC_FP64_Matrix2x2* first, const BGC_FP64_Matrix2x2* second, const double phase, BGC_FP64_Matrix2x2* interpolation)
|
||||
inline void bgc_fp64_matrix2x2_interpolate(BGC_FP64_Matrix2x2* interpolation, const BGC_FP64_Matrix2x2* first, const BGC_FP64_Matrix2x2* second, const double phase)
|
||||
{
|
||||
const double counter_phase = 1.0 - phase;
|
||||
|
||||
|
|
@ -593,7 +593,7 @@ inline void bgc_fp64_matrix2x2_interpolate(const BGC_FP64_Matrix2x2* first, cons
|
|||
|
||||
// ============ Right Vector Product ============ //
|
||||
|
||||
inline void bgc_fp32_multiply_matrix2x2_by_vector2(const BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Vector2* vector, BGC_FP32_Vector2* product)
|
||||
inline void bgc_fp32_multiply_matrix2x2_by_vector2(BGC_FP32_Vector2* product, const BGC_FP32_Matrix2x2* matrix, const BGC_FP32_Vector2* vector)
|
||||
{
|
||||
const float x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
const float x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
|
|
@ -602,7 +602,7 @@ inline void bgc_fp32_multiply_matrix2x2_by_vector2(const BGC_FP32_Matrix2x2* mat
|
|||
product->x2 = x2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_multiply_matrix2x2_by_vector2(const BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Vector2* vector, BGC_FP64_Vector2* product)
|
||||
inline void bgc_fp64_multiply_matrix2x2_by_vector2(BGC_FP64_Vector2* product, const BGC_FP64_Matrix2x2* matrix, const BGC_FP64_Vector2* vector)
|
||||
{
|
||||
const double x1 = matrix->r1c1 * vector->x1 + matrix->r1c2 * vector->x2;
|
||||
const double x2 = matrix->r2c1 * vector->x1 + matrix->r2c2 * vector->x2;
|
||||
|
|
@ -613,7 +613,7 @@ inline void bgc_fp64_multiply_matrix2x2_by_vector2(const BGC_FP64_Matrix2x2* mat
|
|||
|
||||
// ============ Left Vector Product ============= //
|
||||
|
||||
inline void bgc_fp32_multiply_vector2_by_matrix2x2(const BGC_FP32_Vector2* vector, const BGC_FP32_Matrix2x2* matrix, BGC_FP32_Vector2* product)
|
||||
inline void bgc_fp32_multiply_vector2_by_matrix2x2(BGC_FP32_Vector2* product, const BGC_FP32_Vector2* vector, const BGC_FP32_Matrix2x2* matrix)
|
||||
{
|
||||
const float x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||
const float x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||
|
|
@ -622,7 +622,7 @@ inline void bgc_fp32_multiply_vector2_by_matrix2x2(const BGC_FP32_Vector2* vecto
|
|||
product->x2 = x2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_multiply_vector2_by_matrix2x2(const BGC_FP64_Vector2* vector, const BGC_FP64_Matrix2x2* matrix, BGC_FP64_Vector2* product)
|
||||
inline void bgc_fp64_multiply_vector2_by_matrix2x2(BGC_FP64_Vector2* product, const BGC_FP64_Vector2* vector, const BGC_FP64_Matrix2x2* matrix)
|
||||
{
|
||||
const double x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||
const double x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue