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: \(f(u) = a_0 + u a_1 + u^2 a_2 + u^3 a_3\). 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 \(u\) value into \(f\) or \(f'\).
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 for 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.
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.