The purpose of this project was to create a simple editor, allowing a user to edit Bézier curves over the net, in an Java applet. The curves were to be edited by creating and moving endpoints and controlpoints. Curves that shared an endpoint should be G1 continuous.
For each value of t, the x and y values of the point are calculated separately based on the endpoints and control points of the curve (p1...p4), according to this formula:
This formula is given in Foley et. al. (1990) as formula 11.29 on page 489.
This applet should be pretty self-explanatory. If you start or end a new curve at one of the endpoints of an old one, they will join into one continous curve (G1 continuity, that is - the endpoint and the two adjoining control points are all on the same line). To start afresh simply reload this page. (You might have to hit <shift>-reload or something.)
(Get all the source code in one file here.)
Foley, van Dam, Feiner, Hughes (1990) Computer Graphics, Principles and Practice. Second ed. Addison Wesley.