To split a curve as a human, all you have to do is look at a curve, draw a point on it, and you're done. But computers don't have eyes, so how do they know whether their pen is "on the curve"? If the curve is a Bezier curve, then computers can use “de Casteljau's” algorithm, which is deceptively simple:
This is illustrated in the following four boxes (which, by the way, represent a random curve. Reload the page to see a different one each time), with the first box showing the original curve with all of de Casteljau's contained control boxes show, the second one showing the joined two curves after splitting up the original curve, and the third and fourth containing those two curves separately. Note that you can click-drag the points in the first box to change the curve!
bounding box: none,
normal,
directional
start: /
control 1: /
control 2: /
end: /
curve split at
/
(t=)
|
This (non-animated-gif, non-flash) animation is brought to you by Processing, the visual programming language, and Processing.js, the project that brings Processing to the web, and of course me: Mike "Pomax" Kamermans. If you want to have a look at the source code, have a look here (the main code), here (very small bounding box regulator class), and here (the bezier curve class - this is where the interesting things happen).