Bezier curves

These curves are defined by control points Pi, 0≤i≤n
The current point is then parametered as  P(t) = PiCni  ti(1-t)n-i 
with Cni being the binomial coefficients (n! / i!(n-i)!) and parameter 0 ≤ t ≤ 1
The curve defined by these n+1 points is then of degree n.
An important property is that this curve is tangent to the end segments P0P1 (in P0) and Pn-1Pn (in Pn).
Unfortunately, each intermediate control point changes the whole curve.
It is then difficult to choose the control points to get a curve through given points for instance.
We can then define the whole curve by parts, each part being defined by 3 or 4 points.

Casteljau construction

Note that Cni  ti(1-t)n-i = (t + (1-t))n = 1
P(t) is then the centroid of points Pi with corresponding weights.
Associative properties of centroids allow to recursively reduce the number of points.

Sorry, your browser is not Java compliant. With 3 control points A, B, C, we get :
Let M the centroid of A(t), B(1-t) and N the centroid of B(t), C(1-t).
that is AM/AB = BN/BC = t
We then calculate that P is the centroid of M(t), N(1-t) : MP/MN = t
The curve being of degree 2, it is an arc of conic sections, precisely an arc of parabola.

We may then continue with next control points D, E to get a second Bezier curve CDE "in the following" of the first.
If we state (as in the above applet) that BCD are in line, the whole curve has only one tangent in C and is "smooth".
If B and D are on the same side from C, we get a cusp point.
If we disconnect the directions of BC and CD, we get an angular point at C.

In the applet, you can drag the control points A,B,C,D,E,
D being restricted to be on line BC.
The draggable points M (M') define the parameter t of the current point P (P') for each of the two curves.

Sorry, your browser is not Java compliant. The above method can be used with 4 control points :
The Casteljau construction requires then one more iterate.
1st step : AM1/AB = BN1/BC = CP1/CD = t
2nd step : M1M2/M1N1 = N1N2/N1P1 = t
and finally M2P/M2N2 = t

The curve is a cubic (degree 3). It is the curve generated by the object CubicCurve2D in Java awt.geom, used for instance in the "loops game applet".


Home Arithmetic Geometric Misc Topics Scripts Games Exercices Mail Version Franšaise Previous topic Next topic