In earlier posts, I mentioned finding polynomials, riffing off of damped harmonic motion, and then hitting on exponential spirals all trying to come up with a nice looking way to snap game tiles back into place when they are released. I want them to overshoot and then settle into place rather than snap directly into their spot.
The Basic Spiral
I am talking about a simple spiral of the form:
That would be an equation for a spiral that starts at the origin and heads outward as increases. For my application though, I want to end at the origin so I need to substitute in for .
The math is also going to work out slightly better if I use in place of in the above equations:
I don’t want the piece to spiral into place when released though. So, really, I am concerned with just the coordinate from the above equations:
To normalize everything, I am going to let . And, since I want my interpolation value to go from zero to one instead of one to zero, I am again going to subtract this all from one: