Большое переупорядочивание исходного кода
This commit is contained in:
parent
fffe2be43b
commit
43bf030295
26 changed files with 1225 additions and 1137 deletions
|
|
@ -61,7 +61,7 @@ inline void bgc_matrix2x2_set_to_diagonal_fp64(const double d1, const double d2,
|
|||
|
||||
// ============== Rotation Matrix =============== //
|
||||
|
||||
inline void bgc_matrix2x2_make_rotation_fp32(const float angle, const BgcAngleUnitEnum unit, BgcMatrix2x2FP32* matrix)
|
||||
inline void bgc_matrix2x2_set_turn_fp32(const float angle, const BgcAngleUnitEnum unit, BgcMatrix2x2FP32* matrix)
|
||||
{
|
||||
const float radians = bgc_angle_to_radians_fp32(angle, unit);
|
||||
const float cosine = cosf(radians);
|
||||
|
|
@ -73,7 +73,7 @@ inline void bgc_matrix2x2_make_rotation_fp32(const float angle, const BgcAngleUn
|
|||
matrix->r2c2 = cosine;
|
||||
}
|
||||
|
||||
inline void bgc_matrix2x2_make_rotation_fp64(const double angle, const BgcAngleUnitEnum unit, BgcMatrix2x2FP64* matrix)
|
||||
inline void bgc_matrix2x2_set_turn_fp64(const double angle, const BgcAngleUnitEnum unit, BgcMatrix2x2FP64* matrix)
|
||||
{
|
||||
const double radians = bgc_angle_to_radians_fp64(angle, unit);
|
||||
const double cosine = cos(radians);
|
||||
|
|
@ -85,6 +85,30 @@ inline void bgc_matrix2x2_make_rotation_fp64(const double angle, const BgcAngleU
|
|||
matrix->r2c2 = cosine;
|
||||
}
|
||||
|
||||
// ================ Determinant ================= //
|
||||
|
||||
inline float bgc_matrix2x2_get_determinant_fp32(const BgcMatrix2x2FP32* matrix)
|
||||
{
|
||||
return matrix->r1c1 * matrix->r2c2 - matrix->r1c2 * matrix->r2c1;
|
||||
}
|
||||
|
||||
inline double bgc_matrix2x2_get_determinant_fp64(const BgcMatrix2x2FP64* matrix)
|
||||
{
|
||||
return matrix->r1c1 * matrix->r2c2 - matrix->r1c2 * matrix->r2c1;
|
||||
}
|
||||
|
||||
// ================== Singular ================== //
|
||||
|
||||
inline int bgc_matrix2x2_is_singular_fp32(const BgcMatrix2x2FP32* matrix)
|
||||
{
|
||||
return bgc_is_zero_fp32(bgc_matrix2x2_get_determinant_fp32(matrix));
|
||||
}
|
||||
|
||||
inline int bgc_matrix2x2_is_singular_fp64(const BgcMatrix2x2FP64* matrix)
|
||||
{
|
||||
return bgc_is_zero_fp64(bgc_matrix2x2_get_determinant_fp64(matrix));
|
||||
}
|
||||
|
||||
// ==================== Copy ==================== //
|
||||
|
||||