Skip to content

Instantly share code, notes, and snippets.

@mbigatti
Last active December 11, 2015 07:08
Show Gist options
  • Save mbigatti/4564354 to your computer and use it in GitHub Desktop.
Save mbigatti/4564354 to your computer and use it in GitHub Desktop.
iOS6 Rubber-banding Formula, as described by Grant Paul (chpwn) (ref. https://twitter.com/chpwn/status/285540192096497664)
//
// BMXRubberBanding.h
// Rubber-banding Formula, as described by Grant Paul (chpwn)
// https://twitter.com/chpwn/status/285540192096497664
//
#ifndef TimerApp_BMXRubberBanding_h
#define TimerApp_BMXRubberBanding_h
#define BMX_RUBBER_BANDING_CONSTANT 0.55
#define BMX_RUBBER_BANDING(x,d) ((1.0 - (1.0 / (((x) * BMX_RUBBER_BANDING_CONSTANT / (d)) + 1.0))) * d)
#define BMX_RUBBER_BANDINGC(x,d,c) ((1.0 - (1.0 / (((x) * (c) / (d)) + 1.0))) * d)
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment