1.3 KiB
1.3 KiB
Resetting the state of a Quaternion
Русская версия / Russian version
Function for BGC_FP32_Quaternion:
inline void bgc_fp32_quaternion_reset(BGC_FP32_Quaternion* const quaternion);
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:
vector->s = 0;
vector->x = 0;
vector->y = 0;
vector->z = 0;
This function is good for setting up the initial state of a quaternion.
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
#include <stdio.h>
#include <basic-geometry.h>
int main()
{
BGC_FP64_Quaternion q;
bgc_fp64_quaternion_reset(&q);
printf("s = %lf, x = %lf, y = %lf, z = %lf\n", q.s, q.x, q.y, q.z);
return 0;
}