Актуализация документации по проекту

This commit is contained in:
Andrey Pokidov 2026-03-31 20:43:10 +07:00
parent ed404690ed
commit 8ba075b557
16 changed files with 279 additions and 222 deletions

View file

@ -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 <stdio.h>
@ -60,3 +56,4 @@ int main()
```
[Documentation](../intro-eng.md) / [3D vectors](../vector3-eng.md)

View file

@ -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 <stdio.h>
@ -58,4 +55,6 @@ int main()
}
```
[Документация](../intro-rus.md) / [3D векторы](../vector3-rus.md)
[Документация](../intro-rus.md) / [Трёхмерные векторы](../vector3-rus.md)

View file

@ -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 <stdio.h>
@ -48,3 +53,4 @@ int main()
```
[Documentation](../intro-eng.md) / [3D vectors](../vector3-eng.md)

View file

@ -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 <stdio.h>
@ -47,4 +52,5 @@ int main()
}
```
[Документация](../intro-rus.md) / [3D векторы](../vector3-rus.md)
[Документация](../intro-eng.md) / [Трёхмерные векторы](../vector3-eng.md)

View file

@ -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 <stdio.h>
@ -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)

View file

@ -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 <stdio.h>
@ -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)

View file

@ -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 <stdio.h>
@ -48,7 +51,7 @@ int main()
}
```
Result:
Output:
```
Vector #1: x = 10.000000, y = -1.000000, z = -3.000000

View file

@ -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 <stdio.h>
@ -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)