diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2009-01-15 00:26:03 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2009-01-29 10:10:39 +0000 |
commit | 48f9a0e6da0dd24ea9c809876ef3c745dcfd0d52 (patch) | |
tree | a54cd32856407e2c2fdd88de9ae38fcb8eca0ff4 /src/cairo-spline.c | |
parent | ee7ac5681fa6a74b68beeae667d96d1421050fc9 (diff) |
[spline] Correct the definition of a cubic Bezier curve.
Add the missing coefficients for p1 and p2 so the derivation of the
derivative and the solution for its inflection points stands correct.
Diffstat (limited to 'src/cairo-spline.c')
-rw-r--r-- | src/cairo-spline.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cairo-spline.c b/src/cairo-spline.c index 414e0536..948516e1 100644 --- a/src/cairo-spline.c +++ b/src/cairo-spline.c @@ -234,7 +234,7 @@ _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func, /* The spline can be written as a polynomial of the four points: * - * (1-t)³p0 + t(1-t)²p1 + t²(1-t)p2 + t³p3 + * (1-t)³p0 + 3t(1-t)²p1 + 3t²(1-t)p2 + t³p3 * * for 0≤t≤1. Now, the X and Y components of the spline follow the * same polynomial but with x and y replaced for p. To find the @@ -244,13 +244,13 @@ _cairo_spline_bound (cairo_spline_add_point_func_t add_point_func, * * Here is the derivative of the curve, sorted on t: * - * 3t²(-p0+3p1-3p2+p3) + 6t(3p0-6p1+3p2) -3p0+3p1 + * 3t²(-p0+3p1-3p2+p3) + 2t(3p0-6p1+3p2) -3p0+3p1 * * Let: * * a = -p0+3p1-3p2+p3 - * b = 3p0-6p1+3p2 - * c = -3p0+3p1 + * b = p0-2p1+p2 + * c = -p0+p1 * * Gives: * |