GoldFish Engine
Quite simple and lightweight game engine
Loading...
Searching...
No Matches
gf_math.h
Go to the documentation of this file.
1
7#ifndef __GF_MATH_H__
8#define __GF_MATH_H__
9
10#include <gf_pre.h>
11#include <gf_macro.h>
12
13/* Type */
14#include <gf_type/math.h>
15
16/* Engine */
17
18/* Standard */
19
24#define GF_MATH_PI 3.14159265
25
32#define GF_MATH_VECTOR_COPY(from, to) \
33 to[0] = from[0]; \
34 to[1] = from[1]; \
35 to[2] = from[2]
36
43GF_EXPORT double gf_math_log2(double x);
44
54
61GF_EXPORT double gf_math_cot(double x);
62
69GF_EXPORT double gf_math_nearest_2pow(double x);
70
77
86
95
96#endif
#define GF_EXPORT
Macro for platform-dependent symbol export/import.
Definition gf_macro.h:190
double gf_math_log2(double x)
Calculate log2(x)
Definition gf_math.c:15
void gf_math_multiply(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1)
Multiply vector by vector.
Definition gf_math.c:56
void gf_math_normalize(gf_math_vector_t v)
Normalize vector.
Definition gf_math.c:17
void gf_math_normal(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1, gf_math_vector_t v2)
Calculate normal of triangle v0,v1,v2.
Definition gf_math.c:38
void gf_math_subtract(gf_math_vector_t r, gf_math_vector_t v0, gf_math_vector_t v1)
Subtract vector by vector.
Definition gf_math.c:50
double gf_math_cot(double x)
Calculate cot(x)
Definition gf_math.c:62
double gf_math_nearest_2pow(double x)
Get nearest 2^n.
Definition gf_math.c:64
Required headers before anything.
Type definitions related to math.
double gf_math_vector_t[4]
Vector.
Definition math.h:25