36 lines
807 B
Markdown
36 lines
807 B
Markdown
# Reset functions for versors
|
|
|
|
The functions reset the state of versors to the state of no turn:
|
|
|
|
s0 = 1, x1 = 0, x2 = 0, x3 = 0
|
|
|
|
For the **BgFP32Versor** type the function is:
|
|
|
|
void bg_fp32_versor_reset(BgFP32Versor* versor);
|
|
|
|
For the **BgFP64Versor** type the function is:
|
|
|
|
void bg_fp64_versor_reset(BgFP64Versor* versor);
|
|
|
|
These functions are good for setting the initial state of variables and fields
|
|
of **BgFP32Versor** and **BgFP64Versor** types.
|
|
|
|
Example of usage:
|
|
|
|
#include <stdio.h>
|
|
#include <basic-geometry.h>
|
|
|
|
int main() {
|
|
BgFP32Versor versor;
|
|
|
|
bg_fp32_versor_reset(&versor);
|
|
|
|
printf("Versor: (%f, %f, %f, %f)\n", versor.s0, versor.x1, versor.x2, versor.x3);
|
|
|
|
return 0;
|
|
}
|
|
|
|
Result:
|
|
|
|
Versor: (1.000000, 0.000000, 0.000000, 0.000000)
|
|
|