Created
June 23, 2020 21:46
-
-
Save patrickmatte/7c882a61f75d537f76d0f7968515d497 to your computer and use it in GitHub Desktop.
Spring formula
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
// Ease out | |
value = value + (targetValue - value) / friction; | |
// Elastic | |
speed = speed * elasticity + (targetValue - value) / friction; | |
value = value + speed; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment