decelerate function

double decelerate(
  1. double t
)

Applies a decelerating interpolation function to the input value t. Returns a value between 0 and 1 based on the input.

Implementation

double decelerate(double t) {
  t = 1.0 - t;
  return 1.0 - t * t;
}