From 8ba075b55734b11f5d1a193e69857e6c8cac4082 Mon Sep 17 00:00:00 2001 From: Andrey Pokidov Date: Tue, 31 Mar 2026 20:43:10 +0700 Subject: [PATCH] =?UTF-8?q?=D0=90=D0=BA=D1=82=D1=83=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=B7=D0=B0=D1=86=D0=B8=D1=8F=20=D0=B4=D0=BE=D0=BA=D1=83=D0=BC?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B0=D1=86=D0=B8=D0=B8=20=D0=BF=D0=BE=20?= =?UTF-8?q?=D0=BF=D1=80=D0=BE=D0=B5=D0=BA=D1=82=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/intro-eng.md | 79 ++++++++++++++++++++-------------- docs/intro-rus.md | 79 ++++++++++++++++++++-------------- docs/vector2-eng.md | 4 +- docs/vector2-rus.md | 17 ++++---- docs/vector2/copy-eng.md | 28 ++++++------ docs/vector2/copy-rus.md | 37 ++++++++-------- docs/vector3-eng.md | 3 ++ docs/vector3-rus.md | 17 ++++---- docs/vector3/copy-eng.md | 29 ++++++------- docs/vector3/copy-rus.md | 29 ++++++------- docs/vector3/reset-eng.md | 22 ++++++---- docs/vector3/reset-rus.md | 30 +++++++------ docs/vector3/set-values-eng.md | 30 +++++++------ docs/vector3/set-values-rus.md | 38 ++++++++-------- docs/vector3/swap-eng.md | 31 +++++++------ docs/vector3/swap-rus.md | 28 ++++++------ 16 files changed, 279 insertions(+), 222 deletions(-) diff --git a/docs/intro-eng.md b/docs/intro-eng.md index 435407e..988a13f 100644 --- a/docs/intro-eng.md +++ b/docs/intro-eng.md @@ -4,53 +4,66 @@ ## Naming -### Prefixes +C programming language does not have namespaces, thus prefixes often play role of namespaces in C code. -C programming language does not have namespaces, thus prefixes often play role -of namespaces in C code. +The library uses prefixes in names of types, constants and functions to avoid name conflict with of othr libraries. -The library uses prefixes in names of types, constants and functions to avoid -name conflict with of othr libraries. +### Library prefix (the main prefix) The main prefix is **BGC** which means **B**asic **G**eometric **C**omputations. -The structure types and contstans have prefix in the form **Bgc**. For example: -BGC_FP64_Vector3, BGC_FP32_Quaternion, BGC_FP32_Matrix2x2, BGC_FP32_EPSILON, -BGC_FP64_TWO_PI. +The structure types and the contstans have prefix in the form **BGC_**. -The constants have prefix in the form **BGC_**. For example: BGC_EPSYLON_FP32, -BGC_TWO_PI_FP64. +For example, structures: +- BGC_FP64_Vector3 +- BGC_FP32_Quaternion +- BGC_FP32_Matrix2x2 -The functions have prefix in the form **bgc_**. For example: -bgc_fp32_turn3_combine, bgc_fp64_matrix3x3_subtract. +Constants: +- BGC_FP32_EPSILON +- BGC_FP64_TWO_PI -### Suffixes +The functions have prefix in the form **bgc_**, for example: +- bgc_fp32_turn3_combine +- bgc_fp64_matrix3x3_subtract -Suffixs of type ends the names of constats, types and functions of the library. -The library uses two types of floating point numbers: **float** and **double** -(**binary32** and **binary64** types of the **IEEE 754** standard). +### Basic type prefix (the secondary prefix) -Thus there are two suffixes of types: +Prefixs of type ends the names of constats, types and functions of the library. -* **FP32** - means **F**loating **P**oint, **32** bit, which corresponds to the -**float** type of the C language. +The library uses two types of floating point numbers: **float** and **double** (**binary32** and **binary64** types of the **IEEE 754** standard). -* **FP64** - means **F**loating **P**oint, **64** bit, which corresponds to the -**double** type of the C language. +Thus there are two prefixes of types: +- **FP32** - means **F**loating **P**oint, **32** bit, which corresponds to the **float** type of the C programming language. +- **FP64** - means **F**loating **P**oint, **64** bit, which corresponds to the **double** type of the C programming language. -The constants and the types of structures which are based in the **float** type -have **FP32** as the type prefix: BGC_FP32_Vector3, BGC_FP32_Matrix3x2, -BGC_FP32_Quaternion, BGC_FP32_PI, BGC_FP32_EPSILON. +The constants and the types of structures which are based in the **float** type have **FP32_** as the type prefix: +- BGC_FP32_Vector3 +- BGC_FP32_Matrix3x2 +- BGC_FP32_Quaternion +- BGC_FP32_PI +- BGC_FP32_EPSILON -The constants and the types of structures which are based in the **double** type -have **FP64** as the type prefix: BGC_FP64_Vector2, BGC_FP64_Matrix2x3, -BGC_FP64_Turn3, BGC_FP64_HALF_PI, BGC_FP64_ONE_THIRD. +The constants and the types of structures which are based in the **double** type have **FP64_** as the type prefix: +- BGC_FP64_Vector2 +- BGC_FP64_Matrix2x3 +- BGC_FP64_Turn3 +- BGC_FP64_HALF_PI +- BGC_FP64_ONE_THIRD -The functions which works with data of the **float** type have **_fp32** as -the type suffix: bcg_fp32_vector2_get_length, bgc_fp32_radians_to_degrees. +The functions which works with data of the **float** type have **fp32_** as the type prefix: +- bcg_fp32_vector2_get_length +- bgc_fp32_radians_to_degrees -The functions which works with data of the **double** type have **_fp64** as -the type suffix: bgc_fp64_vector3_reset, bgc_fp64_normalize_radians. +The functions which works with data of the **double** type have **fp64_** as the type prefix: +- bgc_fp64_vector3_reset +- bgc_fp64_normalize_radians. + +Using of such prefixes of a basic type allows to enhance the library with new basic types in future. + +### Data types + +- [2D-vectors](vector2-eng.md) +- [3D-vectors](vector3-eng.md) +- [Quaternions](quaternion-rus.md) -Using of such prefixes of a basic type allows to enhance the library with new -basic types in future. \ No newline at end of file diff --git a/docs/intro-rus.md b/docs/intro-rus.md index fcab3da..454e735 100644 --- a/docs/intro-rus.md +++ b/docs/intro-rus.md @@ -4,51 +4,66 @@ ## Особенности наименования -### Префиксы +В языке программирования C (Си) нет пространств имён, потому роль пространств имён играют префиксы в названиях. -В языке программирования C (Си) нет пространств имён, потому роль пространств -имён играют префиксы в названиях. +Библиотека использует префиксы в названиях типов, констант и функций для того, чтобы избежать конфликтов в названиях констант, типов и функций с другими библиотеками. -Библиотека использует префиксы в названиях типов, констант и функций для -того, чтобы избежать конфликтов в названиях констант, типов и функций с другими -библиотеками. +### Префикс библиотеки (основной префикс) -Основным префиксом является **BGC** (сокращение от **B**asic **G**eometric -**C**omputations / Базовые Геометрие Вычисления). +Основным префиксом является **BGC** (сокращение от **B**asic **G**eometric **C**omputations, что можно перевести как "Базовые Геометрие Вычисления"). -Для констант и структур данных префикс имеет вид **BGC_**, например: -BGC_FP64_Vector3, BGC_FP32_Quaternion, BGC_FP32_Matrix2x2, BGC_FP32_EPSILON, -BGC_FP64_TWO_PI. +Для констант и структур данных префикс имеет вид **BGC_** -Функции имеют префикс в виде **bgc_**, например: bgc_fp32_turn3_combine, -bgc_fp64_matrix3x3_subtract. +Например, структуры: +- BGC_FP64_Vector3 +- BGC_FP32_Quaternion +- BGC_FP32_Matrix2x2 + +Константы: +- BGC_FP32_EPSILON +- BGC_FP64_TWO_PI + +Функции имеют префикс в виде **bgc_**, например: +- bgc_fp32_turn3_combine +- bgc_fp64_matrix3x3_subtract + +### Префикс базового типа (вторичный префикс) После префикса библиотеки идёт префикс базового типа. -Библиотека использует два типа чисел с плавающей запятой: **float** и **double** -(типы **binary32** и **binary64** стандарта **IEEE 754**). +Библиотека использует два типа чисел с плавающей запятой: **float** и **double** (типы **binary32** и **binary64** стандарта **IEEE 754**). Поэтому в библиотеке есть два префикса типа: - -* **FP32** - означает **F**loating **P**oint **32** bit, то есть, число с -плавающей запятой, 32 бита, что соответствует типу **float** языка Си. - -* **FP64** - означает **F**loating **P**oint **64** bit, то есть, число с -плавающей запятой, 64 бита, что соответствует типу **double** языка Си. +- **FP32** - означает **F**loating **P**oint **32** bit, то есть, число с плавающей запятой, 32 бита, что соответствует типу **float** языка программирования Си. +- **FP64** - означает **F**loating **P**oint **64** bit, то есть, число с плавающей запятой, 64 бита, что соответствует типу **double** языка программирования Си. Типы структур и константы, основанные на типе **float** имеют префикс **FP32_**: -BGC_FP32_Vector3, BGC_FP32_Matrix3x2, BGC_FP32_Quaternion, BGC_FP32_PI, -BGC_FP32_EPSILON. +- BGC_FP32_Vector3 +- BGC_FP32_Matrix3x2 +- BGC_FP32_Quaternion +- BGC_FP32_PI +- BGC_FP32_EPSILON -Типы структур и константы, основанные на типе **double** имеют префикс -**FP64_**: BGC_FP64_Vector2, BGC_FP64_Matrix2x3, BGC_FP64_Turn3, -BGC_FP64_HALF_PI, BGC_FP64_ONE_THIRD. +Типы структур и константы, основанные на типе **double** имеют префикс **FP64_**: +- BGC_FP64_Vector2 +- BGC_FP64_Matrix2x3 +- BGC_FP64_Turn3 +- BGC_FP64_HALF_PI +- BGC_FP64_ONE_THIRD -Функции, которые работают с данными типа **float** имеют суффикс **_fp32**: -bcg_fp32_vector2_get_length, bgc_fp32_radians_to_degrees. +Функции, которые работают с данными типа **float** имеют префикс **fp32_**: +- bgc_fp32_vector2_get_length +- bgc_fp32_radians_to_degrees -Функции, которые работают с данными типа **double** имеют суффикс **_fp64**: -bgc_fp64_vector3_reset, bgc_fp64_normalize_radians. +Функции, которые работают с данными типа **double** имеют префикс **fp64_**: +- bgc_fp64_vector3_reset +- bgc_fp64_normalize_radians + +Использование подобных префиксов позволяет расширять библиотеку используя новые базовые типы в будущем. + +### Типы данных + +- [Двумерные векторы](vector2-rus.md) +- [Трёхмерные векторы](vector3-rus.md) +- [Кватернионы](quaternion-rus.md) -Использование подобных префиксов позволяет расширять библиотеку используя новые -базовые типы в будущем. \ No newline at end of file diff --git a/docs/vector2-eng.md b/docs/vector2-eng.md index 34f94da..75ef05b 100644 --- a/docs/vector2-eng.md +++ b/docs/vector2-eng.md @@ -20,6 +20,8 @@ Structure definitions: } BGC_FP64_Vector2; ``` +The fields *x* and *y* are the coordinates of a 3D vector. + ## Functions - [Reset](vector2/reset-eng.md) @@ -38,5 +40,5 @@ Structure definitions: - bgc_fp32_vector2_swap - bgc_fp64_vector2_swap - [Documentation](intro-eng.md) + diff --git a/docs/vector2-rus.md b/docs/vector2-rus.md index 3b47106..f19b1ad 100644 --- a/docs/vector2-rus.md +++ b/docs/vector2-rus.md @@ -3,10 +3,8 @@ [English version / Английская версия](vector2-eng.md) В библиотеке есть два типа двумерных векторов: -- **BGC_FP32_Vector2** - вектор с использованием чисел с плавающей запятой -одинарной точности -- **BGC_FP64_Vector2** - вектор с использованием чисел с плавающей запятой -двойной точности +- **BGC_FP32_Vector2** - вектор с использованием чисел с плавающей запятой одинарной точности +- **BGC_FP64_Vector2** - вектор с использованием чисел с плавающей запятой двойной точности Определения структур: @@ -22,22 +20,25 @@ } BGC_FP64_Vector2; ``` +Поля *x* и *y* содержат координаты двумерного вектора. + ## Функции -- [Сброс](vector2/reset-rus.md) +- [Сброс значений координат](vector2/reset-rus.md) - bgc_fp32_vector2_reset - bgc_fp64_vector2_reset -- [Установка координат](vector2/set-values-rus.md) +- [Установка значений координат](vector2/set-values-rus.md) - bgc_fp32_vector2_set_values - bgc_fp64_vector2_set_values -- [Копирование](vector2/copy-rus.md) +- [Копирование значений координат](vector2/copy-rus.md) - bgc_fp32_vector2_copy - bgc_fp64_vector2_copy -- [Обмен значениями](vector2/swap-rus.md) +- [Обмен значениями координат](vector2/swap-rus.md) - bgc_fp32_vector2_swap - bgc_fp64_vector2_swap [Документация](intro-rus.md) + diff --git a/docs/vector2/copy-eng.md b/docs/vector2/copy-eng.md index e19255a..1d548c7 100644 --- a/docs/vector2/copy-eng.md +++ b/docs/vector2/copy-eng.md @@ -1,21 +1,21 @@ -# Copying +# Copying of coordinate values [Русская версия / Russian version](copy-rus.md) -The copy functions allow you to copy the coordinate values of one vector to another vector. - -Function for **BGC_FP32_Vector2**: +The function for **BGC_FP32_Vector2**: ```c inline void bgc_fp32_vector2_copy(BGC_FP32_Vector2* const destination, const BGC_FP32_Vector2* const source); ``` -Function for **BGC_FP64_Vector2**: +The function for **BGC_FP64_Vector2**: ```c inline void bgc_fp64_vector2_copy(BGC_FP64_Vector2* const destination, const BGC_FP64_Vector2* const source); ``` +These functions allow to copy the values of the coordinates of one 2D-vector to another 2D-vector of the same type. + Each of these functions is equivalent to the following lines of code: ```c @@ -23,19 +23,16 @@ destination->x = source->x; destination->y = source->y; ``` -The **source** and **destination** parameters must be valid pointers. -The NULL (0) value is also considered invalid. +### Parameters -The **source** parameter must be a pointer to a two-dimensional vector whose -coordinates are to be copied. The coordinates of the **source** vector will -not change after the function call. +| Parameter | Direction | Description | +| ----------- | ---------- | ----------------------------------------------------------------------- | +| destination | out | A pointer to a vector to set coordinate values from *source* | +| source | in | A pointer to a vector which coordinates will be copied to *destination* | -The **destination** parameter must be a pointer to a two-dimensional vector -whose coordinates are to be changed. The coordinates of the **destination** -vector will become the same as those of the **source** vector after the function -call. +The **source** and **destination** parameters must be valid pointers. The NULL (0) value is also considered invalid. -Example of use: +### Example ```c #include @@ -57,3 +54,4 @@ int main() ``` [Documentation](../intro-eng.md) / [2D vectors](../vector2-eng.md) + diff --git a/docs/vector2/copy-rus.md b/docs/vector2/copy-rus.md index 78b90fe..e37ae43 100644 --- a/docs/vector2/copy-rus.md +++ b/docs/vector2/copy-rus.md @@ -1,41 +1,38 @@ -# +# Копирование значений координат -[English version / ](copy-eng.md) +[English version / Английская версия](copy-eng.md) - - . - - **BGC_FP32_Vector2**: +Функция для **BGC_FP32_Vector2**: ```c inline void bgc_fp32_vector2_copy(BGC_FP32_Vector2* const destination, const BGC_FP32_Vector2* const source); ``` - **BGC_FP64_Vector2**: +Функция для **BGC_FP64_Vector2**: ```c inline void bgc_fp64_vector2_copy(BGC_FP64_Vector2* const destination, const BGC_FP64_Vector2* const source); ``` - : +Функции копирования позволяют скопировать значения координат одного вектора в координаты другого вектора. Оба вектора должны иметь одинаковый тип. + +Каждая из данных функции эквивалентна следующим строкам кода: ```c destination->x = source->x; destination->y = source->y; ``` - **source** **destination** . - NULL (0) . +### Параметры - **source** , - . **source** - . - - **destination** , - . **destination** - , **source**. +| Параметр | Направление | Описание | +| ----------- | ----------- | -------------------------------------------------------------------------------- | +| destination | исходящий | Указатель на вектор, в который будут скопированы значения координат из *source* | +| source | входящий | Указатель на вектор, координаты которого должны быть скопированы в *destination* | - : +Параметры *source* и *destination* должны быть корректными указателями. Значение NULL (0) также считается некорректным. + +### Пример ```c #include @@ -56,4 +53,6 @@ int main() } ``` -[](../intro-rus.md) / [2D ](../vector2-rus.md) +[Документация](../intro-rus.md) / [Двумерные векторы](../vector2-rus.md) + + diff --git a/docs/vector3-eng.md b/docs/vector3-eng.md index 6102563..81fe2bc 100644 --- a/docs/vector3-eng.md +++ b/docs/vector3-eng.md @@ -20,6 +20,8 @@ Structure definitions: } BGC_FP64_Vector3; ``` +The fields *x*, *y* and *z* are the coordinates of a 3D vector. + ## Functions - [Reset](vector3/reset-eng.md) @@ -39,3 +41,4 @@ Structure definitions: - bgc_fp64_vector3_swap [Documentation](intro-eng.md) + diff --git a/docs/vector3-rus.md b/docs/vector3-rus.md index 45c37e1..8d1a37b 100644 --- a/docs/vector3-rus.md +++ b/docs/vector3-rus.md @@ -3,10 +3,8 @@ [English version / Английская версия](vector3-eng.md) В библиотеке есть два типа трёхмерных векторов: -- **BGC_FP32_Vector3** - вектор с использованием чисел с плавающей запятой -одинарной точности -- **BGC_FP64_Vector3** - вектор с использованием чисел с плавающей запятой -двойной точности +- **BGC_FP32_Vector3** - вектор с использованием чисел с плавающей запятой одинарной точности +- **BGC_FP64_Vector3** - вектор с использованием чисел с плавающей запятой двойной точности Определения структур: @@ -22,22 +20,25 @@ } BGC_FP64_Vector3; ``` +Поля *x*, *y* и *z* содержат координаты трёхмерного вектора. + ## Функции -- [Сброс](vector3/reset-rus.md) +- [Сброс значений координат](vector3/reset-rus.md) - bgc_fp32_vector3_reset - bgc_fp64_vector3_reset -- [Установка координат](vector3/set-values-rus.md) +- [Установка значений координат](vector3/set-values-rus.md) - bgc_fp32_vector3_set_values - bgc_fp64_vector3_set_values -- [Копирование](vector3/copy-rus.md) +- [Копирование координат](vector3/copy-rus.md) - bgc_fp32_vector3_copy - bgc_fp64_vector3_copy -- [Обмен значениями](vector3/swap-rus.md) +- [Обмен значениями координат](vector3/swap-rus.md) - bgc_fp32_vector3_swap - bgc_fp64_vector3_swap [Документация](intro-rus.md) + diff --git a/docs/vector3/copy-eng.md b/docs/vector3/copy-eng.md index 98585f4..bae43d4 100644 --- a/docs/vector3/copy-eng.md +++ b/docs/vector3/copy-eng.md @@ -1,22 +1,21 @@ -# Copying +# Copying of coordinate values [Русская версия / Russian version](copy-rus.md) -The copy functions allow you to copy the coordinate values of one vector -to another vector. - -Function for **BGC_FP32_Vector3**: +The function for **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_copy(BGC_FP32_Vector3* const destination, const BGC_FP32_Vector3* const source); ``` -Function for **BGC_FP64_Vector3**: +The function for **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_copy(BGC_FP64_Vector3* const destination, const BGC_FP64_Vector3* const source); ``` +These functions allow to copy the values of the coordinates of one 3D-vector to another 3D-vector of the same type. + Each of these functions is equivalent to the following lines of code: ```c @@ -25,19 +24,16 @@ destination->y = source->y; destination->z = source->z; ``` -The **source** and **destination** parameters must not be invalid pointers. -The NULL (0) value is also considered invalid. +### Parameters -The **source** parameter must be a pointer to a three-dimensional vector whose -coordinates are to be copied. The coordinates of the **source** vector will -not change after the function call. +| Parameter | Direction | Description | +| ----------- | ---------- | ----------------------------------------------------------------------- | +| destination | out | A pointer to a vector to set coordinate values from *source* | +| source | in | A pointer to a vector which coordinates will be copied to *destination* | -The **destination** parameter must be a pointer to a three-dimensional vector -whose coordinates are to be changed. The coordinates of the **destination** -vector will become the same as those of the **source** vector after the function -call. +The **source** and **destination** parameters must be valid pointers. The NULL (0) value is also considered invalid. -Example of use: +### Example ```c #include @@ -60,3 +56,4 @@ int main() ``` [Documentation](../intro-eng.md) / [3D vectors](../vector3-eng.md) + diff --git a/docs/vector3/copy-rus.md b/docs/vector3/copy-rus.md index 9883250..99c03df 100644 --- a/docs/vector3/copy-rus.md +++ b/docs/vector3/copy-rus.md @@ -1,10 +1,7 @@ -# Копирование +# Копирование значений координат [English version / Английская версия](copy-eng.md) -Функции копирования позволяют скопировать значения координат одного вектора -в другой вектор. - Функция для **BGC_FP32_Vector3**: ```c @@ -17,6 +14,8 @@ inline void bgc_fp32_vector3_copy(BGC_FP32_Vector3* const destination, const BGC inline void bgc_fp64_vector3_copy(BGC_FP64_Vector3* const destination, const BGC_FP64_Vector3* const source); ``` +Функции копирования позволяют скопировать значения координат одного вектора в координаты другого вектора. Оба вектора должны иметь одинаковый тип. + Каждая из данных функции эквивалентна следующим строкам кода: ```c @@ -25,18 +24,16 @@ destination->y = source->y; destination->z = source->z; ``` -Параметры **source** и **destination** не должны быть некорректными указателями. -Значение NULL (0) также считается некорректным. +### Параметры -Параметр **source** должен быть указателем на трёхмерный вектор, координаты -которого должны быть скопированы. Координаты вектора **source** не изменятся -после вызова функции. - -Параметр **destination** должен быть указателем на трёхмерный вектор, координаты -которого должны быть изменены. Координаты вектора **destination** после вызова -функции станут такими же, как и у вектора **source**. +| Параметр | Направление | Описание | +| ----------- | ----------- | -------------------------------------------------------------------------------- | +| destination | исходящий | Указатель на вектор, в который будут скопированы значения координат из *source* | +| source | входящий | Указатель на вектор, координаты которого должны быть скопированы в *destination* | -Пример применения: +Параметры *source* и *destination* должны быть корректными указателями. Значение NULL (0) также считается некорректным. + +### Пример ```c #include @@ -58,4 +55,6 @@ int main() } ``` -[Документация](../intro-rus.md) / [3D векторы](../vector3-rus.md) +[Документация](../intro-rus.md) / [Трёхмерные векторы](../vector3-rus.md) + + diff --git a/docs/vector3/reset-eng.md b/docs/vector3/reset-eng.md index 4b51dab..72b6262 100644 --- a/docs/vector3/reset-eng.md +++ b/docs/vector3/reset-eng.md @@ -2,20 +2,20 @@ [Русская версия / Russian version](reset-rus.md) -These functions set all coordinates of 3D vectors to 0. - -Function for **BGC_FP32_Vector3**: +The function for **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_reset(BGC_FP32_Vector3* const vector); ``` -Function for **BGC_FP64_Vector3**: +The function for **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_reset(BGC_FP64_Vector3* const vector); ``` +These functions set all coordinates of 3D vectors to 0. + Each of these functions is equivalent to the following lines of code: ```c @@ -24,12 +24,17 @@ vector->y = 0; vector->z = 0; ``` -You should not pass invalid 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. -Example of use: +### Parameters + +| Parameter | Direction | Description | +| ---------- | ---------- | -------------------------------------------------------- | +| vector | out | A pointer to a vector which coordinated must be set to 0 | + +You should pass only valid pointers in the parameter *vector*. The NULL (0) value is considered invalid. + +### Example ```c #include @@ -48,3 +53,4 @@ int main() ``` [Documentation](../intro-eng.md) / [3D vectors](../vector3-eng.md) + diff --git a/docs/vector3/reset-rus.md b/docs/vector3/reset-rus.md index 0476403..838cd16 100644 --- a/docs/vector3/reset-rus.md +++ b/docs/vector3/reset-rus.md @@ -1,22 +1,22 @@ -# +# Сброс состояния трёхмерного вектора -[English version / ](reset-eng.md) +[English version / Английская версия](reset-eng.md) - 0 . - - **BGC_FP32_Vector3**: +Функиция для **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_reset(BGC_FP32_Vector3* const vector); ``` - **BGC_FP64_Vector3**: +Функиция для **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_reset(BGC_FP64_Vector3* const vector); ``` - : +Данные функции устанавливают значения всех кооординат равным 0. + +Каждая из функций соответствуют следуюим трём строкам кода: ```c vector->x = 0; @@ -24,12 +24,17 @@ vector->y = 0; vector->z = 0; ``` - . NULL (0) - . +Данные функции подходят для иницализации начального состояния трёхмерного вектора. - . +### Параметры - : +| Параметр | Направление | Описание | +| -------- | ----------- | -------------------------------------------------------------------- | +| vector | исходящий | Указатель на вектор, координаты которого должны быть установлены в 0 | + +Необходимо передавать только корректные указатели в параметр *vector*. Значение NULL (0) также считается некорректным. + +### Пример ```c #include @@ -47,4 +52,5 @@ int main() } ``` -[](../intro-rus.md) / [3D ](../vector3-rus.md) +[Документация](../intro-eng.md) / [Трёхмерные векторы](../vector3-eng.md) + diff --git a/docs/vector3/set-values-eng.md b/docs/vector3/set-values-eng.md index 29a4aca..c197b8e 100644 --- a/docs/vector3/set-values-eng.md +++ b/docs/vector3/set-values-eng.md @@ -2,21 +2,22 @@ [Русская версия / Russian version](set-values-rus.md) -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 **BGC_FP32_Vector3**: +The function for **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_set_values(BGC_FP32_Vector3* const destination, const float x, const float y, const float z); ``` -Function for **BGC_FP64_Vector3**: +The function for **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_set_values(BGC_FP64_Vector3* const destination, const double x, const double y, const double z); ``` +These functions allow to set the values of coordinates in one-line. + +The functions are especially useful when the values are constants like in the example below. + Each of these functions is equivalent to the following lines of code: ```c @@ -25,14 +26,18 @@ destination->y = y; destination->z = z; ``` -Invalid pointers should not be passed in the **destination** parameter. -The NULL (0) value is also considered invalid. +### Parameters -This function is good for setting up the initial values of coordinates with -one-line especially when the values are fixed constants like in the example -below. +| Parameter | Direction | Description | +| ----------- | --------- | ------------------------------------------------------- | +| destination | out | A pointer to a 3D-vector, which coordinates must be set | +| x | in | A new value for the X-coordinate | +| y | in | A new value for the Y-coordinate | +| z | in | A new value for the Z-coordinate | -Example of use: +The *destination* parameter must be a valid pointer. The NULL (0) value is considered invalid. + +### Example ```c #include @@ -42,7 +47,7 @@ int main() { BGC_FP32_Vector3 v; - bgc_fp32_vector3_set_values(&v, -2.2f, 7.1f, 10.01f); + bgc_fp32_vector3_set_values(&v, -2.2f, 7.8f, 10.01f); printf("x = %f, y = %f, z = %f\n", v.x, v.y, v.z); @@ -51,3 +56,4 @@ int main() ``` [Documentation](../intro-eng.md) / [3D vectors](../vector3-eng.md) + diff --git a/docs/vector3/set-values-rus.md b/docs/vector3/set-values-rus.md index b327329..5d0f625 100644 --- a/docs/vector3/set-values-rus.md +++ b/docs/vector3/set-values-rus.md @@ -1,24 +1,24 @@ -# +# Задание координат трёхмерного вектора. -[English version / ](set-values-eng.md) +[English version / Английская версия](set-values-eng.md) - , . - , - . - - **BGC_FP32_Vector3**: +Функция для **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_set_values(BGC_FP32_Vector3* const destination, const float x, const float y, const float z); ``` - **BGC_FP64_Vector3**: +Функция для **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_set_values(BGC_FP64_Vector3* const destination, const double x, const double y, const double z); ``` - : +Данные функции позволяют задать значения координат вектора одной строкой. + +Такая возможность может быть удобна, когда нужно указать значения координат с помощью числовых констант как в примере ниже. + +Каждая из функций аналогична следующим трём строкам кода: ```c destination->x = x; @@ -26,14 +26,18 @@ destination->y = y; destination->z = z; ``` - **destination** . - NULL (0) . +### Параметры - -. - . +| Параметр | Направление | Описание | +| ----------- | ----------- | -------------------------------------------------------------- | +| destination | исходящий | Указатель на вектор, координаты которого будут заданы функцией | +| x | входящий | Значение координаты X | +| y | входящий | Значение координаты Y | +| z | входящий | Значение координаты Z | - : +Параметр *destination* должен быть корректным указателем. Значение NULL (0) считается некорректным. + +### Пример ```c #include @@ -43,7 +47,7 @@ int main() { BGC_FP32_Vector3 v; - bgc_fp32_vector3_set_values(&v, -2.2f, 7.1f, 10.01f); + bgc_fp32_vector3_set_values(&v, -2.2f, 7.8f, 10.01f); printf("x = %f, y = %f, z = %f\n", v.x, v.y, v.z); @@ -51,4 +55,4 @@ int main() } ``` -[](../intro-rus.md) / [3D ](../vector3-rus.md) +[Документация](../intro-rus.md) / [Трёхмерные векторы](../vector3-rus.md) diff --git a/docs/vector3/swap-eng.md b/docs/vector3/swap-eng.md index 2b6456f..492a808 100644 --- a/docs/vector3/swap-eng.md +++ b/docs/vector3/swap-eng.md @@ -1,32 +1,35 @@ -# Swapping +# Swapping of coordinate values [Русская версия / Russian version](swap-rus.md) -The exchange functions allow two vectors of the same type to exchange coordinate -values. - -Function for **BGC_FP32_Vector3**: +The function for **BGC_FP32_Vector3**: ```c inline void bgc_fp32_vector3_swap(BGC_FP32_Vector3* const vector1, BGC_FP32_Vector3* const vector2); ``` -Function for **BGC_FP64_Vector3**: +The function for **BGC_FP64_Vector3**: ```c inline void bgc_fp64_vector3_swap(BGC_FP64_Vector3* const vector1, BGC_FP64_Vector3* const vector2); ``` -The **vector1** and **vector2** parameters must be valid pointers. -The NULL (0) value is considered invalid. +These functions allow to swap the values of the coordinates of two vectors of the same type. -Vector **vector1** after calling this function will have the coordinate values -that vector **vector3** had before calling the function. +### Parameters -And vector **vector3** after calling this function will have the same coordinate -values that vector **vector1** had before calling the function. +| Parameter | Direction | Description | +| --------- | --------- | ---------------------------------------------------------------------------------------- | +| vector1 | in / out | A pointer to a 3D vector where the values of the coordinates of *vector2* will be copied | +| vector2 | in / out | A pointer to a 3D vector where the values of the coordinates of *vector1* will be copied | -Example of use: +The *vector1* and *vector2* parameters must be valid pointers. The NULL (0) value is considered invalid. + +The *vector1* vector will have the same values of the coordinates as *vector2* had before the calling of the function. + +And the *vector2* vector will have the same values of the coordinates as *vector1* had before the calling of the function. + +### Example ```c #include @@ -48,7 +51,7 @@ int main() } ``` -Result: +Output: ``` Vector #1: x = 10.000000, y = -1.000000, z = -3.000000 diff --git a/docs/vector3/swap-rus.md b/docs/vector3/swap-rus.md index 75e0afc..e0428e3 100644 --- a/docs/vector3/swap-rus.md +++ b/docs/vector3/swap-rus.md @@ -1,10 +1,7 @@ -# Обмен значениями +# Обмен значениями координат [English version / Английская версия](swap-eng.md) -Функции обмена позволяют двум векторам одного типа обменяться значениями -координат. - Функция для **BGC_FP32_Vector3**: ```c @@ -17,16 +14,22 @@ inline void bgc_fp32_vector3_swap(BGC_FP32_Vector3* const vector1, BGC_FP32_Vect inline void bgc_fp64_vector3_swap(BGC_FP64_Vector3* const vector1, BGC_FP64_Vector3* const vector2); ``` -Параметры **vector1** и **vector2** не должны быть некорректными указателями. -Значение NULL (0) также считается некорректным. +Функции обмена значениями позволяют двум векторам одного типа обменяться значениями координат. -Вектор **vector1** после вызова данной функции будет иметь значения координат, -какие имел вектор **vector2** до вызова функции. +### Параметры -А вектор **vector2** после вызова данной функции будет иметь такие же значения -координат, какие имел вектор **vector1** до вызова функции. +| Параметр | Направление | Описание | +| --------- | -------------------- | -------------------------------------------------------------------------------- | +| vector1 | исходящий / входящий | Указатель на вектор, в который будут скопированы значения координат из *vector2* | +| vector2 | исходящий / входящий | Указатель на вектор, в который будут скопированы значения координат из *vector1* | -Пример применения: +Параметры *vector1* и *vector2* должны быть корректными указателями на структуры трёхмерных векторов. Значение NULL (0) считается некорректным. + +После вызова функции вектор *vector1* будет иметь такие же значения координат, как вектор *vector2* до вызова функции. + +А вектор *vector2* после вызова функции будет иметь координаты, такие же, как у вектора *vector1* до вызова функции. + +### Пример ```c #include @@ -55,4 +58,5 @@ Vector #1: x = 10.000000, y = -1.000000, z = -3.000000 Vector #2: x = -2.000000, y = 7.000000, z = 5.000000 ``` -[Документация](../intro-rus.md) / [3D векторы](../vector3-rus.md) +[Документация](../intro-rus.md) / [Трёхмерные векторы](../vector3-rus.md) +