Discussion:
How deep to flatten a Bezier curve
(too old to reply)
s***@gmail.com
2013-06-20 06:57:05 UTC
Permalink
thus cubic. Furthermore, a cubic Bezier can inflect three times: once
internally and again at each endpoint; so you need three possible roots
to any inflection polynomial, further evidence of it being cubic.
Dear sir, in relation to this old post of yours:

It is my understanding that a cubic bezier can only inflect twice, by reasoning as follows (adapted from: http://www.caffeineowl.com/graphics/2d/vectorial/cubic-inflexion.html)

A cubic bezier curve P with control points P1, C1, C2, P2 is computed as:
P = P1 + 3 * t * ( C1 - P1 ) + 3 * t^2 * ( C2 - 2 * C1 + P1 ) + t^3 * ( P2 - 3 * C2 + 3 * C1 - P1 )

Taking A = C1 - P1, B = C2 - 2 * C1 + P1 and C = ( P2 - 3 * C2 + 3 * C1 - P1 ), we have:

P = P1 + 3 * t * A + 3 * t^2 * B + t^3 * C

Differentiating successively w.r.t. t, we have:
Veloc = 3 * ( A + 2 * t * B + t^2 * C )
Accel = 6 * ( B + t * C )

The determinant of the 2x2 matrix [ Veloc Accel ] is :

18 * ( (Bx*Cy - By*Cx) * t^2 + (Ax*Cy - Ay*Cx) * t + (Ax*By - Ay*Bx) )

Equating it with zero, we have a quadratic equation of the form: qA * t**2 + qB * t + qC = 0

Since this is only a quadratic equation, at the most it can have only two roots i.e. two values of t for which the velocity and acceleration vectors are parallel and hence an inflection occurs.

Can you please give an example of a cubic bezier which can inflect thrice?
Nobody
2013-06-20 12:29:25 UTC
Permalink
Post by s***@gmail.com
thus cubic. Furthermore, a cubic Bezier can inflect three times: once
internally and again at each endpoint; so you need three possible roots
to any inflection polynomial, further evidence of it being cubic.
It is my understanding that a cubic bezier can only inflect twice, by
http://www.caffeineowl.com/graphics/2d/vectorial/cubic-inflexion.html)
A cubic curve can only inflect once. But a cubic Bezier curve isn't a
cubic curve, it's a piecewise cubic curve, and each "join" can be a
point of inflection for the piecewise curve even if it isn't a point of
inflection for the actual cubic curves on either side of the join.
s***@gmail.com
2013-06-20 22:34:48 UTC
Permalink
Post by Nobody
A cubic curve can only inflect once. But a cubic Bezier curve isn't a
cubic curve, it's a piecewise cubic curve, and each "join" can be a
point of inflection for the piecewise curve even if it isn't a point of
inflection for the actual cubic curves on either side of the join.
I'm sorry but I think you are using confusing terminology. AFAIK, of the two you mention, the one that is *composed of pieces* is a cubic bezier *spline* and the *pieces themselves* are cubic bezier *curves*. See for example:

http://en.wikipedia.org/wiki/B%C3%A9zier_curve
""low order Bézier curves are patched together, producing a Bézier spline.""

http://en.wikipedia.org/wiki/B%C3%A9zier_spline
""a Bézier spline is simply a series of Bézier curves joined end to end""

http://en.wikipedia.org/wiki/B%C3%A9zier_curve#Examination_of_cases clearly shows that the curves are by definition limited to the domain t in [0,1].

Returning to the present topic, Mr Kinch did write "a cubic Bezier can inflect three times" by which I presume he meant to refer to a cubic Bezier *curve* since obviously a cubic Bezier *spline* can inflect a much higher number of times. And with all due respect to his bezier expertise (http://www.truetex.com/bezexp.htm) I do not understand how it is mathematically even possible for this to be true!
Nobody
2013-06-21 12:24:54 UTC
Permalink
Post by s***@gmail.com
Post by Nobody
A cubic curve can only inflect once. But a cubic Bezier curve isn't a
cubic curve, it's a piecewise cubic curve, and each "join" can be a
point of inflection for the piecewise curve even if it isn't a point of
inflection for the actual cubic curves on either side of the join.
I'm sorry but I think you are using confusing terminology. AFAIK, of the
two you mention, the one that is *composed of pieces* is a cubic bezier
*spline* and the *pieces themselves* are cubic bezier *curves*.
There isn't a single agreed terminology. Plenty of sources use the term
"curve" to refer to the entire curve (spline) and e.g. "segment" for the
individual cubic curves over the range [0,1].
Post by s***@gmail.com
Returning to the present topic, Mr Kinch did write "a cubic Bezier can
inflect three times" by which I presume he meant to refer to a cubic
Bezier *curve* since obviously a cubic Bezier *spline* can inflect a much
higher number of times. And with all due respect to his bezier expertise
(http://www.truetex.com/bezexp.htm) I do not understand how it is
mathematically even possible for this to be true!
Furthermore, a cubic Bezier can inflect three times: once internally and
again at each endpoint
He's basically saying that you can get three inflections in one segment of
a spline by virtue of "synthetic" inflections at the endpoints.

As the second derivative of a cubic function is linear, it can have at
most one point of inflection (that's the "internally" part). However, when
two cubic curves are joined with first and second order continuity, the
second derivative can "flip" at the join, effectively creating an
additional point of inflection at either endpoint, or both.
s***@gmail.com
2013-06-21 13:27:26 UTC
Permalink
Post by Nobody
Post by s***@gmail.com
Furthermore, a cubic Bezier can inflect three times: once internally and
again at each endpoint
He's basically saying that you can get three inflections in one segment of
a spline by virtue of "synthetic" inflections at the endpoints.
Post by s***@gmail.com
One can detect this alignment
using a vector dot product of the velocity and acceleration, which goes to
zero at inflection times. In the cubic Bezier case, this becomes a single
cubic polynomial in t, solvable in closed form.
Cubic Bezier velocity (ths 1st derivative) is quadratic, acceleration (2nd
derivative) is linear, and the dot product is thus cubic. Furthermore, a
cubic Bezier can inflect three times: once internally and again at each
endpoint; so you need three possible roots to any inflection polynomial,
further evidence of it being cubic.
There are several problems with the above statements. First, it is indeed somewhat ambiguous when it talks about the inflecting at each endpoint, leading to you being able to impose your interpretation on it.

However, if one is to expect to analytically derive the times of inflection by equating to zero the "vector dot product" i.e. perp dot product or determinant, one can do this only for a single bezier curve segment (to be very specific). And in this case, I have shown that the this determinant polynomial is *not* cubic but it is quadratic. Though velocity is quadratic and acceleration is linear, while doing the perp dot product the cubic terms cancel out and hence the resultant expression is only quadratic.

The reference to "three roots to inflection polynomial" and "further evidence of it being cubic" is hence totally inexplicable IMO.

Unless I have further explanation from Mr Kinch, I will have to think of it as hastily written in error by a person who may have otherwise put in much work on beziers.
Post by Nobody
As the second derivative of a cubic function is linear, it can have at
most one point of inflection (that's the "internally" part).
I'm sorry but did you even read the mathematics I wrote down above? Did you see the caffeineowl link? Examine the bezier (100,150)..controls (297,292) and (197,358)..(300,150) -- it has two inflections at times 0.367 and 0.768 as roots of the quadratic polynomial which is the determinant of the velocity and acceleration vectors.

I think there is not much more to say on this topic...
Nobody
2013-06-21 15:24:11 UTC
Permalink
Post by s***@gmail.com
Unless I have further explanation from Mr Kinch, I will have to think of
it as hastily written in error by a person who may have otherwise put in
much work on beziers.
Well, bear in mind that you appear to be replying to a message which
was posted in 1999. It's far from certain that the author still reads this
group.

My news server doesn't retain messages back that far, so I only had the
fragment you originally quoted to go on.

But consider this: if you're analysing the behaviour of a cubic
parameteric curve, there's nothing special about parameter values of
0 or 1 (i.e. the endpoints of a segment). If the curve itself has an
inflection at either of those points, it will do so regardless of whether
or not they are they are the endpoints of a segment.

Loading...