| author | Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com> |
| Sun, 04 Mar 2012 14:13:39 +0100 | |
| changeset 533 | d824146a9589 |
| parent 133 | 9578d3ddce17 |
| permissions | -rwxr-xr-x |
|
133
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
1 |
/** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
2 |
* Interface Elements for jQuery |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
3 |
* Easing formulas |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
4 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
5 |
* http://interface.eyecon.ro |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
6 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
7 |
* Copyright (c) 2006 Stefan Petre |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
8 |
* Dual licensed under the MIT (MIT-LICENSE.txt) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
9 |
* and GPL (GPL-LICENSE.txt) licenses. |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
10 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
11 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
12 |
/** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
13 |
* Starting with jQuery 1.1 the fx function accepts easing formulas that can be used with .animation() and most of FX plugins from Interface. The object can be extended to accept new easing formulas |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
14 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
15 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
16 |
jQuery.extend({ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
17 |
/** |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
18 |
* |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
19 |
* @param Integer p period step in animation |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
20 |
* @param Integer n current time |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
21 |
* @param Mixed firstNum begin value |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
22 |
* @param Mixed delta change in |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
23 |
* @param Integer duration duration |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
24 |
*/ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
25 |
easing : { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
26 |
linear: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
27 |
return ((-Math.cos(p*Math.PI)/2) + 0.5) * delta + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
28 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
29 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
30 |
easein: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
31 |
return delta*(n/=duration)*n*n + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
32 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
33 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
34 |
easeout: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
35 |
return -delta * ((n=n/duration-1)*n*n*n - 1) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
36 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
37 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
38 |
easeboth: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
39 |
if ((n/=duration/2) < 1) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
40 |
return delta/2*n*n*n*n + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
41 |
return -delta/2 * ((n-=2)*n*n*n - 2) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
42 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
43 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
44 |
bounceout: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
45 |
if ((n/=duration) < (1/2.75)) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
46 |
return delta*(7.5625*n*n) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
47 |
} else if (n < (2/2.75)) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
48 |
return delta*(7.5625*(n-=(1.5/2.75))*n + .75) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
49 |
} else if (n < (2.5/2.75)) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
50 |
return delta*(7.5625*(n-=(2.25/2.75))*n + .9375) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
51 |
} else { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
52 |
return delta*(7.5625*(n-=(2.625/2.75))*n + .984375) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
53 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
54 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
55 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
56 |
bouncein: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
57 |
if (jQuery.easing.bounceout) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
58 |
return delta - jQuery.easing.bounceout (p, duration - n, 0, delta, duration) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
59 |
return firstNum + delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
60 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
61 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
62 |
bounceboth: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
63 |
if (jQuery.easing.bouncein && jQuery.easing.bounceout) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
64 |
if (n < duration/2) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
65 |
return jQuery.easing.bouncein(p, n*2, 0, delta, duration) * .5 + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
66 |
return jQuery.easing.bounceout(p, n*2-duration, 0, delta, duration) * .5 + delta*.5 + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
67 |
return firstNum + delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
68 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
69 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
70 |
elasticin: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
71 |
var a, s; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
72 |
if (n == 0) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
73 |
return firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
74 |
if ((n/=duration)==1) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
75 |
return firstNum+delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
76 |
a = delta * 0.3; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
77 |
p=duration*.3; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
78 |
if (a < Math.abs(delta)) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
79 |
a=delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
80 |
s=p/4; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
81 |
} else { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
82 |
s = p/(2*Math.PI) * Math.asin (delta/a); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
83 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
84 |
return -(a*Math.pow(2,10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
85 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
86 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
87 |
elasticout:function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
88 |
var a, s; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
89 |
if (n==0) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
90 |
return firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
91 |
if ((n/=duration/2)==2) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
92 |
return firstNum + delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
93 |
a = delta * 0.3; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
94 |
p=duration*.3; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
95 |
if (a < Math.abs(delta)){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
96 |
a = delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
97 |
s=p/4; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
98 |
} else { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
99 |
s = p/(2*Math.PI) * Math.asin (delta/a); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
100 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
101 |
return a*Math.pow(2,-10*n) * Math.sin( (n*duration-s)*(2*Math.PI)/p ) + delta + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
102 |
}, |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
103 |
|
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
104 |
elasticboth: function(p, n, firstNum, delta, duration) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
105 |
var a, s; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
106 |
if (n==0) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
107 |
return firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
108 |
if ((n/=duration/2)==2) |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
109 |
return firstNum + delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
110 |
a = delta * 0.3; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
111 |
p=duration*.3; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
112 |
if (a < Math.abs(delta)){ |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
113 |
a = delta; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
114 |
s=p/4; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
115 |
} else { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
116 |
s = p/(2*Math.PI) * Math.asin (delta/a); |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
117 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
118 |
if (n < 1) { |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
119 |
return -.5*(a*Math.pow(2,10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )) + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
120 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
121 |
return a*Math.pow(2,-10*(n-=1)) * Math.sin( (n*duration-s)*(2*Math.PI)/p )*.5 + delta + firstNum; |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
122 |
} |
|
9578d3ddce17
correct line endings + other small errors
Yves-Marie Haussonne <1218002+ymph@users.noreply.github.com>
parents:
99
diff
changeset
|
123 |
} |
|
99
6cb4d10f0b8b
NEW WEBSITE WITH : HOME / ABOUT / CLIENT.PHP
Samuel Huron <samuel.huron@centrepompidou.fr>
parents:
diff
changeset
|
124 |
}); |