From e15070ce45cbb78f0e4c205d1324124a72fbb8f3 Mon Sep 17 00:00:00 2001 From: Andrey Pokidov Date: Sat, 8 Feb 2025 01:22:19 +0700 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D1=81=D1=82=D1=80=D1=83=D0=BA=D1=82?= =?UTF-8?q?=D1=83=D1=80=D1=8B=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B0=D1=86=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/angle-eng.md | 2 +- docs/angle-rus.md | 2 +- docs/quaternion-eng.md | 2 +- docs/quaternion-rus.md | 2 +- docs/vector2-eng.md | 9 +- docs/vector2-rus.md | 107 ++---------------- docs/vector2/copy-eng.md | 50 ++++++++ docs/vector2/copy-rus.md | 50 ++++++++ docs/vector2/reset-eng.md | 2 +- docs/vector2/reset-rus.md | 2 +- docs/vector2/set-values-eng.md | 44 +++++++ docs/vector2/set-values-rus.md | 44 +++++++ docs/vector2/swap-eng.md | 44 +++++++ docs/vector2/swap-rus.md | 44 +++++++ docs/versor-eng.md | 25 ++-- docs/versor-rus.md | 4 +- .../{versor-reset-eng.md => reset-eng.md} | 4 +- .../{versor-reset-rus.md => reset-rus.md} | 6 +- ...or-set-values-eng.md => set-values-eng.md} | 4 +- ...or-set-values-rus.md => set-values-rus.md} | 4 +- 20 files changed, 316 insertions(+), 135 deletions(-) create mode 100644 docs/vector2/copy-eng.md create mode 100644 docs/vector2/copy-rus.md create mode 100644 docs/vector2/swap-eng.md create mode 100644 docs/vector2/swap-rus.md rename docs/versor/{versor-reset-eng.md => reset-eng.md} (85%) rename docs/versor/{versor-reset-rus.md => reset-rus.md} (69%) rename docs/versor/{versor-set-values-eng.md => set-values-eng.md} (94%) rename docs/versor/{versor-set-values-rus.md => set-values-rus.md} (91%) diff --git a/docs/angle-eng.md b/docs/angle-eng.md index 3c67bf7..a19e3de 100644 --- a/docs/angle-eng.md +++ b/docs/angle-eng.md @@ -52,4 +52,4 @@ The ranges of angles are defined with an enumerated type: * BGC_ANGLE_RANGE_SIGNED is for the signed range of values. -[Back](intro-eng.md) +[Documentation](intro-eng.md) diff --git a/docs/angle-rus.md b/docs/angle-rus.md index f9b5078..ac8680a 100644 --- a/docs/angle-rus.md +++ b/docs/angle-rus.md @@ -54,4 +54,4 @@ * BGC_ANGLE_RANGE_UNSIGNED для беззнакового диапазона значений; * BGC_ANGLE_RANGE_SIGNED для знакового диапазона значений. -[Назад](intro-rus.md) +[Документация](intro-rus.md) diff --git a/docs/quaternion-eng.md b/docs/quaternion-eng.md index deab0c6..91084f8 100644 --- a/docs/quaternion-eng.md +++ b/docs/quaternion-eng.md @@ -60,4 +60,4 @@ The versor fields are declared as const so that the developer uses the library f The quaternion fields are free to be changed by the developer using the library. -[Back](intro-eng.md) +[Documentation](intro-eng.md) diff --git a/docs/quaternion-rus.md b/docs/quaternion-rus.md index e3b25b0..5fcb201 100644 --- a/docs/quaternion-rus.md +++ b/docs/quaternion-rus.md @@ -59,4 +59,4 @@ q = w + ix + jy + kz Поля кватернионов разработчик, использующий библиотеку, может менять свободно. -[Назад](intro-rus.md) +[Документация](intro-rus.md) diff --git a/docs/vector2-eng.md b/docs/vector2-eng.md index 13ff407..f77012c 100644 --- a/docs/vector2-eng.md +++ b/docs/vector2-eng.md @@ -20,5 +20,12 @@ Structure definitions: ## Functions +| Funtions for BgcVector2FP32 | Funtions for BgcVector2FP64 | +|:-------------------------------------------------------------:|:-------------------------------------------------------------:| +| [bgc_vector2_reset_fp32](vector2/reset-eng.md) | [bgc_vector2_reset_fp64](vector2/reset-eng.md) | +| [bgc_vector2_set_values_fp32](vector2/set-values-eng.md) | [bgc_vector2_set_values_fp64](vector2/set-values-eng.md) | +| [bgc_vector2_copy_fp32](vector2/copy-eng.md) | [bgc_vector2_copy_fp64](vector2/copy-eng.md) | +| [bgc_vector2_swap_fp32](vector2/swap-eng.md) | [bgc_vector2_swap_fp64](vector2/swap-eng.md) | -[Back](intro-eng.md) + +[Documentation](intro-eng.md) diff --git a/docs/vector2-rus.md b/docs/vector2-rus.md index 3f8c77a..1b61b3c 100644 --- a/docs/vector2-rus.md +++ b/docs/vector2-rus.md @@ -20,105 +20,14 @@ ## Функции -### Указание координат двумерного вектора +| Функции для BgcVector2FP32 | Функции для BgcVector2FP64 | +|:-------------------------------------------------------------:|:-------------------------------------------------------------:| +| [bgc_vector2_reset_fp32](vector2/reset-rus.md) | [bgc_vector2_reset_fp64](vector2/reset-rus.md) | +| [bgc_vector2_set_values_fp32](vector2/set-values-rus.md) | [bgc_vector2_set_values_fp64](vector2/set-values-rus.md) | +| [bgc_vector2_copy_fp32](vector2/copy-rus.md) | [bgc_vector2_copy_fp64](vector2/copy-rus.md) | +| [bgc_vector2_swap_fp32](vector2/swap-rus.md) | [bgc_vector2_swap_fp64](vector2/swap-rus.md) | -Для прямого указания координат предлагаются следующие две функции: - - inline void bgc_vector2_set_values_fp32(const float x1, const float x2, BgcVector2FP32* to); - inline void bgc_vector2_set_values_fp64(const double x1, const double x2, BgcVector2FP64* to); - -Каждая из данных функции эквивалентна следующим строкам кода: - - vector->x1 = x1; - vector->x2 = x2; - -В данные функции не следует передавать некорректные указатели. Значение NULL (0) -в качестве параметра также считается некорректным. - -Пример применения: - - #include - #include - - int main() - { - BgcVector2FP32 my_vector; - - bgc_vector2_set_values_fp32(-2, 7, &my_vector); - - printf("x1 = %f, x2 = %f\n", my_vector.x1, my_vector.x2); - - return 0; - } - -### Копирование - -Функции копирования позволяют -Для копирования координат векторов предлагаются данные функции: - - inline void bgc_vector2_copy_fp32(const BgcVector2FP32* from, BgcVector2FP32* to); - inline void bgc_vector2_copy_fp64(const BgcVector2FP64* from, BgcVector2FP64* to); - -Каждая из данных функции эквивалентна следующим строкам кода: - - to->x1 = from->x1; - to->x2 = from->x2; - -В данные функции не следует передавать некорректные указатели. Значение NULL (0) -в качестве параметра также считается некорректным. - -Пример применения: - - #include - #include - - int main() - { - BgcVector2FP32 my_vector1, my_vector2; - - bgc_vector2_set_values_fp32(-2, 7, &my_vector1); - - bgc_vector2_copy_fp32(&my_vector1, &my_vector2); - - printf("x1 = %f, x2 = %f\n", my_vector2.x1, my_vector2.x2); - - return 0; - } - -### Обмен - -Функции обмена позволяют двум векторам одного типа обменяться значениями -координат. - -Для обмена значениями координат векторов определены следующие функции: - - inline void bgc_vector2_swap_fp32(BgcVector2FP32* vector1, BgcVector2FP32* vector2); - inline void bgc_vector2_swap_fp64(BgcVector2FP64* vector1, BgcVector2FP64* vector2); - -В данные функции не следует передавать некорректные указатели. Значение NULL (0) -также считается некорректным. - -Пример применения: - - #include - #include - - int main() - { - BgcVector2FP32 my_vector1, my_vector2; - - bgc_vector2_set_values_fp32(-2, 7, &my_vector1); - bgc_vector2_set_values_fp32(10, -1, &my_vector2); - - bgc_vector2_swap_fp32(&my_vector1, &my_vector2); - - printf("Vector #1: x1 = %f, x2 = %f\n", my_vector1.x1, my_vector1.x2); - printf("Vector #2: x1 = %f, x2 = %f\n", my_vector2.x1, my_vector2.x2); - - return 0; - } - -### Конвертация типа +### Функции кнвертации типа Функции конвертации типа позволяют преобразовать @@ -133,4 +42,4 @@ Тем не менее, в библиотеке есть функции, которые позволяют преобразовать данные одного типа в данные другого типа. -[Назад](intro-rus.md) +[Документация](intro-rus.md) diff --git a/docs/vector2/copy-eng.md b/docs/vector2/copy-eng.md new file mode 100644 index 0000000..2348ee3 --- /dev/null +++ b/docs/vector2/copy-eng.md @@ -0,0 +1,50 @@ +# Copying + +The copy functions allow you to copy the coordinate values of one vector to another vector. + +Function for **BgcVector2FP32**: + +```c + inline void bgc_vector2_copy_fp32(const BgcVector2FP32* from, BgcVector2FP32* to); +``` + +Function for **BgcVector2FP64**: + +```c + inline void bgc_vector2_copy_fp64(const BgcVector2FP64* from, BgcVector2FP64* to); +``` + +Each of these functions is equivalent to the following lines of code: + +```c + to->x1 = from->x1; + to->x2 = from->x2; +``` + +You should not pass invalid pointers to these functions. The NULL (0) value is also considered invalid. + +The **from** parameter must be a pointer to a two-dimensional vector whose coordinates are to be copied. The coordinates of the **from** vector will not change after the function call. + +The **to** parameter must be a pointer to a two-dimensional vector whose coordinates are to be changed. The coordinates of the **to** vector will become the same as those of the **from** vector after the function call. + +Example of use: + +```c + #include + #include + + int main() + { + BgcVector2FP32 my_vector1, my_vector2; + + bgc_vector2_set_values_fp32(-2, 7, &my_vector1); + + bgc_vector2_copy_fp32(&my_vector1, &my_vector2); + + printf("x1 = %f, x2 = %f\n", my_vector2.x1, my_vector2.x2); + + return 0; + } +``` + +[Documentation](../intro-eng.md) / [2D vectors](../vector2-eng.md) diff --git a/docs/vector2/copy-rus.md b/docs/vector2/copy-rus.md new file mode 100644 index 0000000..b57aaa6 --- /dev/null +++ b/docs/vector2/copy-rus.md @@ -0,0 +1,50 @@ +# + + . + + **BgcVector2FP32**: + +```c + inline void bgc_vector2_copy_fp32(const BgcVector2FP32* from, BgcVector2FP32* to); +``` + + **BgcVector2FP64**: + +```c + inline void bgc_vector2_copy_fp64(const BgcVector2FP64* from, BgcVector2FP64* to); +``` + + : + +```c + to->x1 = from->x1; + to->x2 = from->x2; +``` + + . NULL (0) . + + **from** , . **from** . + + **to** , . **to** , **from**. + + : + +```c + #include + #include + + int main() + { + BgcVector2FP32 my_vector1, my_vector2; + + bgc_vector2_set_values_fp32(-2, 7, &my_vector1); + + bgc_vector2_copy_fp32(&my_vector1, &my_vector2); + + printf("x1 = %f, x2 = %f\n", my_vector2.x1, my_vector2.x2); + + return 0; + } +``` + +[](../intro-rus.md) / [2D ](../vector2-rus.md) diff --git a/docs/vector2/reset-eng.md b/docs/vector2/reset-eng.md index 805bc20..cda4f65 100644 --- a/docs/vector2/reset-eng.md +++ b/docs/vector2/reset-eng.md @@ -41,4 +41,4 @@ Example of use: } ``` -[Back](../vector2-eng.md) +[Documentation](../intro-eng.md) / [2D vectors](../vector2-eng.md) diff --git a/docs/vector2/reset-rus.md b/docs/vector2/reset-rus.md index cd1807f..82a22af 100644 --- a/docs/vector2/reset-rus.md +++ b/docs/vector2/reset-rus.md @@ -41,4 +41,4 @@ } ``` -[](../vector2-rus.md) +[](../intro-rus.md) / [2D ](../vector2-rus.md) diff --git a/docs/vector2/set-values-eng.md b/docs/vector2/set-values-eng.md index e69de29..3886894 100644 --- a/docs/vector2/set-values-eng.md +++ b/docs/vector2/set-values-eng.md @@ -0,0 +1,44 @@ +# Setting the coordinates of a two-dimensional vector + +You can set the coordinates of vectors either directly or using functions. The functions for setting coordinate values allow you to do this in one line. + +Function for **BgcVector2FP32**: + +```c + inline void bgc_vector2_set_values_fp32(const float x1, const float x2, BgcVector2FP32* to); +``` + +Function for **BgcVector2FP32**: + +```c + inline void bgc_vector2_set_values_fp64(const double x1, const double x2, BgcVector2FP64* to); +``` + +Each of these functions is equivalent to the following lines of code: + +```c + vector->x1 = x1; + vector->x2 = x2; +``` + +You should not pass invalid pointers to these functions. The value NULL (0) is also considered invalid. + +Example of use: + +```c + #include + #include + + int main() + { + BgcVector2FP32 my_vector; + + bgc_vector2_set_values_fp32(-2, 7, &my_vector); + + printf("x1 = %f, x2 = %f\n", my_vector.x1, my_vector.x2); + + return 0; + } +``` + +[Documentation](../intro-eng.md) / [2D vectors](../vector2-eng.md) diff --git a/docs/vector2/set-values-rus.md b/docs/vector2/set-values-rus.md index e69de29..8cf1756 100644 --- a/docs/vector2/set-values-rus.md +++ b/docs/vector2/set-values-rus.md @@ -0,0 +1,44 @@ +# + + , . . + + **BgcVector2FP32**: + +```c + inline void bgc_vector2_set_values_fp32(const float x1, const float x2, BgcVector2FP32* to); +``` + + **BgcVector2FP32**: + +```c + inline void bgc_vector2_set_values_fp64(const double x1, const double x2, BgcVector2FP64* to); +``` + + : + +```c + vector->x1 = x1; + vector->x2 = x2; +``` + + . NULL (0) . + + : + +```c + #include + #include + + int main() + { + BgcVector2FP32 my_vector; + + bgc_vector2_set_values_fp32(-2, 7, &my_vector); + + printf("x1 = %f, x2 = %f\n", my_vector.x1, my_vector.x2); + + return 0; + } +``` + +[](../intro-rus.md) / [2D ](../vector2-rus.md) diff --git a/docs/vector2/swap-eng.md b/docs/vector2/swap-eng.md new file mode 100644 index 0000000..9dec23f --- /dev/null +++ b/docs/vector2/swap-eng.md @@ -0,0 +1,44 @@ +# Swapping + +The exchange functions allow two vectors of the same type to exchange coordinate values. + +Function for **BgcVector2FP32**: + +```c + inline void bgc_vector2_swap_fp32(BgcVector2FP32* vector1, BgcVector2FP32* vector2); +``` + +Function for **BgcVector2FP32**: + +```c + inline void bgc_vector2_swap_fp64(BgcVector2FP64* vector1, BgcVector2FP64* vector2); +``` + +You should not pass invalid pointers to these functions. The value NULL (0) is also considered invalid. + +Vector **vector1** after calling this function will have the coordinate values that vector **vector2** had before calling the function. +And vector **vector2** after calling this function will have the same coordinate values that vector **vector1** had before calling the function. + +Example of use: + +```c + #include + #include + + int main() + { + BgcVector2FP32 my_vector1, my_vector2; + + bgc_vector2_set_values_fp32(-2, 7, &my_vector1); + bgc_vector2_set_values_fp32(10, -1, &my_vector2); + + bgc_vector2_swap_fp32(&my_vector1, &my_vector2); + + printf("Vector #1: x1 = %f, x2 = %f\n", my_vector1.x1, my_vector1.x2); + printf("Vector #2: x1 = %f, x2 = %f\n", my_vector2.x1, my_vector2.x2); + + return 0; + } +``` + +[Documentation](../intro-eng.md) / [2D vectors](../vector2-eng.md) diff --git a/docs/vector2/swap-rus.md b/docs/vector2/swap-rus.md new file mode 100644 index 0000000..1f9adb5 --- /dev/null +++ b/docs/vector2/swap-rus.md @@ -0,0 +1,44 @@ +# + + . + + **BgcVector2FP32**: + +```c + inline void bgc_vector2_swap_fp32(BgcVector2FP32* vector1, BgcVector2FP32* vector2); +``` + + **BgcVector2FP32**: + +```c + inline void bgc_vector2_swap_fp64(BgcVector2FP64* vector1, BgcVector2FP64* vector2); +``` + + . NULL (0) . + + **vector1** , **vector2** . + **vector2** , **vector1** . + + : + +```c + #include + #include + + int main() + { + BgcVector2FP32 my_vector1, my_vector2; + + bgc_vector2_set_values_fp32(-2, 7, &my_vector1); + bgc_vector2_set_values_fp32(10, -1, &my_vector2); + + bgc_vector2_swap_fp32(&my_vector1, &my_vector2); + + printf("Vector #1: x1 = %f, x2 = %f\n", my_vector1.x1, my_vector1.x2); + printf("Vector #2: x1 = %f, x2 = %f\n", my_vector2.x1, my_vector2.x2); + + return 0; + } +``` + +[](../intro-rus.md) / [2D ](../vector2-rus.md) diff --git a/docs/versor-eng.md b/docs/versor-eng.md index 741aafd..8d3bde5 100644 --- a/docs/versor-eng.md +++ b/docs/versor-eng.md @@ -60,23 +60,12 @@ Fields: - s0 is the real part of the versor. - x1, x2, x3 are the imaginary components of the versor. -## Operation with versors +## Functions -- [Reset state](versor/reset-eng.md) -- [Specify component values](versor/set-values-eng.md) -- Copy component values -- Swap component values -- Build based on rotation -- Check for absence of rotation -- Type conversion -- Rotation reduction -- Inversion -- Combination -- Get rotation description -- Get rotation matrix -- Get inverse rotation matrix -- Rotate vector -- Inverse vector rotation -- Compare +| Funtions for BgcVersorFP32 | Funtions for BgcVersorFP64 | +|:-------------------------------------------------------------:|:-------------------------------------------------------------:| +| [bgc_versor_reset_fp32](versor/reset-eng.md) | [bgc_versor_reset_fp64](versor/reset-eng.md) | +| [bgc_versor_set_values_fp32](versor/set-values-eng.md) | [bgc_versor_set_values_fp64](versor/set-values-eng.md) | -[Back](intro-eng.md) + +[Documentation](intro-eng.md) diff --git a/docs/versor-rus.md b/docs/versor-rus.md index 78af9a5..8b41d8f 100644 --- a/docs/versor-rus.md +++ b/docs/versor-rus.md @@ -64,10 +64,10 @@ q = w + ix + jy + kz ## Функции -| Функция для BgcVersorFP32 | Функция для BgcVersorFP64 | +| Функции для BgcVersorFP32 | Функции для BgcVersorFP64 | |:-------------------------------------------------------------:|:-------------------------------------------------------------:| | [bgc_versor_reset_fp32](versor/reset-rus.md) | [bgc_versor_reset_fp64](versor/reset-rus.md) | | [bgc_versor_set_values_fp32](versor/set-values-rus.md) | [bgc_versor_set_values_fp64](versor/set-values-rus.md) | -[Назад](intro-rus.md) +[Документация](intro-rus.md) diff --git a/docs/versor/versor-reset-eng.md b/docs/versor/reset-eng.md similarity index 85% rename from docs/versor/versor-reset-eng.md rename to docs/versor/reset-eng.md index c1f57d1..7713ab3 100644 --- a/docs/versor/versor-reset-eng.md +++ b/docs/versor/reset-eng.md @@ -1,6 +1,6 @@ # State reset functions for versors -[A versor](./versor-eng.md) that corresponds to no rotation has the following component values: +[A versor](../versor-eng.md) that corresponds to no rotation has the following component values: ``` s0 = 1; @@ -50,4 +50,4 @@ Result: Versor: (1.000000, 0.000000, 0.000000, 0.000000) ``` -[Versors](./versor-eng.md) +[Documentation](../intro-eng.md) / [Versors](../versor-eng.md) diff --git a/docs/versor/versor-reset-rus.md b/docs/versor/reset-rus.md similarity index 69% rename from docs/versor/versor-reset-rus.md rename to docs/versor/reset-rus.md index 20cd3ef..179d759 100644 --- a/docs/versor/versor-reset-rus.md +++ b/docs/versor/reset-rus.md @@ -1,6 +1,6 @@ # Функции сброса состояния для версоров -[Версор](./versor-rus.md), который соответствует отсутствию поворота, имеет следующие значеия компонент: +[Версор](../versor-rus.md), который соответствует отсутствию поворота, имеет следующие значеия компонент: ``` s0 = 1; @@ -9,7 +9,7 @@ x3 = 0; ``` -Чтобы установить такое состояние для компонент версора, в библиотеке есть соответствующие функции. +Чтобы установить данное состояние для компонент версора, в библиотеке есть соответствующие функции. Для типа **BgFP32Versor** функция имеет вид: @@ -50,4 +50,4 @@ Versor: (1.000000, 0.000000, 0.000000, 0.000000) ``` -[Библиотека базовых геометрических вычислений](./intro-rus.md) / [Версоры](./versor-rus.md) +[Документация](../intro-rus.md) / [Версоры](../versor-rus.md) diff --git a/docs/versor/versor-set-values-eng.md b/docs/versor/set-values-eng.md similarity index 94% rename from docs/versor/versor-set-values-eng.md rename to docs/versor/set-values-eng.md index a661b36..d41b8c8 100644 --- a/docs/versor/versor-set-values-eng.md +++ b/docs/versor/set-values-eng.md @@ -1,4 +1,4 @@ -# Functions that set the values of the versor components +# Versor component assignment functions Special functions are provided to specify specific values ??for the versor components. @@ -53,4 +53,4 @@ Result: Versor: (1.000000, 0.000000, 0.000000, 0.000000) ``` -[Versors](./versor-eng.md) +[Documentation](../intro-eng.md) / [Versors](../versor-eng.md) diff --git a/docs/versor/versor-set-values-rus.md b/docs/versor/set-values-rus.md similarity index 91% rename from docs/versor/versor-set-values-rus.md rename to docs/versor/set-values-rus.md index 5fb8764..45148d2 100644 --- a/docs/versor/versor-set-values-rus.md +++ b/docs/versor/set-values-rus.md @@ -1,4 +1,4 @@ -# Функции устанавливащие значения компоенен версора +# Функции задания компонент версора Чтобы указать конкретные значения для компонент версора предусмотрены специальные функции. @@ -55,4 +55,4 @@ Versor: (1.000000, 0.000000, 0.000000, 0.000000) ``` -[Библиотека базовых геометрических вычислений](./intro-rus.md) / [Версоры](./versor-rus.md) +[Документация](../intro-rus.md) / [Версоры](../versor-rus.md)