# A local C^2 Hermite interpolation scheme with PH quintic splines for 3D data streams

The construction of smooth spatial paths with Pythagorean-hodograph (PH) quintic spline biarcs is proposed. To facilitate real-time computations of C^2 PH quintic splines, an efficient local data stream interpolation algorithm is introduced. Each spline segment interpolates second and first order Hermite data at the initial and final end-point, respectively. In the spline extension of the scheme a C^2 smooth connection between successive spline segments is obtained by taking the locally required second-order derivative information from the previous segment. Consequently, the data stream spline interpolant is globally C^2 continuous and can be constructed for arbitrary C^1 Hermite data configurations. A simple and effective selection of the free parameters that arise in the interpolation problem is proposed. The developed theoretical analysis proves the fourth approximation order of the local scheme while a selection of numerical examples confirms the same accuracy of its spline extension. In addition, the performances of the algorithm are also validated by considering its application to point stream interpolation with automatically generated first-order derivative information.

## Authors

• 5 publications
• 1 publication
• 2 publications
08/02/2021

### Splines for Image Metamorphosis

This paper investigates a variational model for splines in the image met...
03/19/2020

### THB-spline approximations for turbine blade design with local B-spline approximations

We consider adaptive scattered data fitting schemes with truncated hiera...
12/20/2017

### On the one method of a third-degree bezier type spline curve construction

A method is proposed for constructing a spline curve of the Bezier type,...
06/26/2019

### Polyhedral Spline Finite Elements

Spline functions have long been used in numerically solving differential...
03/31/2016

### Sub-pixel accuracy edge fitting by means of B-spline

Local perturbations around contours strongly disturb the final result of...
06/24/2018

### Golden interpolation

For the classic aesthetic interpolation problem, we propose a novel thou...
04/07/2016

### Nielson-type transfinite triangular interpolants by means of quadratic energy functional optimizations

We generalize the transfinite triangular interpolant of (Nielson, 1987) ...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Planar and spatial polynomial Pythagorean-hodograph (PH) curves are characterized by a polynomial parametric speed, and can be effectively represented in terms of complex and quaternion algebra, respectively [4]. We refer to [7] for a comprehensive recent introduction to PH curves, as well as to related constructions and applications. The spline extension of PH structures offers many advantages in the context of path generation, as for examples the possibility of easily constructing flexible fair shapes, and a piecewise polynomial arc length, a distinctive feature for motion control on a given path, see e.g., [8] and references therein.

The focus of this paper is on the construction of a local interpolation scheme based on spatial PH quintic splines for given Hermite (positions and first-order derivatives) data streams. The availability of input Hermite data is usually assumed when higher shape control for suitable path identification should be enabled. More specifically, each spline segment interpolates second and first order Hermite data at the initial and final end-point, respectively. In the spline extension of the scheme a smooth connection between successive spline segments is obtained by taking the locally required second-order derivative information from the previous segment. Consequently, the data stream spline interpolant is globally continuous and can be constructed for arbitrary Hermite data configurations.

Interpolation of spatial Hermite data by PH splines is a challenging problem involving a family of solutions whose shape is strongly influenced by the choice of certain free parameters. While general

Hermite data can always be interpolated by cubic polynomial splines, the PH condition reduces the available degrees of freedom and PH cubic interpolants with

or continuity not always exist [9, 10, 11]. To avoid this problem the PH spline degree can be raised to 5 [5, 6, 13] or the cubic spline segment can be subdivided in two (or more) segments [1, 12]. In a similar way, spatial PH spline interpolants can be (always) obtained either with PH curves of higher (nine) degree [14] or with low-degree PH spline arcs of different kind. For example, the interpolation scheme proposed in [2] relies on PH quintic triarcs, since PH quintic biarcs are not flexible enough for addressing the symmetric second-order Hermite interpolation problem.

An increasingly range of applications nowadays requires a real-time processing of input data streams, usually consisting of position information with or without first and second order Hermite data. The access to the whole data set is then not originally available and the streaming algorithm should be completely local and suitably exploit first (and second) derivative estimates to properly compute smooth paths with different order of continuity. As a consequence, symmetric interpolation algorithms which generate the same geometric path when the order of the whole data sequence is reverted (a desirable feature when the data are all simultaneously available) are not strictly needed in this context, see for example

[3].

Our method relies on PH quintic biarcs, since they ensure enough flexibility for addressing the considered interpolation problem, while preserving the practicality of PH quintics. Between any pair of successive Hermite data the corresponding path segment is defined as a spatial PH quintic biarc, which also requires a second derivative information at one of the two extrema. However, in the spline implementation of the scheme for Hermite data streams, this information is not required as additional input data since it is directly obtained by evaluating the second derivative of the previous biarc at the joint point to guarantee curvature continuity at this point. A single PH quintic arc interpolating only first-order Hermite data is considered at the beginning to completely avoid the need of second-order derivative information. A simple and effective selection of the free parameters that arise in the interpolation problem is proposed by relying on the results for the PH quintic spline interpolants proposed in [6]. The theoretical analysis proves the fourth approximation order of the local scheme when exact first order Hermite data and a second order error on the condition are considered. A selection of numerical examples confirms the same approximation for the spline extension of the scheme. In addition, the performance of the algorithm are also validated by considering an application-oriented point stream with automatically generated first-order derivative information.

The plan for this paper is as follows. The data stream interpolation algorithm based on polynomial Pythagorean-hodograph biarcs of degree five is presented in Section 2. An effective strategy for the selection of the free parameters is proposed in Section 3. The approximation order of the local scheme is studied in Section 4, while Section 5 presents a selection of computed examples. Finally, Section 6 summarizes the key results of this paper.

## 2 The interpolation scheme

In this section we introduce the local interpolation problem addressed in the paper, referring to the Appendix for a short introduction to the quaternion algebra. We aim to construct a parametric PH quintic spline curve interpolating two assigned points at the end parameter values and such that

 {x′(ui)=vi,x′(uf)=vf,x′′(ui)=wi, (1)

where and

are assigned vectors

111Note that in the spline interpolation of an Hermite data stream, the vector is not an additional input information since it is simply taken from the previous spline segment of the path. in and the symbol denotes derivatives with respect to the global parameter In particular, we consider a PH quintic biarc, a spline curve composed by two PH quintic polynomial segments joining at the inner parameter value

 x(u)={xi(u)for u∈[ui,um],xf(u)for u∈[um,uf].

Let be the local parameter varying in associated to the whole biarc, and be the parameter value where the two PH quintic segments of the biarc join, i.e.

 ^t:=hihi+hf,

with and In addition, let and denote the local parameter values both varying in associated with and respectively,

 τ:=u−uihi=t^t,η:=u−umhf=t−^t1−^t.

In order to consider PH quintic biarcs, we set

 dxidτ(τ):=A(τ)iA∗(τ),dxfdη(η):=B(η)iB∗(η), (2)

where

 A(τ):=2∑j=0AjB2j(τ),B(η):=2∑j=0BjB2j(η), (3)

are quadratic quaternion polynomials which define the pre-image of and in the Bernstein basis, with and and denoting quaternion coefficients belonging to As well known, the two quintic arcs and can be written as Bezier curves as follows,

 xi(τ)=5∑j=0qjiB5j(τ),xf(η)=5∑j=0qjfB5j(η), (4)

where and

 q1i=q0i+15A0iA∗0,q2i=q1i+110(A0iA∗1+A1iA∗0),q3i=q2i+130(A0iA∗2+4A1iA∗1+A2iA∗0),q4i=q3i+110(A1iA∗2+A2iA∗1),q5i=q4i+15A2iA∗2, (5)

and

 (6)

Since the position interpolation conditions are ensured by the assumption and it is clear that we need to define the six quaternion coefficients in order to satisfy the conditions in (1). Note that the scalar degrees of freedom available for compute the solution are just (and not ) since a spatial PH curve does not change if any quaternion coefficient of its pre-image is right multiplied by a common complex unit factor of the form Being the considered smoothness and interpolation conditions just (two vector conditions on first and second derivatives at the left end point, one vector condition on first derivative at the right end point and three vector conditions to ensure the joint at of the biarc), there are necessarily some free parameters in the scheme. Additional conditions to identify a suitable interpolating biarc between the family of formal solutions should then be considered. This has allowed us a preliminary removal of two free parameters by requiring that the scheme produces just one PH quintic instead of a biarc, whenever possible. We then impose a joint between the quaternion pre-images of the two polynomial segments of the biarc. This also ensures smoothness at the same point to the Euler–Rodrigues frame associate to the PH biarc, see for example [7] and references therein. If, for simplicity, is chosen at the midpoint between and this condition corresponds to assign and as follows,

 B0=A2,B1=2A2−A1. (7)

The derivative interpolation requirements assigned at the end points are the following,

 dxidu(ui)=vi,dxfdu(uf)=vf,d2xidu2(ui)=wi. (8)

Now, considering that is

the following two derivative chain rules can be easily obtained,

 dxidu=12hdxidt=1hdxidτ,dxfdu=12hdxfdt=1hdxfdη,
 d2xidu2=14h2d2xidt2=1h2d2xidτ2,d2xfdu2=14h2d2xfdt2=1h2d2xfdη2.

Consequently, using the derivative formula for polynomials in Bernstein form, the conditions in (8) correspond to the following vector conditions in the quaternion algebra,

 ⎧⎪ ⎪⎨⎪ ⎪⎩A0iA∗0=hvi,B2iB∗2=hvf,2((A1−A0)iA∗0+A0i(A1−A0)∗)=h2wi (9)

where, taking into account the first two equations, the last one reduces to

 2(A1iA∗0+A0iA∗1)=h2iwi+4hivi. (10)

From the general quaternion solution of a quadratic equation [5], we derive the expressions

 A0=√hi|vi| U0,B2=√hf|vf| U2, (11)

for and which satisfy the first two conditions in (9), with the unit quaternions

 U0:=ui(cosα0+isinα0),U2:=uf(cosβ2+isinβ2), (12)

depending on the two free angular parameters and , and the unit vector quaternions

 ui:= δi+i|δi+i|,uf:= δf+i|δf+i|,

written in terms of and By setting

 di:=hi4 (hiwi+4vi), (13)

the vector condition in (10) is fulfilled if

 A1=−(a1+di)A0i|A0|2, (14)

where is a scalar free parameter. Now, considering (7), in order to ensure a connection at the joint point between the two polynomial segments of the biarc we need only to require that is

 pi+15hvi+120(h2wi+4hvi)+130(A0iA∗2+4A1iA∗1+A2iA∗0)+110(A1iA∗2+A2iA∗1) (15) +15A2iA∗2=pf−15hvf−110(B1iB∗2+B2iB∗1)−130(B0iB∗2+4B1iB∗1+B2iB∗0) (16) −110(B0iB∗1+B1iB∗0)−15B0iB∗0. (17)

After replacing the expressions for and given in (7), moving on the left hand side all the terms containing and on the right all the others, this equation can be properly simplified to

 A2iA∗2+140(GiA∗2+A2iG∗)=1520c−210A1iA∗1+340(A1iB∗2+B2iA∗1), (18)

where

 G:=A0−8A1+7B2 (19)

and

 c:=(pf−pi)−15h(vf+vi)−120(h2wi+4hvi)

This last vector equation can also be further algebraically manipulated to arrive at the following final form,

 (A2+140G)i(A2+140G)∗=b, (20)

where

 b:=1520c−210A1iA∗1+340(A1iB∗2+B2iA∗1)+11600GiG∗.

Thus, considering again the general solution of a quadratic quaternion equation of type from (20) we get

 A2=−140G+q (cosα2+isinα2), (21)

where is another free angular parameter and for brevity we have set,

 q:=√|b| i+b|b|∣∣i+b|b|∣∣. (22)

Summarizing, the scheme has four free parameters: the three angles and , together with the real coefficient However, the next proposition proves that the real shape angular parameters are just two: and

###### Proposition 1.

For any the replacement of and in our scheme with and , respectively, produces the same PH quintic biarc.

Proof : We need to prove that adding to the free angular parameters and implies that all the quaternion coefficients are right multiplied by the complex unit quaternion For and this can be verified using equations (11) and (12) together with trigonometric sum formulas. As for considering that we have already proved that is right multiplied for recalling that formula (14) implies the result. As a consequence, formula (19) implies that also the quaternion is right multiplied by this factor. Consequently, formulas (21) and (7) imply that this is also true for and , respectively.
As usual with PH curves, the shape parameters highly influence the resulting interpolant, as shown in Figure 1. Reasonable and effective criteria for their choice are necessary. More precisely, since the scheme has to be used for defining a spline curve, it is fundamental that just one PH biarc is locally identified. This means that we need to properly fix our three shape parameters, and In addition, since we are interested in defining an interpolation scheme suitable for real-time applications, it is also necessary that these criteria have an easy implementation. In the next section we introduce a simple and effective selection strategy driven by a reference PH quintic curve introduced in [6] to solve the Hermite interpolation problem. Successively, in Section 3, we show that this strategy is reasonable from the approximation point of view, since it ensures fourth approximation order to our scheme. This is the same approximation order characterizing the PH spline quintic Hermite scheme used as a reference for the free parameter selection.

## 3 Selection of free parameters

As already mentioned in the previous section, the free angular parameters and the real parameter of our approach can highly affect the shape of the interpolating biarc. In this section we introduce our data-dependent selection strategy based on a reference PH curve easy to be constructed. This curve is defined as a PH quintic interpolating the given zero and first order data at the extrema but not the assigned second order information at the left end point (this would not be possible in the general case, since a PH quintic is not flexible enough for ensuring this additional condition). Now, as shown in [6], the determination of an Hermite PH quintic interpolant is affected by two free shape parameters (all of angular type) and four data-dependent different criteria for their selection were there introduced and compared. Here we rely on the so called CC criterion222The CC label is the acronym for Cubic-Cubic, since the selection strategy of both the angular shape parameters affecting an Hermite PH quintic interpolant is done in this case using the standard cubic Hermite interpolant as a reference curve. whose implementation is very easy. Besides having a very good behavior for general non asymptotic data, in [13] it has also been proved that this criterion ensures fourth approximation order when the scheme is applied to the reconstruction of a given analytic smooth curve.

### 3.1 The reference PH quintic

Let us denote with

 VH(t)=2∑j=0VHjB2j(t),t∈[0,1],

the pre-image expressed in the local parameter of the CC PH quintic polynomial segment verifying the assigned end Hermite conditions,

 xH(0)=pi,dxidt(0)=2hvi,xH(1)=pf,dxfdt(1)=2hvf.

Concerning the algorithm for its construction, we recall some basic points, referring to [6] for the details. First we observe that, dealing with PH curves, one of the two end point interpolation conditions come for free by taking into account the integral definition of a PH curve from its hodograph. Consequently, only three of the four Hermite conditions are available for the characterization of the three quaternion coefficients and a free angular parameter is associated to each of them. On the other hand, only two of these three free angles are real shape parameters, since the interpolating PH quintic does not change if all the quaternion coefficients are multiplied by a trigonometric factor of the form For all the criteria proposed in [6], the angular free parameter associated to was chosen equal to zero and the other two were selected according to the considered criterion. We refer to [6] for the details on the CC criterion by simply outlining that it allows degree reduction of the pre-image and, consequently, the definition of a PH cubic Hermite interpolant, whenever possible.

Since we use the CC PH quintic Hermite interpolant as a reference curve to construct our PH quintic biarc, it is useful to represent it as a biarc with joint parameter at We then set

 (23)

Using again on the left the local parameter and on the right we observe that

 dxHidτ=AH(τ)iAH∗(τ),dxHfdη=BH(η)iBH∗(η),

where

 AH(τ)=2∑j=0AHjB2j(τ),BH(η)=2∑j=0BHjB2j(η),

with

 AH0:=1√2VH0,AH1:=12√2(VH0+VH1),BH1:=12√2(VH1+VH2),BH2:=1√2VH2, (24) AH2=BH0:=14√2(VH0+2VH1+VH2). (26)

### 3.2 The parameter selection strategy for the biarc

The quaternion coefficients introduced in (24) to express the hodograph of the reference CC PH quintic Hermite interpolant in biarc form are directly used in our strategy to drive the selection of the free parameters. We observe that, even if only the differences and are real angular shape parameters, in the algorithm we specify all the three angles since we refer to a specific pre-image of the reference PH curve for their selection. Note also that first and are selected referring to and respectively. Subsequently, the real parameter involved in the definition of is determined through an explicit formula which only involves and Finally, the remaining free angle is determined with an explicit formula depending on all the previous choices, as well as on the reference quaternion coefficient .

The choice of the two extreme angular free parameters and is very easy, since we just set

 A0=AH0,B2=BH2.

We then determine the free parameter in order to minimize the following scalar quantity,

 |A1−AH1|2=A1A∗1−(A1AH∗1+AH1A∗1)+AH1AH∗1.

Recalling that with we get

 |A1−AH1|2=a21|A0|2−a1|A0|(U0AH∗1+AH1U∗0)+K

where

 K:=|di|2|A0|−(diU0AH∗1−AH1U∗0di)|A0|+AH1AH∗1.

Thus the minimum is obtained by setting

 a1=12|A0|(U0AH∗1+AH1U∗0)=12(A0AH∗1+AH1A∗0). (27)

Finally, we determine the last free parameter by minimizing the following quantity,

 |A2−AH2|2=A2A∗2−( A2AH∗2+AH2A∗2)+AH2AH∗2. (28)

Since depends on and, in particular,

 A2=−14(10+b21)G+qeiα2,

we have

 A2A∗2 =(−14(10+b21)G+qeiα2)(−14(10+b21)G∗−e−iα2q) =116(10+b21)2GG∗−q2+14(10+b21)(Ge−iα2q−qeiα2G∗)

and

 (A2AH∗2+AH2A∗2)=−14(10+b21)(GAH∗2+AH2G∗)+(qeiα2AH∗2−AH2e−iα2q)

This implies that

 |A2−AH2|2=f1cosα2+f2sinα2+g,

with

 g:=116(10+b21)2GG∗−q2+14(10+b21)(GAH∗2+AH2G∗)+AH2AH∗2

and

 f1 :=14(10+b21)(Gq−qG∗)−(qAH∗2−AH2q), (29) f2 :=−14(10+b21)(Giq+qiG∗)−(qiAH∗2+AH2iq). (30)

Thus we minimize (28) if

 α2=π+atan2(f2,f1). (31)

In Figure 2 the biarc resulting from this particular choice of the parameters is plotted together with the same set of variation of Figure 1.

## 4 Approximation Order

This section presents the asymptotic analysis to prove that the

PH quintic Hermite interpolation scheme here introduced has fourth approximation order. This is the same approximation order characterizing the first order PH quintic Hermite interpolation scheme introduced in [6], provided that the CC criterion is used to fix its two free angular parameters. This theoretical result was proved in [13] developing a local asymptotic analysis, i.e. just for one spline segment. The symmetric end-point first order Hermite data were there taken from an infinitesimal portion of a given smooth curve to be approximated, where is the arc-length parameter varying from to Note that in [13] the fourth approximation order can be trivially extended to the spline formulation of the scheme, since it computes each segment of the PH quintic spline independently from the others with the same local approach.

We here present an analogous asymptotic analysis for our new forward scheme, relying on a MAPLE symbolic implementation of the local scheme. However, the situation in the spline formulation is now different: to obtain a interpolant, the biarc segments have to be computed in sequential order by using the additional second order information at the first end point of a segment from the previous one. In the local symbolic implementation of the scheme it is then reasonable to assume that this information can be affected by an error with an expansion. Under this assumption we are able to prove that locally also the new scheme has fourth approximation order. A theoretical proof of the convergence order of the spline formulation of the scheme would require in this case also the analysis of the error propagation on the second derivative information at the joint points between successive biarcs. Even if this point was not formally addressed in virtue of the difficulties strictly connected to the non linear nature of any PH interpolation scheme, all the numerical experiments confirm the fourth approximation also to the spline formulation of the scheme.

Let us consider the portion of a given smooth curve restricted to and the symbolic computation of the PH biarc defined in Sections 2 and 3 using the following input data:

 pi =r(0), pf =r(Δs), vi =drds(0), vf =drds(Δs), (32) wi =d2rds2(0)+O(Δs2).

The following proposition is based on symbolic computations performed in the MAPLE computing environment (the MAPLE worksheet is available from the authors upon request).

###### Proposition 2.

Let us consider an arc-length parametrized curve with and continuity and let be the PH quintic biarc fulfilling the vector interpolation conditions in (4). We have

 ∥x(t)−r(tΔs)∥2=O(Δs4),∀t∈[0,1]and ∥d2xds2(Δs)−d2rds2(Δs)∥2=O(Δs2).

Proof : Denoting for brevity the Euclidean norm just with and using the triangular inequality, it is possible to write

 ∥x(t)−r(tΔs)∥≤∥x(t)−xH(t)∥+∥xH(t)−r(tΔs)∥

where is the CC PH quintic interpolant introduced in [6]. Now, under the same hypotheses here assumed, in [13] it has been proved that provides a fourth order accurate approximation of . We can then study the first term of the previous inequality. Considering the biarc representation of introduced in (23), we can write

 ∥x(t)−xH(t)∥={∥xi(t)−xHi(t)∥for t∈[0,0.5],∥xf(t)−xHf(t)∥for t∈[0.5,1].

Since Bernstein polynomials are nonnegative in and sum up to 1, we can derive the following inequalities

 ∥xi(t)−xHi(t)∥≤maxk=0,…,5∥qik−qHik∥,∥xf(t)−xHf(t)∥≤maxk=0,…,5∥qfk−qHfk∥,

where and are the Bèzier control points of the first and second segment of the biarc and of the biarc representation of respectively. Since both and interpolate first order Hermite data at the end points, we have

 qi0=qHi0,qi1=qHi1,qf5=qHf5,qf4=qHf4.

On the other hand, since we already know that approximates with fourth order, its second derivative at approximates at least with second order. Thus, considering the expression of the second derivative in Bernstein form, this implies that it is at least Considering these preliminary points and also that both biarcs and have smoothness at we can just focus on the expansions for

 ∥qik−qHik∥,k=3,4,5,∥qfk−qHfk∥,k=3. (33)

In order to simplify the MAPLE expansions, without loss of generality, we assume that and are aligned with the and axis, respectively, with and Furthermore, by taking into account the arc-length parameterization for we set and with The expressions of the zero and first derivative of at are then symbolically defined by using Taylor expansions at

Now ,the expansions for the norms in (33) clearly depend on those of the free real parameter , fixed using formula (27), and on those of the cosine and sine of , defined through formulas (31) and (29). Considering for brevity the case the symbolic implementation of the scheme produces the following formulas

 a1=−cz16byΔs2+O(Δs3),cosα2=1−c2z512b2yΔs2+O(Δs3),sinα2=cz16byΔs+O(Δs2).

This implies that all the free parameters asymptotically tend to zero, in line with other PH interpolation schemes. After the preliminary symbolic computation of the control points defining in biarc form, the symbolic computation of all the quaternion coefficients defining the pre-image of allows also the symbolic evaluation of through formulas (5) and (6). The following expansions of the norms in (33) are then obtained,

 ∥qi3−qHi3∥ =7(11520|by|)σs4+O(Δs5), ∥qi4−qHi4∥ =1(