Pomax / BezierInfo-2

The development repo for the Primer on Bézier curves, https://pomax.github.io/bezierinfo
https://pomax.github.io/bezierinfo
Other
2.29k stars 286 forks source link

Section 12: will the 1/3, 2/3 method be the unique solution for transforming from quadratic curve to cubic? #377

Open rardz opened 1 year ago

rardz commented 1 year ago

As introduced in section 12, a quadratic bezier curve can be losslessly transformed to a cubic one by by the "1/3rd start + 2/3rd control" and "2/3rd control + 1/3rd end" method.

But is it the only solution for transforming quadratic curve to cubic?

I mean, for the linear to quadratic case, getting the new control point by "1/2 start + 1/2 end" is an apparent solution for trivial transforming. However, it is also apparent that every point on the start-end segment can work as a new control point, though it may be in another analytical quadratic form. Thus for the linear to quadratic case, "1/2 start + 1/2 end" method is not the unique solution for getting the same trajectory.

So for the quadratic to cubic case, are there also any other solutions (other cubic control pairs) for getting the same trajectory? If yes, what is the general method for getting its new cubic control pairs?

Pomax commented 1 year ago

It is, yes. The reason for this is that we the only way we're going to match the "drawn" curve when uplifting from one order to the next, is by ensuring that the tangent lines at all coordinates on the curve are identical between the lower and higher order Bezier representation. Note that this does not say that the derivatives of Bn(t) and Bn+1(t) must be the same (which is good because the whole point of raising/lowering curve order means that by definition the derivatives are literally off by an factor t) only that for all points on the curve traced by Bn, Bn+1 also contains that point, with an identical tangent line.

For a straight line, we have what is known as a degenerate curve, meaning that an analysis of its properties does not generalize. In this case, unlike "actual curves" where no point has the same tangent line as its neighbours, every point on a line shares the same tangent line. So while we can trivially construct an infinite number of Bezier curves that all look like that line, a line is the only "curve' with that property.