0
9.2kviews
Hermite Cubic Spline
1 Answer
2
268views

Hermite cubic curve is also known as parametric cubic curve, and cubic spline. This curve is used to interpolate given data points that result in a synthetic curve, but not a free form, unlike the Bezier and B-spline curves, The most commonly used cubic spline is a three-dimensional planar curve (not twisted). The curve is defined by two data points that lie at the beginning and at the end of the curve, along with the slopes at these points. It is represented by a cubic polynomial. When two end points and their slopes define a curve, the curve is called a Hermite cubic curve. Several cubic splines can be joined together by imposing the slope continuity at the common points. In design applications, cubic splines are not as popular as the Bezier and B-spline curves. There are two reasons for this:

The curve cannot be modified locally, i.e. when a data point is moved, the entire curve is affected, resulting in a global control, as shown in the figure.

The order of the curve is always constant (cubic), regardless of the number of data points. Increase in the number of data points increases shape flexibility, however, this requires more data points, creating mote splines, which are joined together (only two data points and slopes are utilized for each spline).

enter image description here

$P(t)=\sum_{i=0}^{n} C_{i} t^{i}$

Linear Curve $n=1$

$P(t)=P_{0}(1-t)+P_{1} t$

$\quad \quad =\left[P_{0} P_{1}\right][(1-t)]$

$\quad \quad =P_{0} C_{1}$

$P(0)=C_{0}$

$P(1)=C_{0}+C_{1}$

$P(1)=P_{0}+C_{1}$

$C_{1}=P_{1}-P_{0}$

$\begin{aligned} P(t) &=P_{0}+\left(P_{1}-P_{0}\right) t \\ &=P_{0}(1-t)+P_{1} t \\ &=\left[P_{0} \quad P_{1}\right][(1-t)] \\ P(t) &=\left[P_{0} \quad P_{1}\right]\left[\begin{array}{cc}{-1} & {1} \\ {1} & {0}\end{array}\right] (\frac{t}{1}) \end{aligned}$


Example:

$P_{0}=(x, y)=(3,4), \quad P_{1}=(x, y)=(10,7)$

Solution:

$\begin{aligned} P_{x} &=\left[\begin{array}{ll}{3} & {10}\end{array}\right]\left[\begin{array}{cc}{-1} & {1} \\ {1} & {0}\end{array}\right]\left\{\frac{t}{1}\right\} \\ &=\left[\begin{array}{cc}{3} & {10}\end{array}\right]\left[\begin{array}{cc}{-t} & {1} \\ {t} & {0}\end{array}\right] \\ P_{x} &=3(-t+1)+10 \\ P_{x} &=7 t+3 \end{aligned}$

$P_{y}=\left[\begin{array}{ll}{4} & {7}\end{array}\right]\left[\begin{array}{cc}{-1} & {1} \\ {1} & {0}\end{array}\right]\left\{\frac{t}{1}\right\}$

$P_{y}=4(-t+1)+7 t$

$P_{y}=3 t+4$

$\begin{array}{|c|c|c|c|c|c|c|}\hline t \rightarrow & {0} & {0.2} & {0.4} & {0.6} & {0.8} & {1} \\ \hline P x & {3} & {4.4} & {5.8} & {7.2} & {8.6} & {10} \\ \hline P y & {4} & {4.6} & {5.2} & {5.8} & {6.4} & {7} \\ \hline\end{array}$

Hermit Cubic curve:

enter image description here

Start point $\mathrm{t}=0$ , end point $\mathrm{t}=1$

Tangent vector at start point $=P_{0}^{1}=\left[P_{2}-P_{0}\right]$

Tangent vector at end point $=P_{1}^{1}=\left[P_{3}-P_{1}\right]$

$P(t)=\sum_{i=0}^{3} C_{i} t^{i}$

$P(t)=C_{0}+C_{1} t+C_{2} t^{2}+C_{3} t^{3}$

$P^{1}(t)=C_{1}+2 C_{2} t+3 C_{3} t^{2}$

At $t=0$

$P_{0}=C_{0}$

$P_{0}^{1}=C_{1}$

At $t=1$

$P_{1}=C_{0}+C_{1}+C_{2}+C_{3} \ldots (1)$

$P_{1}^{1}=C_{1}+2 C_{2}+3 C_{3} \ldots (2)$

Multiplying eqn 1 by 3 and Subtracting by 2

$3 P_{1}-P_{1}^{1}=3 C_{0}+3 C_{1}+3 C_{2}+3 C_{3}-C_{1}-2 C_{2}-3 C_{3}$

$3 P_{1}-P_{1}^{1}=3 C_{0}+2 C_{1}+C_{2}$

$\therefore C_{2}=3 P_{1}-P_{1}^{1}-3 P_{0}-2 P_{0}^{1}$

Similarly,

$\therefore C_{3}=3 P_{1}-P_{1}^{1}-3 P_{0}-2 P_{0}^{1}$

$2 P_{1}-P_{1}^{1}=2 C_{0}+2 C_{1}+2 C_{2}+2 C_{3}-C_{1}-2 C_{2}-3 C_{3}$

$2 P_{1}-P_{1}^{1}=2 C_{0}+C_{1}-C_{3}$

$C_{3}=2 C_{0}+C_{1}-2 P_{1}+P_{1}^{1}$

$\begin{aligned} P(t) &=C_{0}+C_{1} t+C_{2} t^{2}+C_{3} t^{3} \\ P(t) &=P_{0}+P_{0}^{1} t+\left[3 P_{1}-P_{1}^{1}-3 P_{0}-2 P_{0}^{1}\right] t^{2}+\left[2 P_{0}+P_{0}^{1}-2 P_{1}+P_{1}^{1}\right] t^{3} \\ &=P_{0}\left[2 t^{3}-3 t^{2}+1\right]+P_{1}\left[-2 t^{3}+3 t^{2}\right]+P_{0}^{1}\left[t^{3}-2 t^{2}+t\right]+P_{1}^{1}\left[t^{3}-t^{2}\right] \end{aligned}$

$P(t)=\left[P_{0} P_{1} P_{0}^{1} P_{1}^{1}\right]^{}\left[\begin{array}{ccc}{2 t^{3}} & {-3 t^{2}} & {1} \\ {-2 t^{3}} & {3 t^{2}} & {1} \\ {t^{3}} & {-2 t^{2}} & {t} \\ {t^{3}} & {-t^{2}} & {1} \end{array}\right]$

$P(t)=\left[\begin{array}{cccc}{2} & {-3} & {0} & {1} \\ {-2} & {3} & {0} & {0} \\ {1} & {-2} & {1} & {0} \\ {1} & {-1} & {0} & {0}\end{array}\right]\left[\begin{array}{l}{t^{3}} \\ {t^{2}} \\ {t} \\ {1}\end{array}\right]$


Plot the Hermitz Cubic Curve having end points $P_{0}(1,3)$ and $P_{1}(7,2) .$ The tangent vector for end $P_{0}$ is defined by a line joining $P_{0}$ and another point $P_{2}(10,8)$

whereas the tangent vector for end $P_{1}$ is defined by line joining $P_{1}$ and another point $P_{3}(6,0)$

Solution:

$P_{0}=\left[\begin{array}{ll}{1} & {3}\end{array}\right]$

$P_{1}=\left[\begin{array}{ll}{7} & {2}\end{array}\right]$

$P_{2}=\left[\begin{array}{ll}{10} & {8}\end{array}\right]$

$P_{3}=\left[\begin{array}{ll}{6} & {0}\end{array}\right]$

Tangent vector,

$P_{0}^{1}=\left[P_{2}-P_{0}\right]$

$P_{0}^{1}=[9 \quad 5]$

$P_{1}^{1}=\left[P_{3}-P_{1}\right]$

$P_{1}^{1}=[-1 \quad -2]$

$P(t)=P_{0}\left[2 t^{3}-3 t^{2}+1\right]+P_{1}\left[-2 t^{3}+3 t^{2}\right]+P_{0}^{1}\left[t^{3}-2 t^{2}+t\right]+P_{1}^{1}\left[t^{3}-t^{2}\right]$

For X -direction

$P_{x}=1\left[2 t^{3}-3 t^{2}+1\right]+7\left[-2 t^{3}+3 t^{2}\right]+9\left[t^{3}-2 t^{2}+t\right]-1\left[t^{3}-t^{2}\right]$

$P_{x}=2 t^{3}-3 t^{2}+1-14 t^{3}+21 t^{2}+9 t^{3}-18 t^{2}+9 t-t^{3}+t^{2}$

$\therefore P_{x}=-4 t^{3}+t^{2}+9 t+1$

For Y-direction

$P_{y}=3\left[2 t^{3}-3 t^{2}+1\right]+2\left[-2 t^{3}+3 t^{2}\right]+5\left[t^{3}-2 t^{2}+t\right]-2\left[t^{3}-t^{2}\right]$

$P_{y}=6 t^{3}-9 t^{2}+3-4 t^{3}+6 t^{2}+5 t^{3}-10 t^{2}+5 t-2 t^{3}+2 t^{2}$

$\therefore P_{y}=5 t^{3}-11 t^{2}+5 t+3$

$\begin{array}{|c|c|c|c|c|c|c|}\hline t \rightarrow & {0} & {0.2} & {0.4} & {0.6} & {0.8} & {1} \\ \hline P_{x} & {1} & {2.808} & {4.504} & {5.896} & {6.792} & {7} \\ \hline P_y & {3} & {3.6} & {3.56} & {3.12} & {2.52} & {2} \\ \hline\end{array}$

enter image description here

Please log in to add an answer.