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

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,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