Переход на парадигму 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 "vector2.h"
|
||||
#include "vector3.h"
|
||||
#include "matrixes.h"
|
||||
#include "matrices.h"
|
||||
|
||||
// =================== Reset ==================== //
|
||||
|
||||
|
|
@ -31,7 +31,7 @@ inline void bgc_fp64_matrix3x2_reset(BGC_FP64_Matrix3x2* matrix)
|
|||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_copy(const BGC_FP32_Matrix3x2* source, BGC_FP32_Matrix3x2* destination)
|
||||
inline void bgc_fp32_matrix3x2_copy(BGC_FP32_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -42,7 +42,7 @@ inline void bgc_fp32_matrix3x2_copy(const BGC_FP32_Matrix3x2* source, BGC_FP32_M
|
|||
destination->r2c3 = source->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_copy(const BGC_FP64_Matrix3x2* source, BGC_FP64_Matrix3x2* destination)
|
||||
inline void bgc_fp64_matrix3x2_copy(BGC_FP64_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -111,7 +111,7 @@ inline void bgc_fp64_matrix3x2_swap(BGC_FP64_Matrix3x2* matrix1, BGC_FP64_Matrix
|
|||
|
||||
// ================== Convert =================== //
|
||||
|
||||
inline void bgc_fp64_matrix3x2_convert_to_fp32(const BGC_FP64_Matrix3x2* source, BGC_FP32_Matrix3x2* destination)
|
||||
inline void bgc_fp64_matrix3x2_convert_to_fp32(BGC_FP32_Matrix3x2* destination, const BGC_FP64_Matrix3x2* source)
|
||||
{
|
||||
destination->r1c1 = (float)source->r1c1;
|
||||
destination->r1c2 = (float)source->r1c2;
|
||||
|
|
@ -122,7 +122,7 @@ inline void bgc_fp64_matrix3x2_convert_to_fp32(const BGC_FP64_Matrix3x2* source,
|
|||
destination->r2c3 = (float)source->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp32_matrix3x2_convert_to_fp64(const BGC_FP32_Matrix3x2* source, BGC_FP64_Matrix3x2* destination)
|
||||
inline void bgc_fp32_matrix3x2_convert_to_fp64(BGC_FP64_Matrix3x2* destination, const BGC_FP32_Matrix3x2* source)
|
||||
{
|
||||
destination->r1c1 = source->r1c1;
|
||||
destination->r1c2 = source->r1c2;
|
||||
|
|
@ -135,7 +135,7 @@ inline void bgc_fp32_matrix3x2_convert_to_fp64(const BGC_FP32_Matrix3x2* source,
|
|||
|
||||
// ================= Transpose ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_transposed(const BGC_FP32_Matrix2x3* matrix, BGC_FP32_Matrix3x2* transposed)
|
||||
inline void bgc_fp32_matrix3x2_get_transposed(BGC_FP32_Matrix3x2* transposed, const BGC_FP32_Matrix2x3* matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -146,7 +146,7 @@ inline void bgc_fp32_matrix3x2_get_transposed(const BGC_FP32_Matrix2x3* matrix,
|
|||
transposed->r2c3 = matrix->r3c2;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_transposed(const BGC_FP64_Matrix2x3* matrix, BGC_FP64_Matrix3x2* transposed)
|
||||
inline void bgc_fp64_matrix3x2_get_transposed(BGC_FP64_Matrix3x2* transposed, const BGC_FP64_Matrix2x3* matrix)
|
||||
{
|
||||
transposed->r1c1 = matrix->r1c1;
|
||||
transposed->r1c2 = matrix->r2c1;
|
||||
|
|
@ -159,9 +159,9 @@ inline void bgc_fp64_matrix3x2_get_transposed(const BGC_FP64_Matrix2x3* matrix,
|
|||
|
||||
// ================== Get Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_row(const int number, const BGC_FP32_Matrix3x2* matrix, BGC_FP32_Vector3* row)
|
||||
inline void bgc_fp32_matrix3x2_get_row(BGC_FP32_Vector3* row, const BGC_FP32_Matrix3x2* matrix, const int row_number)
|
||||
{
|
||||
if (number == 1)
|
||||
if (row_number == 1)
|
||||
{
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
|
|
@ -169,7 +169,7 @@ inline void bgc_fp32_matrix3x2_get_row(const int number, const BGC_FP32_Matrix3x
|
|||
return;
|
||||
}
|
||||
|
||||
if (number == 2)
|
||||
if (row_number == 2)
|
||||
{
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
|
|
@ -182,9 +182,9 @@ inline void bgc_fp32_matrix3x2_get_row(const int number, const BGC_FP32_Matrix3x
|
|||
row->x3 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_row(const int number, const BGC_FP64_Matrix3x2* matrix, BGC_FP64_Vector3* row)
|
||||
inline void bgc_fp64_matrix3x2_get_row(BGC_FP64_Vector3* row, const BGC_FP64_Matrix3x2* matrix, const int row_number)
|
||||
{
|
||||
if (number == 1)
|
||||
if (row_number == 1)
|
||||
{
|
||||
row->x1 = matrix->r1c1;
|
||||
row->x2 = matrix->r1c2;
|
||||
|
|
@ -192,7 +192,7 @@ inline void bgc_fp64_matrix3x2_get_row(const int number, const BGC_FP64_Matrix3x
|
|||
return;
|
||||
}
|
||||
|
||||
if (number == 2)
|
||||
if (row_number == 2)
|
||||
{
|
||||
row->x1 = matrix->r2c1;
|
||||
row->x2 = matrix->r2c2;
|
||||
|
|
@ -207,9 +207,9 @@ inline void bgc_fp64_matrix3x2_get_row(const int number, const BGC_FP64_Matrix3x
|
|||
|
||||
// ================== Set Row =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_set_row(const int number, const BGC_FP32_Vector3* row, BGC_FP32_Matrix3x2* matrix)
|
||||
inline void bgc_fp32_matrix3x2_set_row(BGC_FP32_Matrix3x2* matrix, const int row_number, const BGC_FP32_Vector3* row)
|
||||
{
|
||||
if (number == 1)
|
||||
if (row_number == 1)
|
||||
{
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
|
|
@ -217,7 +217,7 @@ inline void bgc_fp32_matrix3x2_set_row(const int number, const BGC_FP32_Vector3*
|
|||
return;
|
||||
}
|
||||
|
||||
if (number == 2)
|
||||
if (row_number == 2)
|
||||
{
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
|
|
@ -225,9 +225,9 @@ inline void bgc_fp32_matrix3x2_set_row(const int number, const BGC_FP32_Vector3*
|
|||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_set_row(const int number, const BGC_FP64_Vector3* row, BGC_FP64_Matrix3x2* matrix)
|
||||
inline void bgc_fp64_matrix3x2_set_row(BGC_FP64_Matrix3x2* matrix, const int row_number, const BGC_FP64_Vector3* row)
|
||||
{
|
||||
if (number == 1)
|
||||
if (row_number == 1)
|
||||
{
|
||||
matrix->r1c1 = row->x1;
|
||||
matrix->r1c2 = row->x2;
|
||||
|
|
@ -235,7 +235,7 @@ inline void bgc_fp64_matrix3x2_set_row(const int number, const BGC_FP64_Vector3*
|
|||
return;
|
||||
}
|
||||
|
||||
if (number == 2)
|
||||
if (row_number == 2)
|
||||
{
|
||||
matrix->r2c1 = row->x1;
|
||||
matrix->r2c2 = row->x2;
|
||||
|
|
@ -245,23 +245,23 @@ inline void bgc_fp64_matrix3x2_set_row(const int number, const BGC_FP64_Vector3*
|
|||
|
||||
// ================= Get Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_get_column(const int number, const BGC_FP32_Matrix3x2* matrix, BGC_FP32_Vector2* column)
|
||||
inline void bgc_fp32_matrix3x2_get_column(BGC_FP32_Vector2* column, const BGC_FP32_Matrix3x2* 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;
|
||||
}
|
||||
|
||||
if (number == 3)
|
||||
if (column_number == 3)
|
||||
{
|
||||
column->x1 = matrix->r1c3;
|
||||
column->x2 = matrix->r2c3;
|
||||
|
|
@ -272,23 +272,23 @@ inline void bgc_fp32_matrix3x2_get_column(const int number, const BGC_FP32_Matri
|
|||
column->x2 = 0.0f;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_get_column(const int number, const BGC_FP64_Matrix3x2* matrix, BGC_FP64_Vector2* column)
|
||||
inline void bgc_fp64_matrix3x2_get_column(BGC_FP64_Vector2* column, const BGC_FP64_Matrix3x2* 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;
|
||||
}
|
||||
|
||||
if (number == 3)
|
||||
if (column_number == 3)
|
||||
{
|
||||
column->x1 = matrix->r1c3;
|
||||
column->x2 = matrix->r2c3;
|
||||
|
|
@ -301,46 +301,46 @@ inline void bgc_fp64_matrix3x2_get_column(const int number, const BGC_FP64_Matri
|
|||
|
||||
// ================= Set Column ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_set_column(const int number, const BGC_FP32_Vector2* column, BGC_FP32_Matrix3x2* matrix)
|
||||
inline void bgc_fp32_matrix3x2_set_column(BGC_FP32_Matrix3x2* 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;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 3)
|
||||
if (column_number == 3)
|
||||
{
|
||||
matrix->r1c3 = column->x1;
|
||||
matrix->r2c3 = column->x2;
|
||||
}
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_set_column(const int number, const BGC_FP64_Vector2* column, BGC_FP64_Matrix3x2* matrix)
|
||||
inline void bgc_fp64_matrix3x2_set_column(BGC_FP64_Matrix3x2* 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;
|
||||
return;
|
||||
}
|
||||
|
||||
if (number == 3)
|
||||
if (column_number == 3)
|
||||
{
|
||||
matrix->r1c3 = column->x1;
|
||||
matrix->r2c3 = column->x2;
|
||||
|
|
@ -349,7 +349,7 @@ inline void bgc_fp64_matrix3x2_set_column(const int number, const BGC_FP64_Vecto
|
|||
|
||||
// ==================== Add ===================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_add(const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x2* matrix2, BGC_FP32_Matrix3x2* sum)
|
||||
inline void bgc_fp32_matrix3x2_add(BGC_FP32_Matrix3x2* sum, const BGC_FP32_Matrix3x2* matrix1, const BGC_FP32_Matrix3x2* matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -360,7 +360,7 @@ inline void bgc_fp32_matrix3x2_add(const BGC_FP32_Matrix3x2* matrix1, const BGC_
|
|||
sum->r2c3 = matrix1->r2c3 + matrix2->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_add(const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x2* matrix2, BGC_FP64_Matrix3x2* sum)
|
||||
inline void bgc_fp64_matrix3x2_add(BGC_FP64_Matrix3x2* sum, const BGC_FP64_Matrix3x2* matrix1, const BGC_FP64_Matrix3x2* matrix2)
|
||||
{
|
||||
sum->r1c1 = matrix1->r1c1 + matrix2->r1c1;
|
||||
sum->r1c2 = matrix1->r1c2 + matrix2->r1c2;
|
||||
|
|
@ -373,7 +373,7 @@ inline void bgc_fp64_matrix3x2_add(const BGC_FP64_Matrix3x2* matrix1, const BGC_
|
|||
|
||||
// ================= Add scaled ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_add_scaled(const BGC_FP32_Matrix3x2* basic_matrix, const BGC_FP32_Matrix3x2* scalable_matrix, const float scale, BGC_FP32_Matrix3x2* sum)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -384,7 +384,7 @@ inline void bgc_fp32_matrix3x2_add_scaled(const BGC_FP32_Matrix3x2* basic_matrix
|
|||
sum->r2c3 = basic_matrix->r2c3 + scalable_matrix->r2c3 * scale;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_add_scaled(const BGC_FP64_Matrix3x2* basic_matrix, const BGC_FP64_Matrix3x2* scalable_matrix, const double scale, BGC_FP64_Matrix3x2* sum)
|
||||
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)
|
||||
{
|
||||
sum->r1c1 = basic_matrix->r1c1 + scalable_matrix->r1c1 * scale;
|
||||
sum->r1c2 = basic_matrix->r1c2 + scalable_matrix->r1c2 * scale;
|
||||
|
|
@ -397,7 +397,7 @@ inline void bgc_fp64_matrix3x2_add_scaled(const BGC_FP64_Matrix3x2* basic_matrix
|
|||
|
||||
// ================== Subtract ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_subtract(const BGC_FP32_Matrix3x2* minuend, const BGC_FP32_Matrix3x2* subtrahend, BGC_FP32_Matrix3x2* difference)
|
||||
inline void bgc_fp32_matrix3x2_subtract(BGC_FP32_Matrix3x2* difference, const BGC_FP32_Matrix3x2* minuend, const BGC_FP32_Matrix3x2* subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -408,7 +408,7 @@ inline void bgc_fp32_matrix3x2_subtract(const BGC_FP32_Matrix3x2* minuend, const
|
|||
difference->r2c3 = minuend->r2c3 - subtrahend->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_subtract(const BGC_FP64_Matrix3x2* minuend, const BGC_FP64_Matrix3x2* subtrahend, BGC_FP64_Matrix3x2* difference)
|
||||
inline void bgc_fp64_matrix3x2_subtract(BGC_FP64_Matrix3x2* difference, const BGC_FP64_Matrix3x2* minuend, const BGC_FP64_Matrix3x2* subtrahend)
|
||||
{
|
||||
difference->r1c1 = minuend->r1c1 - subtrahend->r1c1;
|
||||
difference->r1c2 = minuend->r1c2 - subtrahend->r1c2;
|
||||
|
|
@ -421,7 +421,7 @@ inline void bgc_fp64_matrix3x2_subtract(const BGC_FP64_Matrix3x2* minuend, const
|
|||
|
||||
// ================== Multiply ================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_multiply(const BGC_FP32_Matrix3x2* multiplicand, const float multiplier, BGC_FP32_Matrix3x2* product)
|
||||
inline void bgc_fp32_matrix3x2_multiply(BGC_FP32_Matrix3x2* product, const BGC_FP32_Matrix3x2* multiplicand, const float multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -432,7 +432,7 @@ inline void bgc_fp32_matrix3x2_multiply(const BGC_FP32_Matrix3x2* multiplicand,
|
|||
product->r2c3 = multiplicand->r2c3 * multiplier;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_multiply(const BGC_FP64_Matrix3x2* multiplicand, const double multiplier, BGC_FP64_Matrix3x2* product)
|
||||
inline void bgc_fp64_matrix3x2_multiply(BGC_FP64_Matrix3x2* product, const BGC_FP64_Matrix3x2* multiplicand, const double multiplier)
|
||||
{
|
||||
product->r1c1 = multiplicand->r1c1 * multiplier;
|
||||
product->r1c2 = multiplicand->r1c2 * multiplier;
|
||||
|
|
@ -445,19 +445,19 @@ inline void bgc_fp64_matrix3x2_multiply(const BGC_FP64_Matrix3x2* multiplicand,
|
|||
|
||||
// =================== Divide =================== //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_divide(const BGC_FP32_Matrix3x2* dividend, const float divisor, BGC_FP32_Matrix3x2* quotient)
|
||||
inline void bgc_fp32_matrix3x2_divide(BGC_FP32_Matrix3x2* quotient, const BGC_FP32_Matrix3x2* dividend, const float divisor)
|
||||
{
|
||||
bgc_fp32_matrix3x2_multiply(dividend, 1.0f / divisor, quotient);
|
||||
bgc_fp32_matrix3x2_multiply(quotient, dividend, 1.0f / divisor);
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_divide(const BGC_FP64_Matrix3x2* dividend, const double divisor, BGC_FP64_Matrix3x2* quotient)
|
||||
inline void bgc_fp64_matrix3x2_divide(BGC_FP64_Matrix3x2* quotient, const BGC_FP64_Matrix3x2* dividend, const double divisor)
|
||||
{
|
||||
bgc_fp64_matrix3x2_multiply(dividend, 1.0 / divisor, quotient);
|
||||
bgc_fp64_matrix3x2_multiply(quotient, dividend, 1.0 / divisor);
|
||||
}
|
||||
|
||||
// ================ Interpolate ================= //
|
||||
|
||||
inline void bgc_fp32_matrix3x2_interpolate(const BGC_FP32_Matrix3x2* first, const BGC_FP32_Matrix3x2* second, const float phase, BGC_FP32_Matrix3x2* interpolation)
|
||||
inline void bgc_fp32_matrix3x2_interpolate(BGC_FP32_Matrix3x2* interpolation, const BGC_FP32_Matrix3x2* first, const BGC_FP32_Matrix3x2* second, const float phase)
|
||||
{
|
||||
const float couter_phase = 1.0f - phase;
|
||||
|
||||
|
|
@ -470,7 +470,7 @@ inline void bgc_fp32_matrix3x2_interpolate(const BGC_FP32_Matrix3x2* first, cons
|
|||
interpolation->r2c3 = first->r2c3 * couter_phase + second->r2c3 * phase;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_matrix3x2_interpolate(const BGC_FP64_Matrix3x2* first, const BGC_FP64_Matrix3x2* second, const double phase, BGC_FP64_Matrix3x2* interpolation)
|
||||
inline void bgc_fp64_matrix3x2_interpolate(BGC_FP64_Matrix3x2* interpolation, const BGC_FP64_Matrix3x2* first, const BGC_FP64_Matrix3x2* second, const double phase)
|
||||
{
|
||||
const double couter_phase = 1.0 - phase;
|
||||
|
||||
|
|
@ -485,14 +485,14 @@ inline void bgc_fp64_matrix3x2_interpolate(const BGC_FP64_Matrix3x2* first, cons
|
|||
|
||||
// ============ Left Vector Product ============= //
|
||||
|
||||
inline void bgc_fp32_multiply_vector2_by_matrix3x2(const BGC_FP32_Vector2* vector, const BGC_FP32_Matrix3x2* matrix, BGC_FP32_Vector3* product)
|
||||
inline void bgc_fp32_multiply_vector2_by_matrix3x2(BGC_FP32_Vector3* product, const BGC_FP32_Vector2* vector, const BGC_FP32_Matrix3x2* matrix)
|
||||
{
|
||||
product->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||
product->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||
product->x3 = vector->x1 * matrix->r1c3 + vector->x2 * matrix->r2c3;
|
||||
}
|
||||
|
||||
inline void bgc_fp64_multiply_vector2_by_matrix3x2(const BGC_FP64_Vector2* vector, const BGC_FP64_Matrix3x2* matrix, BGC_FP64_Vector3* product)
|
||||
inline void bgc_fp64_multiply_vector2_by_matrix3x2(BGC_FP64_Vector3* product, const BGC_FP64_Vector2* vector, const BGC_FP64_Matrix3x2* matrix)
|
||||
{
|
||||
product->x1 = vector->x1 * matrix->r1c1 + vector->x2 * matrix->r2c1;
|
||||
product->x2 = vector->x1 * matrix->r1c2 + vector->x2 * matrix->r2c2;
|
||||
|
|
@ -501,13 +501,13 @@ inline void bgc_fp64_multiply_vector2_by_matrix3x2(const BGC_FP64_Vector2* vecto
|
|||
|
||||
// ============ Right Vector Product ============ //
|
||||
|
||||
inline void bgc_fp32_multiply_matrix3x2_by_vector3(const BGC_FP32_Matrix3x2* matrix, const BGC_FP32_Vector3* vector, BGC_FP32_Vector2* product)
|
||||
inline void bgc_fp32_multiply_matrix3x2_by_vector3(BGC_FP32_Vector2* product, const BGC_FP32_Matrix3x2* matrix, const BGC_FP32_Vector3* 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_multiply_matrix3x2_by_vector3(const BGC_FP64_Matrix3x2* matrix, const BGC_FP64_Vector3* vector, BGC_FP64_Vector2* product)
|
||||
inline void bgc_fp64_multiply_matrix3x2_by_vector3(BGC_FP64_Vector2* product, const BGC_FP64_Matrix3x2* matrix, const BGC_FP64_Vector3* 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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue