Created
January 3, 2020 19:06
-
-
Save xiel/df18062103bcde712547ee07d179ae0a to your computer and use it in GitHub Desktop.
projection function, returning distance that is to be expected from a release velocity of a gesture (spring / animation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const DECAY_FAST = 0.99 | |
const DECAY_NORMAL = 0.998 | |
const projection = (velocityPxMs: number) => (velocityPxMs * DECAY_FAST) / (1 - DECAY_FAST) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment