Обновление документации по векторам и кватернионам

This commit is contained in:
Andrey Pokidov 2026-03-30 01:05:57 +07:00
parent 2fd2578bb3
commit 460fe94830
20 changed files with 237 additions and 138 deletions

View file

@ -1,27 +1,32 @@
# Resetting the state of a 2D vector
[Русская версия / Russian version](reset-rus.md)
These functions set all coordinates of 2D vectors to 0.
Function for **BgcVector2FP32**:
Function for **BGC_FP32_Vector2**:
```c
inline void bgc_vector2_reset_fp32(BgcVector2FP32* vector);
inline void bgc_fp32_vector2_reset(BGC_FP32_Vector2* const vector);
```
Function for **BgcVector2FP64**:
Function for **BGC_FP64_Vector2**:
```c
inline void bgc_vector2_reset_fp64(BgcVector2FP64* vector);
inline void bgc_fp64_vector2_reset(BGC_FP64_Vector2* const vector);
```
Each of these functions is equivalent to the following lines of code:
```c
vector->x1 = 0;
vector->x2 = 0;
vector->x = 0;
vector->y = 0;
```
You should not pass invalid pointers to these functions. The NULL (0) value is also considered invalid.
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.
Example of use:
@ -31,11 +36,11 @@ Example of use:
int main()
{
BgcVector2FP32 my_vector;
BGC_FP32_Vector2 my_vector;
bgc_vector2_reset_fp32(&my_vector);
bgc_fp32_vector2_reset(&my_vector);
printf("x1 = %f, x2 = %f\n", my_vector.x1, my_vector.x2);
printf("x = %f, y = %f\n", my_vector.x1, my_vector.x2);
return 0;
}