Skip to content

Instantly share code, notes, and snippets.

@jenox
Last active July 9, 2018 13:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jenox/0d1f63d0002b8adef06622d1a804c714 to your computer and use it in GitHub Desktop.
Save jenox/0d1f63d0002b8adef06622d1a804c714 to your computer and use it in GitHub Desktop.
Projection as presented in the 2018 WWDC session Designing Fluid Interfaces: https://developer.apple.com/videos/play/wwdc2018/803/
// Distance travelled after decelerating to zero velocity at a constant rate
func project(initialVelocity: Float, decelerationRate: Float) -> Float {
return (initialVelocity / 1000.0) * decelerationRate / (1.0 - decelerationRate)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment