source:
node_modules/d3-ease/src/sin.js
| Last change on this file was e4c61dd, checked in by , 6 months ago | |
|---|---|
|
|
| File size: 253 bytes | |
| Line | |
|---|---|
| 1 | var pi = Math.PI, |
| 2 | halfPi = pi / 2; |
| 3 | |
| 4 | export function sinIn(t) { |
| 5 | return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi); |
| 6 | } |
| 7 | |
| 8 | export function sinOut(t) { |
| 9 | return Math.sin(t * halfPi); |
| 10 | } |
| 11 | |
| 12 | export function sinInOut(t) { |
| 13 | return (1 - Math.cos(pi * t)) / 2; |
| 14 | } |
Note:
See TracBrowser
for help on using the repository browser.
