Page 8: Polynomial Pieces

Spring 2026 Sample Solution

The way that we’ll make complicated shapes is by piecing together simple pieces. We’ve already been doing this: we have been making pictures out of primitives. If we want something complicated, we make it from a bunch of lines, arcs, polygons, etc.

A specific example we have already been using is line segments. Line segments are a simple primitive. If we want to make a more complicated shape, we piece together a bunch of them. We might call the combined thing a “bigger primitive” (e.g., a polyline or whatever name you like for a list of line segments).

When we build things out of parts, we need to think about two main issues: (1) what parts we make things out of, and (2) how we make sure those parts fit together nicely. The continuity conditions from the previous page say what it means to fit together nicely. Now we need to find pieces with which we can achieve that.

To extend the line segment example: we know the pieces very well (a line segment is well defined mathematically, and we know how to specify it by giving its endpoints or other sets of numbers). We know how to fit pieces together: we make the end of one line the beginning of the next, and they connect without a gap. With line segments, at this connection point there will be a sharp “corner” (unless the line segments are going in the same direction). The shape won’t be “smooth”. Regarding line segments, you can probably imagine what I mean by “corner” and “smooth” - but for graphics, we’ll need to define the concept of smoothness more formally, which is what this page is about.

Two Line Segments

However, before defining smoothness (or continuity), we can learn a few things from the line segments.

First, notice that the problem with “lack of smoothness” only happens at the points where the lines come together. The line segment pieces themselves are smooth. The “continuity” question only happens at the specific place where the pieces meet.

Second, there are many different ways of writing the same line segment in parametric form. A simple one is:

(1)

This describes a line going from point to . I wrote it in non-vector notation first, and then in vector notation. Remember that u is a scalar, and in this case it does go from 0 to 1.

Here is another way to write the equation of the same line segment, but in terms of different parameters:

Here, I chose to specify the line with 2 vectors: and . The equation is much simpler, but it is less straightforward for me to specify the line. For example, if I knew where I wanted the line to end (so it connected to the next line), I would have to compute the right values of and . In this case, the computation is simple, but it isn’t the same as just making the end of one line be the beginning of the next.

Third: each line segment gets its own range of . If we wanted to have one line segment “continue” into another, we would need to introduce a new parameter. For example, suppose we have two line segments:

Each of these line segments has the point as one of its endpoints, but both of them have inputs in the range 0-1. To combine these segments into a single piecewise curve, we need to map a different part of our input range to each line segment. One approach would be to make the input range twice as long:

which makes a 2-piece polyline over the range 0-2. Notice how this maps the second half of the range (1-2) to the range of the second line segment by subtracting 1 from .

If we wanted the polyline to have the input range 0-1, we could construct a slightly different equation:

Here we draw the curve from =0 to 0.5 and from =0.5 to 1. In each case, we scale and shift so that the input to each line segment varies over the range 0-1.

Beyond Line Segments

The problem with line segments is that the derivatives at the beginning and end are fully determined by the positions of the points: we cannot control them independently. We can never achieve better than C(0), unless we are making a straight line. In order to achieve continuity, we’ll need to pick pieces that give us more freedom to control the derivatives at the end. However, we want to stick to functions that are mathematically simple and well-behaved. Low-order polynomials are the most common solution.

Next: Page  9 - Cubics