Easings.js 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668
  1. /************************************************************************
  2. * Easings.js
  3. ************************************************************************
  4. * Copyright (c) 2021 Pedro Tonini Rosenberg Schneider.
  5. *
  6. * This file is part of Pandora.
  7. *
  8. * Pandora is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * Pandora is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with Pandora. If not, see <https://www.gnu.org/licenses/>.
  20. *************************************************************************/
  21. /**
  22. *
  23. * Derived from Robert Penner's easing equations: http://robertpenner.com/easing/
  24. * The original copyright notice is as follows:
  25. *
  26. * TERMS OF USE - EASING EQUATIONS
  27. *
  28. * Open source under the BSD License.
  29. *
  30. * Copyright © 2001 Robert Penner
  31. * All rights reserved.
  32. *
  33. * Redistribution and use in source and binary forms, with or without modification,
  34. * are permitted provided that the following conditions are met:
  35. *
  36. * Redistributions of source code must retain the above copyright notice, this list of
  37. * conditions and the following disclaimer.
  38. * Redistributions in binary form must reproduce the above copyright notice, this list
  39. * of conditions and the following disclaimer in the documentation and/or other materials
  40. * provided with the distribution.
  41. *
  42. * Neither the name of the author nor the names of contributors may be used to endorse
  43. * or promote products derived from this software without specific prior written permission.
  44. *
  45. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
  46. * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  47. * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  48. * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
  49. * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  50. * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
  51. * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  52. * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  53. * OF THE POSSIBILITY OF SUCH DAMAGE.
  54. *
  55. */
  56. /**
  57. * This {@code Easings} singleton provides an interface for the engine to utilize
  58. * various easing equations. Used mostly on the Tween GameObject. User can access this
  59. * API, but it is not recomended; try using tweens instead.
  60. *
  61. * @author Pedro Schneider
  62. *
  63. * @namespace
  64. */
  65. const Easings = {
  66. // * See https://easings.net/ for more details on each type of easing.
  67. /**
  68. * Namespace to separate linear easing equations.
  69. * @namespace
  70. */
  71. Linear:
  72. {
  73. /**
  74. * Calculates a linear easing.
  75. *
  76. * @param {number} t current time of the easing process.
  77. * @param {number} b beginning value of the esasing process.
  78. * @param {number} c change in vlaue during the easing process.
  79. * @param {number} d total duration of the easing process.
  80. *
  81. * @returns {number} current value in the easing process.
  82. */
  83. ease: function(t, b, c, d)
  84. {
  85. return b + (c * t / d);
  86. }
  87. },
  88. /**
  89. * Namespace to separate quadratic easing equations.
  90. * @namespace
  91. */
  92. Quad:
  93. {
  94. /**
  95. * Calculates a quadratic ease-in.
  96. *
  97. * @param {number} t current time of the easing process.
  98. * @param {number} b beginning value of the esasing process.
  99. * @param {number} c change in vlaue during the easing process.
  100. * @param {number} d total duration of the easing process.
  101. *
  102. * @returns {number} current value in the easing process.
  103. */
  104. easeIn: function(t, b, c, d)
  105. {
  106. return c * (t /= d) * t + b;
  107. },
  108. /**
  109. * Calculates a quadratic ease-out.
  110. *
  111. * @param {number} t current time of the easing process.
  112. * @param {number} b beginning value of the esasing process.
  113. * @param {number} c change in vlaue during the easing process.
  114. * @param {number} d total duration of the easing process.
  115. *
  116. * @returns {number} current value in the easing process.
  117. */
  118. easeOut: function(t, b, c, d)
  119. {
  120. return -c * (t /= d) * (t - 2) + b;
  121. },
  122. /**
  123. * Calculates a quadratic ease-in and out.
  124. *
  125. * @param {number} t current time of the easing process.
  126. * @param {number} b beginning value of the esasing process.
  127. * @param {number} c change in vlaue during the easing process.
  128. * @param {number} d total duration of the easing process.
  129. *
  130. * @returns {number} current value in the easing process.
  131. */
  132. easeInOut: function(t, b, c, d)
  133. {
  134. if ((t /= d / 2) < 1) return c / 2 * t * t + b;
  135. return -c / 2 * ((--t) * (t - 2) - 1) + b;
  136. }
  137. },
  138. /**
  139. * Namespace to separate cubic easing equations.
  140. * @namespace
  141. */
  142. Cubic:
  143. {
  144. /**
  145. * Calculates a cubic ease-in.
  146. *
  147. * @param {number} t current time of the easing process.
  148. * @param {number} b beginning value of the esasing process.
  149. * @param {number} c change in vlaue during the easing process.
  150. * @param {number} d total duration of the easing process.
  151. *
  152. * @returns {number} current value in the easing process.
  153. */
  154. easeIn: function(t, b, c, d)
  155. {
  156. return c * (t /= d) * t * t + b;
  157. },
  158. /**
  159. * Calculates a cubic ease-out.
  160. *
  161. * @param {number} t current time of the easing process.
  162. * @param {number} b beginning value of the esasing process.
  163. * @param {number} c change in vlaue during the easing process.
  164. * @param {number} d total duration of the easing process.
  165. *
  166. * @returns {number} current value in the easing process.
  167. */
  168. easeOut: function(t, b, c, d)
  169. {
  170. return c * ((t = t / d - 1) * t * t + 1) + b;
  171. },
  172. /**
  173. * Calculates a cubic ease-in and out.
  174. *
  175. * @param {number} t current time of the easing process.
  176. * @param {number} b beginning value of the esasing process.
  177. * @param {number} c change in vlaue during the easing process.
  178. * @param {number} d total duration of the easing process.
  179. *
  180. * @returns {number} current value in the easing process.
  181. */
  182. easeInOut: function(t, b, c, d)
  183. {
  184. if ((t /= d / 2) < 1) return c / 2 * t * t * t + b;
  185. return c / 2 * ((t -= 2) * t * t + 2) + b;
  186. }
  187. },
  188. /**
  189. * Namespace to separate quartic easing equations.
  190. * @namespace
  191. */
  192. Quart:
  193. {
  194. /**
  195. * Calculates a quartic ease-in.
  196. *
  197. * @param {number} t current time of the easing process.
  198. * @param {number} b beginning value of the esasing process.
  199. * @param {number} c change in vlaue during the easing process.
  200. * @param {number} d total duration of the easing process.
  201. *
  202. * @returns {number} current value in the easing process.
  203. */
  204. easeIn: function(t, b, c, d)
  205. {
  206. return c * (t /= d) * t * t * t + b;
  207. },
  208. /**
  209. * Calculates a quartic ease-out.
  210. *
  211. * @param {number} t current time of the easing process.
  212. * @param {number} b beginning value of the esasing process.
  213. * @param {number} c change in vlaue during the easing process.
  214. * @param {number} d total duration of the easing process.
  215. *
  216. * @returns {number} current value in the easing process.
  217. */
  218. easeOut: function(t, b, c, d)
  219. {
  220. return -c * ((t = t / d - 1) * t * t * t - 1) + b;
  221. },
  222. /**
  223. * Calculates a quartic ease-in and out.
  224. *
  225. * @param {number} t current time of the easing process.
  226. * @param {number} b beginning value of the esasing process.
  227. * @param {number} c change in vlaue during the easing process.
  228. * @param {number} d total duration of the easing process.
  229. *
  230. * @returns {number} current value in the easing process.
  231. */
  232. easeInOut: function(t, b, c, d)
  233. {
  234. if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b;
  235. return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
  236. }
  237. },
  238. /**
  239. * Namespace to separate quintic easing equations.
  240. * @namespace
  241. */
  242. Quint:
  243. {
  244. /**
  245. * Calculates a quintic ease-in.
  246. *
  247. * @param {number} t current time of the easing process.
  248. * @param {number} b beginning value of the esasing process.
  249. * @param {number} c change in vlaue during the easing process.
  250. * @param {number} d total duration of the easing process.
  251. *
  252. * @returns {number} current value in the easing process.
  253. */
  254. easeIn: function(t, b, c, d)
  255. {
  256. return c * (t /= d) * t * t * t * t + b;
  257. },
  258. /**
  259. * Calculates a quintic ease-out.
  260. *
  261. * @param {number} t current time of the easing process.
  262. * @param {number} b beginning value of the esasing process.
  263. * @param {number} c change in vlaue during the easing process.
  264. * @param {number} d total duration of the easing process.
  265. *
  266. * @returns {number} current value in the easing process.
  267. */
  268. easeOut: function(t, b, c, d)
  269. {
  270. return c * ((t = t / d - 1) * t * t * t * t + 1) + b;
  271. },
  272. /**
  273. * Calculates a quintic ease-in and out.
  274. *
  275. * @param {number} t current time of the easing process.
  276. * @param {number} b beginning value of the esasing process.
  277. * @param {number} c change in vlaue during the easing process.
  278. * @param {number} d total duration of the easing process.
  279. *
  280. * @returns {number} current value in the easing process.
  281. */
  282. easeInOut: function(t, b, c, d)
  283. {
  284. if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b;
  285. return c / 2 * ((t -= 2) * t * t * t * t + 2) + b;
  286. }
  287. },
  288. /**
  289. * Namespace to separate senoidal easing equations.
  290. * @namespace
  291. */
  292. Sine:
  293. {
  294. /**
  295. * Calculates a senoidal ease-in;
  296. *
  297. * @param {number} t current time of the easing process.
  298. * @param {number} b beginning value of the esasing process.
  299. * @param {number} c change in vlaue during the easing process.
  300. * @param {number} d total duration of the easing process.
  301. *
  302. * @returns {number} current value in the easing process.
  303. */
  304. easeIn: function(t, b, c, d)
  305. {
  306. return -c * Math.cos(t / d * (Math.PI / 2)) + c + b;
  307. },
  308. /**
  309. * Calculates a senoidal ease-out.
  310. *
  311. * @param {number} t current time of the easing process.
  312. * @param {number} b beginning value of the esasing process.
  313. * @param {number} c change in vlaue during the easing process.
  314. * @param {number} d total duration of the easing process.
  315. *
  316. * @returns {number} current value in the easing process.
  317. */
  318. easeOut: function(t, b, c, d)
  319. {
  320. return c * Math.sin(t / d * (Math.PI / 2)) + b;
  321. },
  322. /**
  323. * Calculates a senoidal ease-in and out.
  324. *
  325. * @param {number} t current time of the easing process.
  326. * @param {number} b beginning value of the esasing process.
  327. * @param {number} c change in vlaue during the easing process.
  328. * @param {number} d total duration of the easing process.
  329. *
  330. * @returns {number} current value in the easing process.
  331. */
  332. easeInOut: function(t, b, c, d)
  333. {
  334. return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
  335. }
  336. },
  337. /**
  338. * Namespace to separate exponential easing equations.
  339. * @namespace
  340. */
  341. Expo:
  342. {
  343. /**
  344. * Calculates an exponential ease-in.
  345. *
  346. * @param {number} t current time of the easing process.
  347. * @param {number} b beginning value of the esasing process.
  348. * @param {number} c change in vlaue during the easing process.
  349. * @param {number} d total duration of the easing process.
  350. *
  351. * @returns {number} current value in the easing process.
  352. */
  353. easeIn: function(t, b, c, d)
  354. {
  355. return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b;
  356. },
  357. /**
  358. * Calculates an exponential ease-out.
  359. *
  360. * @param {number} t current time of the easing process.
  361. * @param {number} b beginning value of the esasing process.
  362. * @param {number} c change in vlaue during the easing process.
  363. * @param {number} d total duration of the easing process.
  364. *
  365. * @returns {number} current value in the easing process.
  366. */
  367. easeOut: function(t, b, c, d)
  368. {
  369. return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b;
  370. },
  371. /**
  372. * Calculates an exponential ease-in and out.
  373. *
  374. * @param {number} t current time of the easing process.
  375. * @param {number} b beginning value of the esasing process.
  376. * @param {number} c change in vlaue during the easing process.
  377. * @param {number} d total duration of the easing process.
  378. *
  379. * @returns {number} current value in the easing process.
  380. */
  381. easeInOut: function(t, b, c, d)
  382. {
  383. if (t == 0) return b;
  384. if (t == d) return b + c;
  385. if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b;
  386. return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b;
  387. }
  388. },
  389. /**
  390. * Namespace to separate circular easing equations.
  391. * @namespace
  392. */
  393. Circ:
  394. {
  395. /**
  396. * Calculates a circular ease-in.
  397. *
  398. * @param {number} t current time of the easing process.
  399. * @param {number} b beginning value of the esasing process.
  400. * @param {number} c change in vlaue during the easing process.
  401. * @param {number} d total duration of the easing process.
  402. *
  403. * @returns {number} current value in the easing process.
  404. */
  405. easeIn: function(t, b, c, d)
  406. {
  407. return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b;
  408. },
  409. /**
  410. * Calculates a circular ease-out.
  411. *
  412. * @param {number} t current time of the easing process.
  413. * @param {number} b beginning value of the esasing process.
  414. * @param {number} c change in vlaue during the easing process.
  415. * @param {number} d total duration of the easing process.
  416. *
  417. * @returns {number} current value in the easing process.
  418. */
  419. easeOut: function(t, b, c, d)
  420. {
  421. return c * Math.sqrt(1 - (t = t / d - 1) * t) + b;
  422. },
  423. /**
  424. * Calculates a circular ease-in and out.
  425. *
  426. * @param {number} t current time of the easing process.
  427. * @param {number} b beginning value of the esasing process.
  428. * @param {number} c change in vlaue during the easing process.
  429. * @param {number} d total duration of the easing process.
  430. *
  431. * @returns {number} current value in the easing process.
  432. */
  433. easeInOut: function(t, b, c, d)
  434. {
  435. if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b;
  436. return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b;
  437. }
  438. },
  439. /**
  440. * Namespace to separate elastic easing equations.
  441. * @namespace
  442. */
  443. Elastic:
  444. {
  445. /**
  446. * Calculates an elastic ease-in.
  447. *
  448. * @param {number} t current time of the easing process.
  449. * @param {number} b beginning value of the esasing process.
  450. * @param {number} c change in vlaue during the easing process.
  451. * @param {number} d total duration of the easing process.
  452. *
  453. * @returns {number} current value in the easing process.
  454. */
  455. easeIn: function(t, b, c, d)
  456. {
  457. var s = 1.70158;
  458. var p = 0;
  459. var a = c;
  460. if (t == 0) return b;
  461. if ((t /= d) == 1) return b + c;
  462. if (!p) p = d * .3;
  463. if (a < Math.abs(c))
  464. {
  465. a = c;
  466. var s = p / 4;
  467. }
  468. else var s = p / (2 * Math.PI) * Math.asin(c / a);
  469. return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
  470. },
  471. /**
  472. * Calculates an elastic ease-out.
  473. *
  474. * @param {number} t current time of the easing process.
  475. * @param {number} b beginning value of the esasing process.
  476. * @param {number} c change in vlaue during the easing process.
  477. * @param {number} d total duration of the easing process.
  478. *
  479. * @returns {number} current value in the easing process.
  480. */
  481. easeOut: function(t, b, c, d)
  482. {
  483. var s = 1.70158;
  484. var p = 0;
  485. var a = c;
  486. if (t == 0) return b;
  487. if ((t /= d) == 1) return b + c;
  488. if (!p) p = d * .3;
  489. if (a < Math.abs(c))
  490. {
  491. a = c;
  492. var s = p / 4;
  493. }
  494. else var s = p / (2 * Math.PI) * Math.asin(c / a);
  495. return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
  496. },
  497. /**
  498. * Calculates an elastic ease-in and out.
  499. *
  500. * @param {number} t current time of the easing process.
  501. * @param {number} b beginning value of the esasing process.
  502. * @param {number} c change in vlaue during the easing process.
  503. * @param {number} d total duration of the easing process.
  504. *
  505. * @returns {number} current value in the easing process.
  506. */
  507. easeInOut: function(t, b, c, d)
  508. {
  509. var s = 1.70158;
  510. var p = 0;
  511. var a = c;
  512. if (t == 0) return b;
  513. if ((t /= d / 2) == 2) return b + c;
  514. if (!p) p = d * (.3 * 1.5);
  515. if (a < Math.abs(c))
  516. {
  517. a = c;
  518. var s = p / 4;
  519. }
  520. else var s = p / (2 * Math.PI) * Math.asin(c / a);
  521. if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
  522. return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
  523. },
  524. },
  525. /**
  526. * Namespace to separate back easing equations.
  527. * @namespace
  528. */
  529. Back:
  530. {
  531. /**
  532. * Calculates a back ease-in.
  533. *
  534. * @param {number} t current time of the easing process.
  535. * @param {number} b beginning value of the esasing process.
  536. * @param {number} c change in vlaue during the easing process.
  537. * @param {number} d total duration of the easing process.
  538. *
  539. * @returns {number} current value in the easing process.
  540. */
  541. easeIn: function(t, b, c, d)
  542. {
  543. var s = 1.70158;
  544. return c * (t /= d) * t * ((s + 1) * t - s) + b;
  545. },
  546. /**
  547. * Calculates a back ease-out.
  548. *
  549. * @param {number} t current time of the easing process.
  550. * @param {number} b beginning value of the esasing process.
  551. * @param {number} c change in vlaue during the easing process.
  552. * @param {number} d total duration of the easing process.
  553. *
  554. * @returns {number} current value in the easing process.
  555. */
  556. easeOut: function(t, b, c, d)
  557. {
  558. var s = 1.70158;
  559. return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
  560. },
  561. /**
  562. * Calculates a back ease-in and out.
  563. *
  564. * @param {number} t current time of the easing process.
  565. * @param {number} b beginning value of the esasing process.
  566. * @param {number} c change in vlaue during the easing process.
  567. * @param {number} d total duration of the easing process.
  568. *
  569. * @returns {number} current value in the easing process.
  570. */
  571. easeInOut: function(t, b, c, d)
  572. {
  573. var s = 1.70158;
  574. if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
  575. return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
  576. }
  577. },
  578. /**
  579. * Namespace to separate bounce easing equations.
  580. * @namespace
  581. */
  582. Bounce:
  583. {
  584. /**
  585. * Calculates a bounce ease-in.
  586. *
  587. * @param {number} t current time of the easing process.
  588. * @param {number} b beginning value of the esasing process.
  589. * @param {number} c change in vlaue during the easing process.
  590. * @param {number} d total duration of the easing process.
  591. *
  592. * @returns {number} current value in the easing process.
  593. */
  594. easeIn: function(t, b, c, d)
  595. {
  596. return c - Easings.Bounce.easeOut(d - t, 0, c, d) + b;
  597. },
  598. /**
  599. * Calculates a bounce ease-out.
  600. *
  601. * @param {number} t current time of the easing process.
  602. * @param {number} b beginning value of the esasing process.
  603. * @param {number} c change in vlaue during the easing process.
  604. * @param {number} d total duration of the easing process.
  605. *
  606. * @returns {number} current value in the easing process.
  607. */
  608. easeOut: function(t, b, c, d)
  609. {
  610. if ((t /= d) < (1 / 2.75))
  611. return c * (7.5625 * t * t) + b;
  612. else if (t < (2 / 2.75))
  613. return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
  614. else if (t < (2.5 / 2.75))
  615. return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
  616. else
  617. return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
  618. },
  619. /**
  620. * Calculates a bounce ease-in and out.
  621. *
  622. * @param {number} t current time of the easing process.
  623. * @param {number} b beginning value of the esasing process.
  624. * @param {number} c change in vlaue during the easing process.
  625. * @param {number} d total duration of the easing process.
  626. *
  627. * @returns {number} current value in the easing process.
  628. */
  629. easeInOut: function(t, b, c, d)
  630. {
  631. if (t < d / 2) return Easings.Bounce.easeIn(t * 2, 0, c, d) * .5 + b;
  632. return Easings.Bounce.easeOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
  633. }
  634. },
  635. }