// Create a pulse function, that is. starts from 0, does a
// sharp rise to 1 and a less sharp decline back to 0 again,
// Using f(t) = t * (1 - t)^p will suit us for this.
// We want this curve to reach a value of 1 at its maximum in
// the 0 < r < 1 interval. So we'll need to find the maximum
// value in this interval, invert and multiply with the curve.
// Those interested in math might want to derive the invMax
// calculation below themselves by solving for f'(t) = 0
// and inserting into the function.