A cubic Bezier curve can be expressed in the following form: $$P(t) = GBT(t) = \left[ {\begin{array}{*{20}{c}} {{P_1}}&{{P_2}}&{{P_3}}&{{P_4}} \end{array}} \right]\left[ {\begin{array}{*{20}{c}} 1&{ - 3}&3&{ - 1}\\ 0&3&{ - 6}&3\\ 0&0&3&{ - 3}\\ 0&0&0&1 \end{array}} \right]\left[ {\begin{array}{*{20}{c}} 1\\ t\\ {{t^2}}\\ {{t^3}} \end{array}} \right]$$where $G$ is a vector of $4$ control points, $B$ is a matrix of Bernstein polynomial coefficients and $T$ is a time vector.
The task is to derive the spline matrix (similar to $B$) for a cubic spline $P(t)$ that satisfies the following conditions:
- It interpolates the first control point ${P_1}$ at time $t = 0$.
- Its tangent $P'(t)$ at $t = 0$ matches $3 \cdot ({P_2} - {P_1})$ like a cubic Bezier curve.
- It interpolates the third and fourth control points such that $P(2/3) = {P_3}$ and $P(1) = {P_4}$.
I know that i have to use the constraints to construct a system of linear equations. However, i'm having problems with building such system.