-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathEasing.h
More file actions
executable file
·102 lines (82 loc) · 3.9 KB
/
Easing.h
File metadata and controls
executable file
·102 lines (82 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
/*******************************************************************************************
Easing equations for Arduino v0.1
These functions were quickly mashed together and the code could probably need some
tidying up e.g. in terms of memory management (all variables are floats).
All functions are put in the namespace "Easing".
July 27, 2009
Translated by Tobias Toft
hello@tobiastoft.dk
Based on the work by Robert Penner.
******************************************************************************************
Easing Equations v1.5
May 1, 2003
(c) 2003 Robert Penner, all rights reserved.
This work is subject to the terms in http://www.robertpenner.com/easing_terms_of_use.html.
These tweening functions provide different flavors of
math-based motion under a consistent API.
Types of easing:
Linear
Quadratic
Cubic
Quartic
Quintic
Sinusoidal
Exponential
Circular
Elastic
Elastic (four parameter version) <-- for passing functions as parameters to other functions
Back
Back (four parameter version) <-- for passing functions as parameters to other functions
Bounce
Discussed in Chapter 7 of
Robert Penner's Programming Macromedia Flash MX
(including graphs of the easing equations)
http://www.robertpenner.com/profmx
http://www.amazon.com/exec/obidos/ASIN/0072223561/robertpennerc-20
*******************************************************************************************/
#ifndef Easing_h
#define Easing_h
//class Easing {
//public:
//Easing();
namespace Easing{
float linearTween (float t, float b, float c, float d);
float easeInQuad (float t, float b, float c, float d);
float easeOutQuad (float t, float b, float c, float d);
float easeInOutQuad (float t, float b, float c, float d);
float easeInCubic (float t, float b, float c, float d);
float easeOutCubic (float t, float b, float c, float d);
float easeInOutCubic (float t, float b, float c, float d);
float easeInQuart (float t, float b, float c, float d);
float easeOutQuart (float t, float b, float c, float d);
float easeInOutQuart (float t, float b, float c, float d);
float easeInQuint (float t, float b, float c, float d);
float easeOutQuint (float t, float b, float c, float d);
float easeInOutQuint (float t, float b, float c, float d);
float easeInSine (float t, float b, float c, float d);
float easeOutSine (float t, float b, float c, float d);
float easeInOutSine (float t, float b, float c, float d);
float easeInExpo (float t, float b, float c, float d);
float easeOutExpo (float t, float b, float c, float d);
float easeInOutExpo (float t, float b, float c, float d);
float easeInCirc (float t, float b, float c, float d);
float easeOutCirc (float t, float b, float c, float d);
float easeInOutCirc (float t, float b, float c, float d);
float easeInElastic (float t, float b, float c, float d, float a=0, float p=0);
float easeOutElastic (float t, float b, float c, float d, float a=0, float p=0);
float easeInOutElastic (float t, float b, float c, float d, float a=0, float p=0);
float easeInElastic (float t, float b, float c, float d);
float easeOutElastic (float t, float b, float c, float d);
float easeInOutElastic (float t, float b, float c, float d);
float easeInBack (float t, float b, float c, float d, float s=1.70158);
float easeOutBack (float t, float b, float c, float d, float s=1.70158);
float easeInOutBack (float t, float b, float c, float d, float s=1.70158);
float easeInBack (float t, float b, float c, float d);
float easeOutBack (float t, float b, float c, float d);
float easeInOutBack (float t, float b, float c, float d);
float easeInBounce (float t, float b, float c, float d);
float easeOutBounce (float t, float b, float c, float d);
float easeInOutBounce (float t, float b, float c, float d);
}
//};
#endif