Math.
More...
#include <gf_pre.h>
#include <gf_macro.h>
#include <gf_type/math.h>
Go to the source code of this file.
Math.
Definition in file gf_math.h.
◆ GF_MATH_PI
#define GF_MATH_PI 3.14159265 |
◆ GF_MATH_VECTOR_COPY
#define GF_MATH_VECTOR_COPY |
( |
|
from, |
|
|
|
to |
|
) |
| |
Value: to[0] = from[0]; \
to[1] = from[1]; \
to[2] = from[2]
Copy vector.
- Parameters
-
Definition at line 32 of file gf_math.h.
◆ gf_math_cot()
double gf_math_cot |
( |
double |
x | ) |
|
|
extern |
Calculate cot(x)
- Parameters
-
- Returns
- cot(x)
Definition at line 62 of file gf_math.c.
◆ gf_math_log2()
double gf_math_log2 |
( |
double |
x | ) |
|
|
extern |
Calculate log2(x)
- Parameters
-
- Returns
- log2(x)
Definition at line 15 of file gf_math.c.
◆ gf_math_multiply()
Multiply vector by vector.
- Parameters
-
Definition at line 56 of file gf_math.c.
◆ gf_math_nearest_2pow()
double gf_math_nearest_2pow |
( |
double |
x | ) |
|
|
extern |
Get nearest 2^n.
- Parameters
-
- Returns
- Nearest 2^n
Definition at line 64 of file gf_math.c.
◆ gf_math_normal()
Calculate normal of triangle v0,v1,v2.
- Parameters
-
r | Result |
v0 | Input |
v1 | Input |
v2 | Input |
Definition at line 38 of file gf_math.c.
◆ gf_math_normalize()
Normalize vector.
- Parameters
-
Definition at line 17 of file gf_math.c.
◆ gf_math_subtract()
Subtract vector by vector.
- Parameters
-
Definition at line 50 of file gf_math.c.