Работа над документацией по библиотеке

This commit is contained in:
Andrey Pokidov 2026-04-01 20:44:49 +07:00
parent 8ba075b557
commit e2bf8d28a8
17 changed files with 233 additions and 69 deletions

View file

@ -1,10 +1,7 @@
# Copying
# Copying of component values
[Русская версия / Russian version](copy-rus.md)
The copy functions allow you to copy the component values of one quaternion
to another quaternion.
Function for **BGC_FP32_Quaternion**:
```c
@ -17,6 +14,8 @@ Function for **BGC_FP64_Quaternion**:
inline void bgc_fp64_quaternion_copy(BGC_FP64_Quaternion* const destination, const BGC_FP64_Quaternion* const source);
```
These functions allow to copy the component values of one quaternion to another quaternion.
Each of these functions is equivalent to the following lines of code:
```c
@ -26,18 +25,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 quaternion which components
are to be copied. The coordinates of the **source** quaternion will
not change after the function call.
| Parameter | Direction | Description |
| ----------- | ---------- | -------------------------------------------------------------------------------- |
| destination | out | A pointer to a quaternion to set component values from *source* |
| source | in | A pointer to a quaternion which component values will be copied to *destination* |
The **destination** parameter must be a pointer to a quaternion which components
are to be changed. The coordinates of the **destination** quaternion will become
the same as those of the **source** quaternion 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>
@ -61,3 +58,4 @@ int main()
```
[Documentation](../intro-eng.md) / [Quaternions](../quaternion-eng.md)

View file

@ -1,10 +1,7 @@
# Копирование
# Копирование значений компотент
[English version / Английская версия](copy-eng.md)
Функции копирования позволяют скопировать значения компонент одного кватерниона
в другой кватернион.
Функция для **BGC_FP32_Quaternion**:
```c
@ -17,6 +14,9 @@ inline void bgc_fp32_quaternion_copy(BGC_FP32_Quaternion* const destination, con
inline void bgc_fp64_quaternion_copy(BGC_FP64_Quaternion* const destination, const BGC_FP64_Quaternion* const source);
```
Данные функции позволяют скопировать значения компонентов одного кватерниона в другой кватернион.
Каждая из данных функции эквивалентна следующим строкам кода:
```c
@ -26,18 +26,16 @@ destination->y = source->y;
destination->z = source->z;
```
Параметры **source** и **destination** должны быть корректными указателями.
Значение NULL (0) также считается некорректным.
### Parameters
Параметр **source** должен быть указателем на кватернион, компоненты которого
должны быть скопированы. Компоненты кватерниона **source** не изменятся после
вызова функции.
Параметр **destination** должен быть указателем на кватернионы, компоненты
которого должны быть изменены. Координаты кватерниона **destination** после
вызова функции станут такими же, как и у кватерниона **source**.
| Параметр | Направление | Описание |
| ----------- | ----------- | ------------------------------------------------------------------------------------- |
| destination | исходящий | Указатель на кватернион, в который будут скопированы значения компонентов из *source* |
| source | входящий | Указатель на кватернион, компоненты которого должны быть скопированы в *destination* |
Пример применения:
Параметры *source* и *destination* должны быть корректными указателями. Значение NULL (0) также считается некорректным.
### Пример
```c
#include <stdio.h>
@ -61,3 +59,4 @@ int main()
```
[Документация](../intro-rus.md) / [Кватернионы](../quaternion-rus.md)

View file

@ -2,8 +2,6 @@
[Русская версия / Russian version](reset-rus.md)
These functions set all parts of a quaternion to 0.
Function for **BGC_FP32_Quaternion**:
```c
@ -16,6 +14,8 @@ Function for **BGC_FP64_Quaternion**:
inline void bgc_fp64_quaternion_reset(BGC_FP64_Quaternion* const quaternion);
```
These functions set all the components of a quaternion to zero.
Each of these functions is equivalent to the following lines of code:
```c
@ -25,12 +25,17 @@ vector->y = 0;
vector->z = 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:
### Parameter
| Parameter | Direction | Description |
| ---------- | --------- | ------------------------------------------------------------ |
| quaternion | out | A pointer to a quaternions which components must be set to 0 |
You should pass only valid pointers in the parameter *quaternion*. The NULL (0) value is considered invalid.
### Example
```c
#include <stdio.h>
@ -49,3 +54,4 @@ int main()
```
[Documentation](../intro-eng.md) / [Quaternions](../quaternion-eng.md)

View file

@ -2,8 +2,6 @@
[English version / Английская версия](reset-eng.md)
Функции устанавливают значение 0 всем координатам двумерных векторов.
Функция для **BGC_FP32_Quaternion**:
```c
@ -16,6 +14,8 @@ inline void bgc_fp32_quaternion_reset(BGC_FP32_Quaternion* const quaternion);
inline void bgc_fp64_quaternion_reset(BGC_FP64_Quaternion* const quaternion);
```
Функции устанавливают значение 0 всем компонентам кватерниона.
Каждая из данных функции эквивалентна следующим строкам кода:
```c
@ -25,13 +25,17 @@ vector->y = 0;
vector->z = 0;
```
В параметре **quaternion** следует передавать корректный указатель на
существующую область памяти. Значение NULL (0) считается некорректным.
Данная функция хорошо подходит для инициализации начального состояния кватерниона.
Данная функция хорошо подходит для инициализации начального состояния
кватерниона.
### Параметр
Пример применения:
| Параметр | Направление | Описание |
| ---------- | ----------- | ------------------------------------------------------------------------ |
| quaternion | исходящий | Указатель на кватернион, компоненты которого должны быть установлены в 0 |
Необходимо передавать только корректные указатели в параметр *quaternion*. Значение NULL (0) также считается некорректным.
### Пример
```c
#include <stdio.h>
@ -50,3 +54,4 @@ int main()
```
[Документация](../intro-rus.md) / [Кватернионы](../quaternion-rus.md)

View file

@ -28,7 +28,7 @@ And the quaternion **quarternion2** after calling this function will have
the same compnent values the quaternion **quarternion1** had before calling
the function.
Example of use:
### Example
```c
#include <stdio.h>

View file

@ -26,7 +26,7 @@ inline void bgc_fp64_quaternion_swap(BGC_FP64_Quaternion* const quarternion1, BG
А кватернион **quarternion2** после вызова данной функции будет иметь такие же
значения компонет, какие имел кватернион **quarternion1** до вызова функции.
Пример применения:
### Пример
```c
#include <stdio.h>