Переименование методов на распространённые названия

This commit is contained in:
Andrey Pokidov 2026-02-16 20:41:45 +07:00
parent 039b26305a
commit b621191698
14 changed files with 192 additions and 192 deletions

View file

@ -166,7 +166,7 @@ void bgc_fp32_turn3_set_rotation(BGC_FP32_Turn3* turn, const float x1, const flo
bgc_fp32_quaternion_make(&turn->_versor, cosf(half_angle), x1 * multiplier, x2 * multiplier, x3 * multiplier);
const float square_modulus = bgc_fp32_quaternion_get_square_modulus(&turn->_versor);
const float square_modulus = bgc_fp32_quaternion_get_square_magnitude(&turn->_versor);
if (!bgc_fp32_is_square_unit(square_modulus)) {
_bgc_fp32_turn3_normalize(turn, square_modulus);
@ -195,7 +195,7 @@ void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* turn, const double x1, const do
bgc_fp64_quaternion_make(&turn->_versor, cos(half_angle), x1 * multiplier, x2 * multiplier, x3 * multiplier);
const double square_modulus = bgc_fp64_quaternion_get_square_modulus(&turn->_versor);
const double square_modulus = bgc_fp64_quaternion_get_square_magnitude(&turn->_versor);
if (!bgc_fp64_is_square_unit(square_modulus)) {
_bgc_fp64_turn3_normalize(turn, square_modulus);
@ -206,7 +206,7 @@ void bgc_fp64_turn3_set_rotation(BGC_FP64_Turn3* turn, const double x1, const do
int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP32_Vector3* first, const BGC_FP32_Vector3* second)
{
const float first_square_modulus = bgc_fp32_vector3_get_square_modulus(first);
const float first_square_modulus = bgc_fp32_vector3_get_squared_length(first);
bgc_fp32_turn3_reset(turn);
@ -214,7 +214,7 @@ int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP3
return BGC_ERROR_TURN3_FIRST_VECTOR_ZERO;
}
const float second_square_modulus = bgc_fp32_vector3_get_square_modulus(second);
const float second_square_modulus = bgc_fp32_vector3_get_squared_length(second);
if (second_square_modulus <= BGC_FP32_SQUARE_EPSILON) {
return BGC_ERROR_TURN3_SECOND_VECTOR_ZERO;
@ -226,7 +226,7 @@ int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP3
const float square_product = first_square_modulus * second_square_modulus;
const float dot_product = bgc_fp32_vector3_get_dot_product(first, second);
const float axis_square_modulus = bgc_fp32_vector3_get_square_modulus(&axis);
const float axis_square_modulus = bgc_fp32_vector3_get_squared_length(&axis);
if (axis_square_modulus <= BGC_FP32_SQUARE_EPSILON * square_product) {
if (dot_product < 0.0f) {
@ -250,7 +250,7 @@ int bgc_fp32_turn3_find_direction_difference(BGC_FP32_Turn3* turn, const BGC_FP3
int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP64_Vector3* first, const BGC_FP64_Vector3* second)
{
const double first_square_modulus = bgc_fp64_vector3_get_square_modulus(first);
const double first_square_modulus = bgc_fp64_vector3_get_squared_length(first);
bgc_fp64_turn3_reset(turn);
@ -258,7 +258,7 @@ int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP6
return BGC_ERROR_TURN3_FIRST_VECTOR_ZERO;
}
const double second_square_modulus = bgc_fp64_vector3_get_square_modulus(second);
const double second_square_modulus = bgc_fp64_vector3_get_squared_length(second);
if (second_square_modulus <= BGC_FP64_SQUARE_EPSILON) {
return BGC_ERROR_TURN3_SECOND_VECTOR_ZERO;
@ -270,7 +270,7 @@ int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP6
const double square_product = first_square_modulus * second_square_modulus;
const double dot_product = bgc_fp64_vector3_get_dot_product(first, second);
const double axis_square_modulus = bgc_fp64_vector3_get_square_modulus(&axis);
const double axis_square_modulus = bgc_fp64_vector3_get_squared_length(&axis);
if (axis_square_modulus <= BGC_FP64_SQUARE_EPSILON * square_product) {
bgc_fp64_turn3_reset(turn);
@ -297,13 +297,13 @@ int bgc_fp64_turn3_find_direction_difference(BGC_FP64_Turn3* turn, const BGC_FP6
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)
{
const float main_square_modulus = bgc_fp32_vector3_get_square_modulus(main);
const float main_square_modulus = bgc_fp32_vector3_get_squared_length(main);
if (main_square_modulus <= BGC_FP32_SQUARE_EPSILON) {
return _BGC_ERROR_TURN3_EMPTY_MAIN;
}
const float branch_square_modulus = bgc_fp32_vector3_get_square_modulus(branch);
const float branch_square_modulus = bgc_fp32_vector3_get_squared_length(branch);
if (branch_square_modulus <= BGC_FP32_SQUARE_EPSILON) {
return _BGC_ERROR_TURN3_EMPTY_BRANCH;
@ -313,7 +313,7 @@ static inline int _bgc_fp32_turn3_get_orthogonal_pair(BGC_FP32_Vector3* unit_mai
bgc_fp32_vector3_add_scaled(unit_branch, branch, unit_main, -bgc_fp32_vector3_get_dot_product(branch, unit_main));
const float orthogonal_square_modulus = bgc_fp32_vector3_get_square_modulus(unit_branch);
const float orthogonal_square_modulus = bgc_fp32_vector3_get_squared_length(unit_branch);
if (orthogonal_square_modulus <= BGC_FP32_SQUARE_EPSILON) {
return _BGC_ERROR_TURN3_PAIR_PARALLEL;
@ -326,13 +326,13 @@ static inline int _bgc_fp32_turn3_get_orthogonal_pair(BGC_FP32_Vector3* unit_mai
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)
{
const double main_square_modulus = bgc_fp64_vector3_get_square_modulus(main);
const double main_square_modulus = bgc_fp64_vector3_get_squared_length(main);
if (main_square_modulus <= BGC_FP64_SQUARE_EPSILON) {
return _BGC_ERROR_TURN3_EMPTY_MAIN;
}
const double branch_square_modulus = bgc_fp64_vector3_get_square_modulus(branch);
const double branch_square_modulus = bgc_fp64_vector3_get_squared_length(branch);
if (branch_square_modulus <= BGC_FP64_SQUARE_EPSILON) {
return _BGC_ERROR_TURN3_EMPTY_BRANCH;
@ -342,7 +342,7 @@ static inline int _bgc_fp64_turn3_get_orthogonal_pair(BGC_FP64_Vector3* unit_mai
bgc_fp64_vector3_add_scaled(unit_branch, branch, unit_main, -bgc_fp64_vector3_get_dot_product(branch, unit_main));
const double orthogonal_square_modulus = bgc_fp64_vector3_get_square_modulus(unit_branch);
const double orthogonal_square_modulus = bgc_fp64_vector3_get_squared_length(unit_branch);
if (orthogonal_square_modulus <= BGC_FP64_SQUARE_EPSILON) {
return _BGC_ERROR_TURN3_PAIR_PARALLEL;
@ -363,7 +363,7 @@ static inline void _bgc_fp32_turn3_get_turning_quaternion(BGC_FP32_Quaternion* q
const float dot_product = bgc_fp32_vector3_get_dot_product(unit_start, unit_end);
const float axis_square_modulus = bgc_fp32_vector3_get_square_modulus(&axis);
const float axis_square_modulus = bgc_fp32_vector3_get_squared_length(&axis);
// unit_start and unit_end are parallel
if (axis_square_modulus <= BGC_FP32_SQUARE_EPSILON) {
@ -404,7 +404,7 @@ static inline void _bgc_fp64_turn3_get_turning_quaternion(BGC_FP64_Quaternion* q
const double dot_product = bgc_fp64_vector3_get_dot_product(unit_start, unit_end);
const double axis_square_modulus = bgc_fp64_vector3_get_square_modulus(&axis);
const double axis_square_modulus = bgc_fp64_vector3_get_squared_length(&axis);
// unit_start and unit_end are parallel
if (axis_square_modulus <= BGC_FP64_SQUARE_EPSILON) {
@ -477,7 +477,7 @@ int bgc_fp32_turn3_find_pair_difference(
bgc_fp32_quaternion_multiply_by_quaternion(&turn->_versor, &q2, &q1);
// Making a final versor (a normalized quaternion)
const float square_modulus = bgc_fp32_quaternion_get_square_modulus(&turn->_versor);
const float square_modulus = bgc_fp32_quaternion_get_square_magnitude(&turn->_versor);
if (!bgc_fp32_is_square_unit(square_modulus)) {
_bgc_fp32_turn3_normalize(turn, square_modulus);
@ -524,7 +524,7 @@ int bgc_fp64_turn3_find_pair_difference(
bgc_fp64_quaternion_multiply_by_quaternion(&turn->_versor, &q2, &q1);
// Making a final versor (a normalized quaternion)
const double square_modulus = bgc_fp64_quaternion_get_square_modulus(&turn->_versor);
const double square_modulus = bgc_fp64_quaternion_get_square_magnitude(&turn->_versor);
if (!bgc_fp64_is_square_unit(square_modulus)) {
_bgc_fp64_turn3_normalize(turn, square_modulus);