From cc3ce1f32753df4c1df2a4df360d6ac84872c7ae Mon Sep 17 00:00:00 2001 From: Andrey Pokidov Date: Mon, 30 Mar 2026 01:19: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=D0=B8=20=D1=80=D0=B0=D1=81=D1=88?= =?UTF-8?q?=D0=B8=D1=80=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BE=D0=BA=D1=83?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D1=82=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE?= =?UTF-8?q?=20=D0=B2=D0=B5=D0=BA=D1=82=D0=BE=D1=80=D0=B0=D0=BC=20=D0=B8=20?= =?UTF-8?q?=D0=BA=D0=B2=D0=B0=D1=82=D0=B5=D1=80=D0=BD=D0=B8=D0=BE=D0=BD?= =?UTF-8?q?=D0=B0=D0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/quaternion-eng.md | 6 +++++ docs/quaternion-rus.md | 4 +++ docs/quaternion/reset-eng.md | 49 +++++++++++++++++++++++++++++++++++ docs/quaternion/reset-rus.md | 50 ++++++++++++++++++++++++++++++++++++ docs/vector2/reset-eng.md | 4 +-- docs/vector2/reset-rus.md | 24 ++++++++--------- docs/vector3/copy-rus.md | 34 ++++++++++++------------ docs/vector3/swap-rus.md | 4 +-- 8 files changed, 142 insertions(+), 33 deletions(-) create mode 100644 docs/quaternion/reset-eng.md create mode 100644 docs/quaternion/reset-rus.md diff --git a/docs/quaternion-eng.md b/docs/quaternion-eng.md index 04f9462..4bbe6bf 100644 --- a/docs/quaternion-eng.md +++ b/docs/quaternion-eng.md @@ -41,4 +41,10 @@ Fields: - **s** is the real part of the quaternion. It is named after the word "scalar". - **x**, **y**, **z** - Imaginary components of the quaternion. +## Functions + +- [Reset](quaternion/reset-eng.md) + - bgc_fp32_quaternion_reset + - bgc_fp64_quaternion_reset + [Documentation](intro-eng.md) diff --git a/docs/quaternion-rus.md b/docs/quaternion-rus.md index f89d073..c71ff06 100644 --- a/docs/quaternion-rus.md +++ b/docs/quaternion-rus.md @@ -42,4 +42,8 @@ q = s + ix + jy + kz "scalar" - скалярная величина. - **x**, **y**, **z** - мнимые компоненты кватерниона. +- [Сброс](quaternion/reset-rus.md) + - bgc_fp32_quaternion_reset + - bgc_fp64_quaternion_reset + [Документация](intro-rus.md) diff --git a/docs/quaternion/reset-eng.md b/docs/quaternion/reset-eng.md new file mode 100644 index 0000000..2080a2e --- /dev/null +++ b/docs/quaternion/reset-eng.md @@ -0,0 +1,49 @@ +# Resetting the state of a Quaternion + +[Русская версия / Russian version](reset-rus.md) + +These functions set all parts of a quaternion to 0. + +Function for **BGC_FP32_Quaternion**: + +```c +inline void bgc_fp32_quaternion_reset(BGC_FP32_Quaternion* const quaternion); +``` + +Function for **BGC_FP64_Quaternion**: + +```c +inline void bgc_fp64_quaternion_reset(BGC_FP64_Quaternion* const quaternion); +``` + +Each of these functions is equivalent to the following lines of code: + +```c +vector->x = 0; +vector->y = 0; +``` + +You should pass valid pointers to these functions. The NULL (0) value is also +considered invalid. + +This function is good for setting up the initial state of a quaternion. + +Example of use: + +```c +#include +#include + +int main() +{ + BGC_FP64_Quaternion quaternion; + + bgc_fp32_quaternion_reset(&quaternion); + + printf("s = %lf, x = %lf, y = %lf, z = %lf\n", quaternion.s, quaternion.x, quaternion.y, quaternion.z); + + return 0; +} +``` + +[Documentation](../intro-eng.md) / [2D vectors](../quaternion-eng.md) diff --git a/docs/quaternion/reset-rus.md b/docs/quaternion/reset-rus.md new file mode 100644 index 0000000..b8437fe --- /dev/null +++ b/docs/quaternion/reset-rus.md @@ -0,0 +1,50 @@ +# Сброс состояния кватерниона + +[English version / Английская версия](reset-eng.md) + +Функции устанавливают значение 0 всем координатам двумерных векторов. + +Функция для **BGC_FP32_Quaternion**: + +```c +inline void bgc_fp32_quaternion_reset(BGC_FP32_Quaternion* const quaternion); +``` + +Функция для **BGC_FP64_Quaternion**: + +```c +inline void bgc_fp64_quaternion_reset(BGC_FP64_Quaternion* const quaternion); +``` + +Каждая из данных функции эквивалентна следующим строкам кода: + +```c +vector->x = 0; +vector->y = 0; +``` + +В параметре **quaternion** следует передавать корректный указатель на +существующую область памяти. Значение NULL (0) считается некорректным. + +Данная функция хорошо подходит для инициализации начального состояния +кватерниона. + +Пример применения: + +```c +#include +#include + +int main() +{ + BGC_FP64_Quaternion quaternion; + + bgc_fp32_quaternion_reset(&quaternion); + + printf("s = %lf, x = %lf, y = %lf, z = %lf\n", quaternion.s, quaternion.x, quaternion.y, quaternion.z); + + return 0; +} +``` + +[Документация](../intro-rus.md) / [Кватернионы](../quaternion-rus.md) diff --git a/docs/vector2/reset-eng.md b/docs/vector2/reset-eng.md index 9f039f4..609f3e3 100644 --- a/docs/vector2/reset-eng.md +++ b/docs/vector2/reset-eng.md @@ -26,7 +26,7 @@ vector->y = 0; You should pass valid pointers to these functions. The NULL (0) value is also considered invalid. -This function is good for setting up the initial state of a 3D vector. +This function is good for setting up the initial state of a 2D vector. Example of use: @@ -40,7 +40,7 @@ int main() bgc_fp32_vector2_reset(&my_vector); - printf("x = %f, y = %f\n", my_vector.x1, my_vector.x2); + printf("x = %f, y = %f\n", my_vector.x, my_vector.y); return 0; } diff --git a/docs/vector2/reset-rus.md b/docs/vector2/reset-rus.md index 82eebac..563a4ab 100644 --- a/docs/vector2/reset-rus.md +++ b/docs/vector2/reset-rus.md @@ -1,34 +1,34 @@ -# +# Сброс состояния двумерного вектора -[English version / ](reset-eng.md) +[English version / Английская версия](reset-eng.md) - 0 . +Функции устанавливают значение 0 всем координатам двумерных векторов. - **BGC_FP32_Vector2**: +Функция для **BGC_FP32_Vector2**: ```c inline void bgc_fp32_vector2_reset(BGC_FP32_Vector2* const vector); ``` - **BGC_FP64_Vector2**: +Функция для **BGC_FP64_Vector2**: ```c inline void bgc_fp64_vector2_reset(BGC_FP64_Vector2* const vector); ``` - : +Каждая из данных функции эквивалентна следующим строкам кода: ```c vector->x = 0; vector->y = 0; ``` - **vector** . -NULL (0) . +В параметре **vector** следует передавать корректные указатели. Значение +NULL (0) также считается некорректным. - . +Данная функция хорошо подходит для инициализации начального состояния вектора. - : +Пример применения: ```c #include @@ -40,10 +40,10 @@ int main() bgc_fp32_vector2_reset(&my_vector); - printf("x = %f, y = %f\n", my_vector.x1, my_vector.x2); + printf("x = %f, y = %f\n", my_vector.x, my_vector.y); return 0; } ``` -[](../intro-rus.md) / [2D ](../vector2-rus.md) +[Документация](../intro-rus.md) / [2D векторы](../vector2-rus.md) diff --git a/docs/vector3/copy-rus.md b/docs/vector3/copy-rus.md index 56c5a7a..a888d70 100644 --- a/docs/vector3/copy-rus.md +++ b/docs/vector3/copy-rus.md @@ -1,23 +1,23 @@ -# +# Копирование -[English version / ](copy-eng.md) +[English version / Английская версия](copy-eng.md) - - . +Функции копирования позволяют скопировать значения координат одного вектора +в другой вектор. - **BGC_FP32_Vector3**: +Функция для **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_copy(BGC_FP32_Vector3* const destination, const BGC_FP32_Vector3* const source); ``` - **BGC_FP64_Vector3**: +Функция для **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_copy(BGC_FP64_Vector3* const destination, const BGC_FP64_Vector3* const source); ``` - : +Каждая из данных функции эквивалентна следующим строкам кода: ```c destination->x = source->x; @@ -25,18 +25,18 @@ destination->y = source->y; destination->z = source->z; ``` - **source** **destination** . - NULL (0) . +Параметры **source** и **destination** не должны быть некорректными указателями. +Значение NULL (0) также считается некорректным. - **source** , - . **source** - . +Параметр **source** должен быть указателем на трёхмерный вектор, координаты +которого должны быть скопированы. Координаты вектора **source** не изменятся +после вызова функции. - **destination** , - . **destination** - , **source**. +Параметр **destination** должен быть указателем на трёхмерный вектор, координаты +которого должны быть изменены. Координаты вектора **destination** после вызова +функции станут такими же, как и у вектора **source**. - : +Пример применения: ```c #include @@ -58,4 +58,4 @@ int main() } ``` -[](../intro-rus.md) / [3D ](../vector3-rus.md) +[Документация](../intro-rus.md) / [3D векторы](../vector3-rus.md) diff --git a/docs/vector3/swap-rus.md b/docs/vector3/swap-rus.md index 61c701f..f667f4e 100644 --- a/docs/vector3/swap-rus.md +++ b/docs/vector3/swap-rus.md @@ -5,13 +5,13 @@ Функции обмена позволяют двум векторам одного типа обменяться значениями координат. -Функция для **BgcVector3FP32**: +Функция для **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_swap(BGC_FP32_Vector3* const vector1, BGC_FP32_Vector3* const vector2); ``` -Функция для **BgcVector3FP32**: +Функция для **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_swap(BGC_FP64_Vector3* const vector1, BGC_FP64_Vector3* const vector2);