Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

easing functions for bell curves?

Robert Penner's easing functions make it easy to create a variety of animation behaviors by moving X between 0 and 1, as the resultant Y moves starts at 0 and ends at 1. Examples here.

I am wondering if there is such a set of functions for bell curves? Given X between 0 and 1, these functions would return Y between 0 and 1, starting at 0 and ending at 0.

I've not seen such a collection, but before I get going on fitting parabolas so everything fits between 0 and 1 on both axes, I thought I'd check here first.

like image 531
jedierikb Avatar asked Oct 27 '12 03:10

jedierikb


Video Answer


1 Answers

There are lots of common bell-shaped functions f on [0, 1]; I assume you want them to satisfy f(0) = f(1) = f'(0) = f'(1) = 0 and f(1/2) = 1. Examples:

  • Any symmetric beta distribution density function, for any parameters α = β > 1, is bell-shaped and has zero derivative at the endpoints. That is, f(x) = 4^α * x^(α - 1) * (1 - x)^(α - 1), where 4^α is a constant to scale it so that it goes up to 1:

    beta

  • Pick a segment of a sinusoidal function, starting and ending at adjacent troughs, and translating/scaling as desired. Example: f(x) = (sin(2 * π * (x - 1/4)) + 1) / 2:

    sine

like image 169
Mechanical snail Avatar answered Sep 30 '22 13:09

Mechanical snail