sin.js 236 Bytes
Newer Older
Muddsair Sharif's avatar
Muddsair Sharif committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
var pi = Math.PI,
    halfPi = pi / 2;

export function sinIn(t) {
  return 1 - Math.cos(t * halfPi);
}

export function sinOut(t) {
  return Math.sin(t * halfPi);
}

export function sinInOut(t) {
  return (1 - Math.cos(pi * t)) / 2;
}