Quadratic Hermite Curves Part 4
Part 3 of this series introduced a method to draw the tangent segment to the quadratic Hermite curve at a fixed length at any parameter value. This was contrasted to the geometric interpretation of the end tangent to the first segment.
By directly computing the end tangent using the methodology in part 2, we have a vector that can be used as an initial tangent for a second Hermite curve with a common join point at P1. What is the maximum continuity that could be achieved at the join? The derivative of a quadratic curve is linear in t (first-degree polynomial) so the second derivative is a constant, namely 2c in terms of the polynomial coefficients.
Recall from part 1 that c = P1 – P0 – T1 for the first curve (where T1 is the start tangent for the first segment). If the join point is P1 and the second curve interpolates some point P2, then its corresponding coefficient is P2 – P1 – T2. The second derivatives can only be equal if P1 – P0 – T1 = P2 – P1 – T2 or 2P1 = P0 + P2 + (T1-T2).
In general, only C-1 continuity can be achieved.
This continuity is easy to achieve based on the simplicity of the curve construction. The end tangent for the first curve is used to set the start tangent for the second curve. This is illustrated in following screenshot.
To experiment with the demo, the first Hermite curve is drawn as in prior demos. A crosshair appears in the drawing area. Click to define the P2 point and the second segment is drawn. You may study the code to see the algorithm in action.
In the next part of this series, we will look at extending this method to an aribtrary number of interpolation points.