1 KiB
1 KiB
Resetting the state of a Quaternion
Русская версия / Russian version
These functions set all parts of a quaternion to 0.
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);
Each of these functions is equivalent to the following lines of code:
vector->s = 0;
vector->x = 0;
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:
#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;
}