exp.js 251 Bytes
Newer Older
Muddsair Sharif's avatar
Muddsair Sharif committed
1
2
3
4
5
6
7
8
9
10
11
export function expIn(t) {
  return Math.pow(2, 10 * t - 10);
}

export function expOut(t) {
  return 1 - Math.pow(2, -10 * t);
}

export function expInOut(t) {
  return ((t *= 2) <= 1 ? Math.pow(2, 10 * t - 10) : 2 - Math.pow(2, 10 - 10 * t)) / 2;
}