Let's derive the contstraint matrix for a Hermite Spline, which is a cubic polynomial with its four control points defined by the position and derivative at the start and end of the cubic segment.
The form for our cubic polynomial is: . Just so that we have it handy, let's start by computing the first derivative of our polynomial.
Now let's derive the constraint matrix. For each of the following control points, write the corresponding row of the constraint matrix by plugging in the value into or .
Invert the constraint matrix to find the basis matrix. Feel free to use Julia or similar.
Now we'll derive the constraint matrix for a Bézier spline. The control points have almost the same meaning as in a hermite spline, except that the tangents are specified more intuitively as the difference between a pair of points. Another tweak made ofr convenience is to multiply the tangents by a factor of 3 - this makes it easier to have curves with large derivatives without having to place the control points super far away.
Write out a constraint equation for each of the following control points; they will not immediately look like the constraints we've seen before, since the left-hand side is not just a single control point.
This doesn't just give us a set of equations that can be converted nicely into matrix form. However, we can achieve this by rearranging the equations to solve for each of the 's (or for each of the 's). Based on this, Derive the Bézier basis matrix, either directly or by deriving the constraint matrix and inverting it.
At this point, you have what you need to get started on the spline lab: the first step of that lab is to plug in your matrix and write code that uses it to evaluate points along the curve.