Well, here's how I look at it. The general cubic has the form
f(x) = A x^3 + B x^2 + C x + D
This has four degrees of freedom, A, B, C and D, so we can impose four independent linear constraints and find the unique cubic that satisfies them. The first two constraints are that the curve should go through (0,0) and (1,1). The second two constraints are that the curve should "ease out" as it leaves (0,0) and "ease in" as it enters (1,1), which is another way of saying that the tangents at x=0 and x=1 should be horizontal. So we have four linear constraints:
f(0) = 0
f(1) = 1
f'(0) = 0
f'(1) = 0
The first equation gives D = 0, and the third equation gives C = 0. The second equation gives A + B + C + D = 1, which reduces to A + B = 1. The fourth equation gives 3A + 2B + C = 0, which reduces to 3A + 2B = 0. Combining A + B = 1 and 3A + 2B = 0 gives 3A + 2(1 - A) = 0, and therefore A = -2. Plugging that into A + B = 1 gives B = 3. Thus the cubic that satisfies all four constraints is
6
u/psykotic Feb 07 '09 edited Feb 07 '09
Well, here's how I look at it. The general cubic has the form
This has four degrees of freedom, A, B, C and D, so we can impose four independent linear constraints and find the unique cubic that satisfies them. The first two constraints are that the curve should go through (0,0) and (1,1). The second two constraints are that the curve should "ease out" as it leaves (0,0) and "ease in" as it enters (1,1), which is another way of saying that the tangents at x=0 and x=1 should be horizontal. So we have four linear constraints:
The first equation gives D = 0, and the third equation gives C = 0. The second equation gives A + B + C + D = 1, which reduces to A + B = 1. The fourth equation gives 3A + 2B + C = 0, which reduces to 3A + 2B = 0. Combining A + B = 1 and 3A + 2B = 0 gives 3A + 2(1 - A) = 0, and therefore A = -2. Plugging that into A + B = 1 gives B = 3. Thus the cubic that satisfies all four constraints is
That's the
SMOOTHSTEPcubic.