Исправление и расширение документации по векторам и кватернионам
This commit is contained in:
parent
460fe94830
commit
cc3ce1f327
8 changed files with 142 additions and 33 deletions
49
docs/quaternion/reset-eng.md
Normal file
49
docs/quaternion/reset-eng.md
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
# Resetting the state of a Quaternion
|
||||
|
||||
[Русская версия / Russian version](reset-rus.md)
|
||||
|
||||
These functions set all parts of a quaternion to 0.
|
||||
|
||||
Function for **BGC_FP32_Quaternion**:
|
||||
|
||||
```c
|
||||
inline void bgc_fp32_quaternion_reset(BGC_FP32_Quaternion* const quaternion);
|
||||
```
|
||||
|
||||
Function for **BGC_FP64_Quaternion**:
|
||||
|
||||
```c
|
||||
inline void bgc_fp64_quaternion_reset(BGC_FP64_Quaternion* const quaternion);
|
||||
```
|
||||
|
||||
Each of these functions is equivalent to the following lines of code:
|
||||
|
||||
```c
|
||||
vector->x = 0;
|
||||
vector->y = 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:
|
||||
|
||||
```c
|
||||
#include <stdio.h>
|
||||
#include <basic-geometry.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
BGC_FP64_Quaternion quaternion;
|
||||
|
||||
bgc_fp32_quaternion_reset(&quaternion);
|
||||
|
||||
printf("s = %lf, x = %lf, y = %lf, z = %lf\n", quaternion.s, quaternion.x, quaternion.y, quaternion.z);
|
||||
|
||||
return 0;
|
||||
}
|
||||
```
|
||||
|
||||
[Documentation](../intro-eng.md) / [2D vectors](../quaternion-eng.md)
|
||||
Loading…
Add table
Add a link
Reference in a new issue