3 ms·
Bezier curves are usually defined as polynomials. It would be interesting to see some algebraic derivation showing how the polynomial form of the curve follows
by csense 10y ago
Bezier curves are usually defined as polynomials. It would be interesting to see some algebraic derivation showing how the polynomial form of the curve follows from the construction in the visualization.
- jacobolus 10y agohttp://mae.engr.ucdavis.edu/~farouki/bernstein.pdf http://mae.engr.ucdavis.edu/~farouki/bernstein.pdf http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-19.html http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-19.html http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-34.html http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-34.html http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-169.html http://www.hpl.hp.com/techreports/Compaq-DEC/SRC-RR-169.html
- JabavuAdams 10y agoIt's a lerp of a lerp of a lerp. The algorithm shown is de Castlejau's. You get the higher order terms by repeatedly substituting the interpolated control points. Iteration 1 generates 3 interpolated points pi' from 4 control points pi: E.g. p0' = t * p0 + (1-t) * p1 <- LERP (Linear Interpolation) p1' = t * p1 + (1-t) * p2 p2' = t * p2 + (1-t) * p3 Iteration 2 generates 2 interpolated points pi'' from 3 interpolated points pi': p0'' = t * p0' + (1-t) * p1' p1'' = t * p1' + (1-t) * p2' Iteration 3 generates 1 interpolated point p0''' (which is the point on the Bezier for that value of t) from 2 interpolated points pi'': p0''' = t * p0'' + (1-t) * p1'' Expanding out this final equation by substituting in p0'', then p0', etc.: p0''' = t * p0'' + ... = t * (t * p0' + (1-t) * p1') + ... = t^2 * p0' + t * p1' - t^2 * p1' + ... = t^2 * (t * p1 + (1-t) * p2) + t * p1' + ... So all those polynomial powers of t are generated by repeatedly multiplying by t and 1-t. This just suddenly clicked for me a couple of months a ago as I was doing a deep dive on SVG. TAKEAWAY: Bezier curves are just recursively-applied linear-interpolation. There's nothing magical about them. You or I could have thought them up -- it's the obvious thing to do. NOTE: The primes here don't mean differentiation. It's just a way of numbering the recursion. EDIT> spacing, prime comments
- abecedarius 10y agoThe algebra does seem more transparent when you use an infix lerp operator: a [t] b meaning (1-t) a + t b. I also tweaked the notation further with (a..b) to mean (b-a) but thought of as "the vector from a to b". Then, for example, a quadratic spline: d/dt ((a [t] b) [t] (b [t] c)) = 2 (a..b) [t] (b..c) (there are some convenient laws to keep the intermediate steps visualizable.) From this it's clear that the tangents to the start and the end of the curve (at a and c) intersect at b: at t=0 it goes through a with derivative 2(a..b), and at t=1 it goes through c with derivative 2(b..c). Compare https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Quadratic_B.C3.A9zier_curves https://en.wikipedia.org/wiki/B%C3%A9zier_curve#Quadratic_B.... in the usual notation.
- TheRealPomax 10y agoThere is no "usual": you can define them geometrically (as lerps of lerps), symbolically (as polynomials), or even algebraically (as power matrix operations). All three are covered over on https://pomax.github.io/bezierinfo https://pomax.github.io/bezierinfo which was on HN yesterday =D