0
$\begingroup$

I am dealing with spline interpolation and what I do is basically interpolating $6$th order ($7$ control points) spline through some discrete points. Curve-based part of my algorithm is done, however, in some points, I need to interpolate $6$th order spline which must be result in line.

Is there any mathematical method to do that ?

I thought to put $3$ control points each at start and end points and $1$ control point at the middle point of these start and end points. It seems it's working but how can I be sure that it's a line ? Or is there any other method to do that ?

$\endgroup$
2
  • $\begingroup$ Welcome to Math.SE. For future reference, you may take a look at this page to see how to format math on this site. $\endgroup$
    – g.kov
    Jul 18, 2020 at 6:53
  • $\begingroup$ You need to clarify the question. What king of the spline interpolation do you have in mind? Is it specific kind used in matlab? Does it consist of cubic Bezier segments? Asking "how can I be sure that it's a line", do you mean a straight line? Also, a picture would be very helpful as well as a definition of the spline interpolation method used. $\endgroup$
    – g.kov
    Jul 18, 2020 at 7:06

2 Answers 2

1
$\begingroup$

A Bézier curve with six control points is defined as

\begin{align} \mathbf{B_6}(t) &= \sum _{i=0}^{6} {6 \choose i}(1-t)^{6-i}t^{i}\,P_i \tag{1}\label{1} , \end{align}

where $P_i$, $i=0,\dots,6$ are the control points of the spline.

Because of the properties of the convex hull of the Bezier control points, to get a visual appearance of the straight line between the points $A,B$, one can just set $P_0=A$, $P_6=B$, and place the other five control points somewhere on the segment $AB$, so your choice of $P_0,P_1,P_2=A$, $P_4,P_5,P_6=B$, $P_3=\tfrac12\,(A+B)$ will do for that purpose. However, to get also the linear expression in \eqref{1}, we need to expand \eqref{1}, in order to get a representation as a polynomial of degree $6$ in the standard form \begin{align} a_6t^6+a_5t^5+a_4t^4+a_3t^3+a_2t^2+a_1t+a_0 \tag{2}\label{2} , \end{align}

where \begin{align} a_0&=P_0 ,\\ a_1&= 6\,(P_1-P_0) ,\\ a_2&=15\,(P_0-2\,P_1+P_2) ,\\ a_3&=20\,(-P_0+3\,P_1-3\,P_2+P_3) ,\\ a_4&=15\,(P_0- 4 P_1 + 6 P_2 - 4 P_3+ P_4) ,\\ a_5&= 6\,(-P_0+5\,P_1-10\,P_2+10\,P_3-5\,P_4+P_5) ,\\ a_6&=P_0-6\,P_1+15\,P_2-20\,P_3+15\,P_4-6\,P_5+P_6 . \end{align}

To get a set of control points $P_i$ such that expression \eqref{2} becomes linear in parameter $t$, we need to make all coefficients $a_2,\dots,a_6$ zero. The solution then is just

\begin{align} P_i&=\tfrac16\,(A\cdot(6-i)+B\cdot i) ,\quad i=0,\dots,6 , \end{align}

that is, all control points are evenly distributed along the segment $AB$.

$\endgroup$
0
$\begingroup$

Your idea of putting three control points at each end and one in the middle will work. By a well-known property, the Bézier curve is contained in the convex hull of the control points. So, actually, you can place the control points any way you like along a line, and the Bézier curve will then be contained within that line.

In the answer by @g.kov, the idea is to distribute the control points evenly along the line segment. This is a good choice because it gives you a Bézier curve whose first derivative vector has constant magnitude.

You can get this evenly-spaced solution just by taking a Bézier curve of degree 1, and using standard degree-elevation formulas to raise its degree to 6.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.