reference

This documentation is automatically generated from the openFrameworks source code using doxygen and refers to the most recent release, version 0.12.0.

ofMathConstants.h
Go to the documentation of this file.
1#pragma once
2
3#include "ofConstants.h"
4#include "glm/fwd.hpp"
5
6#if OF_USE_LEGACY_VECTOR_MATH
7class ofVec2f;
8class ofVec3f;
9class ofVec4f;
13#else
14using ofDefaultVec2 = glm::vec2;
15using ofDefaultVec3 = glm::vec3;
16using ofDefaultVec4 = glm::vec4;
17#endif
18
19
20#ifndef PI
21 #define PI 3.14159265358979323846
22#endif
23
24#ifndef TWO_PI
25 #define TWO_PI 6.28318530717958647693
26#endif
27
28#ifndef M_TWO_PI
29 #define M_TWO_PI 6.28318530717958647693
30#endif
31
32#ifndef FOUR_PI
33 #define FOUR_PI 12.56637061435917295385
34#endif
35
36#ifndef HALF_PI
37 #define HALF_PI 1.57079632679489661923
38#endif
39
40#ifndef DEG_TO_RAD
41 #define DEG_TO_RAD (PI/180.0)
42#endif
43
44#ifndef RAD_TO_DEG
45 #define RAD_TO_DEG (180.0/PI)
46#endif
47
48#ifndef MIN
49 #define MIN(x,y) (((x) < (y)) ? (x) : (y))
50#endif
51
52#ifndef MAX
53 #define MAX(x,y) (((x) > (y)) ? (x) : (y))
54#endif
55
56#ifndef CLAMP
57 #define CLAMP(val,min,max) ((val) < (min) ? (min) : ((val > max) ? (max) : (val)))
58#endif
59
60#ifndef ABS
61 #define ABS(x) (((x) < 0) ? -(x) : (x))
62#endif
63
ofVec2f is a class for storing a two dimensional vector.
Definition ofVec2f.h:72
ofVec3f is a class for storing a three dimensional vector.
Definition ofVec3f.h:79
Definition ofVec4f.h:11
glm::vec3 ofDefaultVec3
Definition ofMathConstants.h:15
glm::vec4 ofDefaultVec4
Definition ofMathConstants.h:16
glm::vec2 ofDefaultVec2
Definition ofMathConstants.h:14