Construction of low degree rational Lagrange...

18
Construction of low degree rational Lagrange motions Marjeta Krajnc a,b , Karla Poˇ ckaj c , Vito Vitrih c,d,* , a FMF, University of Ljubljana, Jadranska 19, Ljubljana, Slovenia b IMFM, Jadranska 19, Ljubljana, Slovenia c IAM, University of Primorska, Muzejski trg 2, Koper, Slovenia d FAMNIT, University of Primorska, Glagoljaˇ ska 8, Koper, Slovenia Abstract Construction of rational spline motions is an important issue in robotics, animations and related fields. In this paper a geometric approach to interpolate given sequence of rigid body positions is considered, which, in contrast to standard approaches, is free of choosing a parameterization in advance, it enables the lowest possible degree of the motion and implies much higher approximation order. A general problem how to interpolate 2n given positions by rational motion of degree 2n is presented and two particular cases, motions of degree six and eight, are studied in more detail. The Lagrange interpolation scheme is further generalized to a method for constructing first order geometric continuous rational spline motions of degree six. Numerical examples are given which confirm the presented theoretical results and illustrate that the trajectories have nice shape properties. Key words: motion design, geometric interpolation, rational spline motion, geometric continuity 1 Introduction Rational spline motions are important in robotics, computer graphics, animations and several related fields. They are defined by the property, that the trajectories of points of a moving rigid body are piecewise rational curves. An important task is to construct a motion through some given positions of a rigid body. If some * Corresponding author, Tel: +386 5 611 75 84 Email addresses: [email protected] (Marjeta Krajnc), [email protected] (Karla Poˇ ckaj), [email protected] (Vito Vitrih). Preprint submitted to Elsevier 28 August 2012

Transcript of Construction of low degree rational Lagrange...

Page 1: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Construction of low degree rational Lagrangemotions

Marjeta Krajnc a,b, Karla Pockaj c, Vito Vitrih c,d,∗,aFMF, University of Ljubljana, Jadranska 19, Ljubljana, Slovenia

bIMFM, Jadranska 19, Ljubljana, SloveniacIAM, University of Primorska, Muzejski trg 2, Koper, Slovenia

dFAMNIT, University of Primorska, Glagoljaska 8, Koper, Slovenia

Abstract

Construction of rational spline motions is an important issue in robotics, animations andrelated fields. In this paper a geometric approach to interpolate given sequence of rigidbody positions is considered, which, in contrast to standard approaches, is free of choosinga parameterization in advance, it enables the lowest possible degree of the motion andimplies much higher approximation order. A general problem how to interpolate 2n givenpositions by rational motion of degree 2n is presented and two particular cases, motionsof degree six and eight, are studied in more detail. The Lagrange interpolation scheme isfurther generalized to a method for constructing first order geometric continuous rationalspline motions of degree six. Numerical examples are given which confirm the presentedtheoretical results and illustrate that the trajectories have nice shape properties.

Key words: motion design, geometric interpolation, rational spline motion, geometriccontinuity

1 Introduction

Rational spline motions are important in robotics, computer graphics, animationsand several related fields. They are defined by the property, that the trajectoriesof points of a moving rigid body are piecewise rational curves. An important taskis to construct a motion through some given positions of a rigid body. If some

∗ Corresponding author, Tel: +386 5 611 75 84Email addresses: [email protected] (Marjeta Krajnc),

[email protected] (Karla Pockaj), [email protected] (Vito Vitrih).

Preprint submitted to Elsevier 28 August 2012

Page 2: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

standard interpolation techniques from the curve design are applied, the resultingmotion heavily depends on a particular parameterization, which has to be chosenin advance. Furthermore, standard algorithms imply rational motions of a relativelyhigh degree with a large discrepancy in degrees of freedom involved in the sphericaland the translational part of a motion.

To construct rational motions of lower degree, geometric interpolation techniques(see e.g. [1] and references therein) that generate spline motions only from givengeometric data (points, tangents, etc) can be used instead. This approach yieldsat least two important advantages: an automatically chosen parameterization and ahigher asymptotic approximation order. The first steps in this direction were done in[2] and [3]. Geometric interpolation by parabolic splines was used to construct G1

quartic rational spline motions. The generalization of this approach to cubic inter-polation, which leads toG2 rational spline motions of degree six, was considered in[4]. The difficulty with geometric interpolation methods is that nonlinear equationsare involved and the analysis of the existence and uniqueness of the interpolant canbe quite complicated.

In this paper, we apply the geometric interpolation approach to interpolate givensequence of a rigid body positions (center positions and rotations) with a rationalmotion of the lowest possible degree. We conjecture that 2n positions can be inter-polated with a rational motion of the degree 2n, which is much smaller comparedto motions of degree 4n − 2 obtained by standard approaches (see e.g. [5]). Thefirst nontrivial and practically very important case, i.e., rational motion of degreesix interpolating six given positions, is studied in detail. Solution of a nonlinearsystem involved is given in an explicit form and is proven to be unique. Addition-ally, partial analysis is done for motion of degree eight where the nonlinear systembecomes much more complicated. The Lagrange interpolation scheme is furthergeneralized to a method for constructing first order geometric continuous rationalspline motions of degree six, that locally interpolate four given positions and firstorder boundary data.

The paper is organized as follows. In the next section a general construction of arational motion is presented. In Section 3, interpolation problem is stated and theequations are derived. Two particular cases, interpolation of six (eight) positionswith rational motions of degree six (eight), are considered in the following twosections. In Section 6, a method for constructing G1 continuous rational splinemotion of degree six is analysed. The paper is concluded with some numericalexamples and conclusions section, which summarizes the main results of the paperand identifies possible future investigations.

2

Page 3: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

2 Rational motions

Motion of the rigid body is described by a coordinate transformation between fixedand the moving coordinate system in three dimensional Euclidean space (see [5]).It consist of a translational and a rotational (spherical) part. A translational part isdescribed by a trajectory c = (c1, c2, c3)

> of the origin of the moving coordinatesystem with axes determined by columns of a rotation matrix R = R(t) ∈ R3×3

which defines a spherical part of the motion. The trajectory of an arbitrary point pon the rigid body is given as

p(t) = c(t) +R(t) p.

Rational spline motions are obtained by choosing rational spline functions for theelements of the matrixR and for the components of the trajectory c. The degree ofthe motion is the maximal degree of the functions involved.

A difficult part is to construct a spherical motion since the matrix R must lie ina special orthogonal group SO3. There is a bijective correspondence between thespace of rotations and the unit quaternion sphere S3 with identified antipodal points(see [5]). It is given by the kinematic mapping χ : H \ {0} → SO3,

Q = (q0, q1, q2, q3) 7→ χ(Q) := (1)

1

q20 + q21 + q22 + q23

q20 + q21 − q22 − q23 2(q1q2 − q0q3) 2(q1q3 + q0q2)

2(q1q2 + q0q3) q20 − q21 + q22 − q23 2(q2q3 − q0q1)

2(q1q3 − q0q2) 2(q2q3 + q0q1) q20 − q21 − q22 + q23

,

that maps any nonzero quaternion Q to a rotation matrix R = χ(Q). Note that allnonzero quaternions

λQ, λ ∈ R, λ 6= 0, (2)

lying on the same line passing through the origin, represent the same rotation. Thisequivalence relation defines a 3-dimensional projective space, described by homo-geneous quaternion coordinates. Spherical motions can thus be identified with twoantipodal curves on the unit quaternion sphere S3.

By applying the kinematic mapping to a polynomial (spline) curve q = (q0, q1, q2, q3)of degree n, one obtains a rational spherical motion of degree 2n. Rational func-tions ci should then be chosen as

ci =wir, with r = q20 + q21 + q22 + q23, i = 1, 2, 3, (3)

where w := (w1, w2, w3) is a polynomial (spline) curve of degree ≤ 2n.

3

Page 4: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

3 Geometric interpolation problem

Suppose that a sequence of N positions Posi, i = 0, 1, . . . , N − 1, of a rigid bodyis given. The task is to construct a rational motion of a low degree that interpolatesthese positions. The positions are described by center positions Ci and by unitquaternions Qi ∈ H that represent the rotations. Note that neighbouring quater-nions must belong to the same hemisphere, i.e.,

〈Qi,Qi+1〉 ≥ 0, i = 0, 1, . . . , N − 2, (4)

where 〈·, ·〉 is the standard inner product in R4. In standard interpolation approachesthe parameter values at which the positions are interpolated at must be prescribed inadvance, which leads to rational motions of degree 2(N − 1). But, in the geometricinterpolation the parameterization is used as an additional freedom, and as a resultthe degree of the motion is reduced.

The rotational part of the motion is determined from a quaternion curve q of degreen, which by (2) satisfies

q(ti) = λiQi, λi 6= 0, i = 0, 1, . . . , N − 1. (5)

To require the interpolation of positions Posi in a particular order, which is usuallya very important issue in practice, the parameters ti must be ordered as

0 = t0 < t1 < · · · < tN−2 < tN−1 = 1. (6)

Since quaternion curves can be written in the standard form (see [6]), we assumeλ0 = λN−1 = 1. Moreover, by (4), the parameters λi must all be positive for

〈q(ti), q(ti+1)〉 > 0, i = 0, 1, . . . , N − 2, (7)

to hold. System (5) is a nonlinear system of 4N equations for 4(n + 1) unknowncoefficients of q,N−2 unknown parameters (ti)

N−2i=1 andN−2 unknowns (λi)

N−2i=1 .

The numbers of equations and unknowns are equal iff

4N = 4(n+ 1) + 2(N − 2),

which implies n = dN/2e. The conjecture is that the quaternion curve q of degreen can geometrically interpolate 2n quaternion data. Moreover, 2n positions Posican be interpolated with rational motion of degree 2n in the geometric sense. Notethat in standard interpolation approaches, the degree of the motion would be 4n−2.

Suppose now that N = 2n. The existence and uniqueness of the solution of thesystem (5) is a difficult problem in general. The first step towards the solution is toseparate the linear part of the problem from the nonlinear one. More precisely, oncethe unknown parameters t := (ti)

2n−2i=1 and λ := (λi)

2n−2i=1 are determined, the co-

efficients of q can be computed using any standard interpolation scheme (Newton,

4

Page 5: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Lagrange, ...) componentwise. To obtain the equations for unknowns t and λ only,we apply the divided differences [t`, t`+1, . . . , t`+n+1], ` = 0, 1, . . . , n−2, that mapany polynomial of degree ≤ n to zero, to the system (5). This leads to 4(n − 1)nonlinear equations

0 = [t`, t`+1, . . . , t`+n+1] q =`+n+1∑i=`

1

ω`,n+1(ti)λiQi, ` = 0, 1, . . . , n− 2, (8)

for 4(n− 1) unknowns t and λ, where

ω`,k(t) :=`+k∏i=`

(t− ti), ω`,k(t) :=d

dtω`,k(t).

Further notation will be used later on. By

A[j1,j2,...,jk]

we will denote a matrix A with columns indexed by j1, j2, . . . , jk omitted. More-over let

An :=(Q0, Q1, . . . , Q2n−1

)∈ R4,2n.

Relations (6) and (7) imply the following definition.

Definition 1 The solution of the nonlinear system (8) is called admissible if it liesin

Dn := {(t,λ) : 0 = t0 < t1 < · · · < t2n−1 = 1, λi > 0, i = 0, 1, . . . , 2n− 1} .

The corresponding q is called the admissible interpolant.

Note that the restriction of the solution to the open set Dn makes the analysis evenmore complicated and usually requires some extra conditions to be satisfied.

The first case to be considered is the parabolic one. But, every parabolic quaternioncurve lies in a 2-dimensional subspace of H, and so should the data. In practice thiscondition is usually not fulfilled for 4 consecutive data. Thus, the first interestingcase is the cubic one, which leads to motions of degree 6. It is analysed in the nextsection where a closed form solution of the nonlinear system (8) is derived and theconditions for the solution to be admissible are stated.

4 Lagrange motion of degree six

In this section, a motion of degree six that interpolates six positions Posi of a rigidbody is derived. Interpolating parameters ti are determined from the rotational part

5

Page 6: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

of the motion. For the construction of the trajectory of the center three more degreesof freedom are left.

Consider first the rational part of the motion. Let us define constants

αj,i := detA[6−5j,i+1]3 , i = j, j + 1, . . . , j + 4, j = 0, 1,

that depend only on given quaternions. Note also that α0,0 = α1,5. By applyinglinear functionals

det(·, Qi1 ,Qi2 ,Qi3

), 1 ≤ i1 < i2 < i3 ≤ 4,

to (8), the system transforms to

(−1)i+j+1 λiωj,4(ti)

α0,0 +λ5j

ωj,4(t5j)αj,i = 0, i = 1, 2, 3, 4, j = 0, 1. (9)

Recall that λ0 = λ5 = 1. From (9) it is straightforward to eliminate unknowns(λi)

4i=1. We obtain four equations

ω0,4(t0)ω1,4(ti)

ω1,4(t5)ω0,4(ti)= −α0,i

α1,i

=: −αi, i = 1, 2, 3, 4,

for four unknowns (ti)4i=1, which further simplify to

4∏i=1

ti1− ti

= αiti

1− ti, i = 1, 2, 3, 4. (10)

It is easy to see that (10) has a unique real solution

ti =ui

1 + ui, ui :=

3√α1α2α3α4

αi, i = 1, 2, 3, 4. (11)

Once the parameters ti are determined, the solution for λi follows from (9):

λi =(−1)i

t0t1t2t3

α0,i

α0,0

4∏j=0j 6=i

(ti − tj), i = 1, 2, 3, 4. (12)

Let us summarize the results.

Theorem 1 LetQi ∈ H, i = 0, 1, . . . , 5, be a sequence of normalized quaternions,such that αj,i 6= 0, i = j, j+1, . . . , j+4, j = 0, 1. Then there exists a unique cubicinterpolating quaternion q, that satisfies

q(0) = Q0, q(1) = Q5, q(ti) = λiQi, i = 1, 2, 3, 4,

where ti and λi are determined by (11) and (12).

6

Page 7: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Remark 2 Geometrically, conditions αj,i 6= 0, i = 1, 2, 3, 4, j = 0, 1, are equiva-lent to

Q0,Q5 /∈ Πi1,i2,i3 ,

where Πi1,i2,i3 are hyperplanes, defined by

Πi1,i2,i3 := det(.,Qi1 ,Qi2 ,Qi3

)= 0, 1 ≤ i1 < i2 < i3 ≤ 4.

The obtained solution does not necessarily lie in D3. The conditions that imply thesolution to be admissible are stated in the next theorem.

Theorem 3 Suppose that the assumptions of Theorem 1 hold. Then the interpolat-ing quaternion q is admissible iff

α1 > α2 > α3 > α4 > 0 andα0,i

α0,0

> 0, i = 1, 2, 3, 4.

PROOF. The result follows directly from (11) and (12).

A kinematic mapping χ defined by (1) maps a quaternion curve q = (q0, q1, q2, q3)of degree ≤ 3 to a rotational matrix R = χ(q) with rational coefficients of degree≤ 6. The trajectory c of the center of the rigid body must satisfy

c(ti) = Ci, i = 0, 1, . . . , 5. (13)

Recall that c = 1rw, where r = q20 + q21 + q22 + q23 and the unknown polynomial

curve w must be of degree ≤ 6. Since w has 21 unknown coefficients and (13) isa linear system of only 18 equations, three more degrees of freedom are left for theconstruction of the translational part. If one chooses the degree ofw to be≤ 5 thenc is uniquely determined.

Example In the following example we are given a quaternion curve q

q(t) =(t, t+ cos

(πt

4

), sin

(πt

4

), cos

(πt

10

))>(14)

and a trajectory of the center

c(t) = (3 log(t+ 1) cos(t), 3 log(t+ 1) sin(t), 3(t+ 1))> . (15)

We sample the positions

Qi =q(ti)

‖q(ti)‖, Ci = c(ti),

where ti = ih, i = 0, 1, . . . , 5. Fig. 1(left) shows a rational motion of a cuboid in-

7

Page 8: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Fig. 1. Rational motion of degree six interpolating six positions (left) and the spherical partof this motion (right).

terpolating these positions. On the right hand side of Fig. 1 the spherical part of thismotion together with the trajectory Rp of a cuboid center p, which is a sphericalrational curve of degree 6 lying on the sphere centered at the origin with radius ‖p‖,is shown for h = 1. Six interpolation rotations of a cuboid (left) and interpolationpositions (right) are denoted by bold cuboids. In Table 1 the parametric distancesbetween trajectory of a point p of the original and the rational motion of degreesix for different values h are shown. The last column numerically indicates that theapproximation order is optimal, i.e. six.

h Parametric distance Decay exponent

1 0.909483 /12 0.0273524 5.0553114 0.0013242 4.3684518 0.0000412 5.00488116 9.7394880× 10−7 5.40413132 1.9224901× 10−8 5.6628164 3.4065213× 10−10 5.81853

Table 1The parametric distances between trajectory of the original and the rational motion fordifferent values h.

5 Lagrange motion of degree eight

In this section, the Lagrange interpolation problem for n = 4 is shortly considered.A nonlinear system (8) is now a system of 12 equations for unknown parameterst1, t2, . . . , t6 and unknown scalar values λ1, λ2, . . . , λ6. It turns out that the analy-sis of equations and numerical computation of the solutions becomes much more

8

Page 9: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

complicated than in the cubic case. The first step towards the simplification is toseparate unknown parameters ti from the unknown scalar values λi. Therefore theequations (8) are replaced by the equivalent ones given by

[t0, t3, t4, t5, t6, t7]q = 0, [t0, t1, t2, t5, t6, t7]q = 0, [t0, t1, t2, t3, t4, t7]q = 0.

By some computation, similar as in the case n = 3, we obtain the following equa-tions

λi˙ωj(t0)˙ωj(ti)

+ γj,i + δj,i˙ωj(t0)˙ωj(t7)

= 0, i ∈ {1, 2, . . . , 6} \ {2j − 1, 2j},

for j = 1, 2, 3, where

ωj(t) :=ω0,7(t)

(t− t2j−1)(t− t2j)and

γj,i = (−1)i+1det

(A

[2j−1,2j,i,7]4

)det

(A

[0,2j−1,2j,7]4

) , δj,i = (−1)idet

(A

[0,2j−1,2j,i]4

)det

(A

[0,2j−1,2j,7]4

)are the constants that depend only on the given data. After eliminating unknownsλi, which is easily done since every equation contains only one unknown λi, andreplacing

ti =ui

1 + ui, i = 0, 1, . . . , 7,

we end up with six equations

(u` − u5) (u` − u6)(u` − u3) (u` − u4)

(u1u2δ2,` −

γ2,`u5u6

)=(u1u2δ3,` −

γ3,`u3u4

), ` = 1, 2,

(u` − u1) (u` − u2)(u` − u5) (u` − u6)

(u3u4δ3,` −

γ3,`u1u2

)=(u3u4δ1,` −

γ1,`u5u6

), ` = 3, 4,

(u` − u3) (u` − u4)(u` − u1) (u` − u2)

(u5u6δ1,` −

γ1,`u3u4

)=(u5u6δ2,` −

γ2,`u1u2

), ` = 5, 6,

for six unknowns (ui)6i=1. Although we managed to reduce the nonlinear system to

only six equations, the problem is highly nonlinear and difficult to handle even nu-merically. Direct methods like Groebner basis are in this case computationally tooexpensive. Solutions can be computed by iterative methods only, but the equationsare quite sensitive and require very good starting values. Clearly, more than oneadmissible solution can exist.

As an example let us sample the positionsQi from a quaternion curve (14) at valuesi2, i = 0, 1, . . . , 7. Two solutions of a nonlinear system are found numerically that

yield quite similar motions. Namely, the unknown parameter values ti are equal to

(ti)6i=1 = {0.239946, 0.428939, 0.579601, 0.704642, 0.812773, 0.909874}

9

Page 10: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

in the first solution and to

(ti)6i=1 = {0.254982, 0.431498, 0.571357, 0.690916, 0.798808, 0.90052}

in the second. Corresponding rational spherical motions of degree 8 that interpolate8 positions are shown in Fig. 2. The difference between both motions is almostindistinguishable.

Fig. 2. Two rational spherical motions of degree 8 that interpolate 8 positions.

This short analysis of the case n = 4 shows that Lagrange interpolation schemesfor higher degrees seem out of reach for today’s computer power at will. Thereforethe usual approach for interpolating a large number of data is to use splines com-posed of low degree polynomial/rational segments. Construction of a rational G1

continuous spline motion of degree six is considered in the next section.

6 G1 continuous spline motion of degree six

When the number of interpolation data is very large, a general approach is to con-struct an interpolating spline, composed of polynomial (rational) segments of alow degree. If the presented Lagrange interpolation scheme is used for construc-tion of spline segments, then the spline motion is only C0 continuous. To obtaina G1 continuous spline motion that can be constructed locally, tangent directionsand velocity quaternions should additionally be interpolated at breakpoints. For thispurpose, the Lagrange interpolation problem from Section 3 must slightly be mod-ified. Namely, interpolation of two center positions and two quaternions is replacedwith interpolation of two tangent directions and two velocity quaternions.

Unfortunately, in the geometric interpolation, the solution can not simply be ob-tained by computing the limit of the solution of the Lagrange interpolation prob-lem (see [7], [8], e.g.). By replacing points with tangent information, the type ofthe unknowns changes. Some of the properties of the nonlinear system can be in-

10

Page 11: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

herited, but not all. In particular, the positivity requirements have to be consideredseparately.

The interpolation problem is stated as follows. For a given sequence of N = 3m+1 � 6 positions Posi ∼ (Ci,Qi), i = 0, 1, . . . , N − 1, together with prescribedtangent vectors t3`−3, t3` and velocity quaternionsU 3`−3,U 3`, ` = 1, 2, . . . ,m, thetask is to construct a G1 continuous rational spline motion of degree 6, composedof m segments that interpolate these data in the geometric sense. Spherical part ofthe motion is defined by a cubic spline curve qS : [0, N − 1] → H with integerknots, composed of polynomial segments

q`(t`)

:= qS(u)∣∣∣[`−1,`]

, t` := u− `+ 1 ∈ [0, 1], ` = 1, 2, . . . ,m.

Similarly,

cS : [0, N − 1]→ R3, c`(t`)

:= cS(u)∣∣∣[`−1,`]

is a rational spline representing the translational part.

A motion is G1 continuous if a trajectory of every point is a G1 continuous curve,i.e. there exists a reparameterization, such that a reparameterized trajectory is C1

continuous. The conditions that determine G1 continuous motions are derived in[4]. Therefrom the equations for the rotational part of the motion follow as

q`(t`i)

= λ`iQ3`−3+i, i = 0, 1, 2, 3,

q`(0) = µ`0Q3`−3 + λ`0ϕ`0U 3`−3,

q`(1) = µ`1Q3` + λ`3ϕ`1U 3`,

` = 1, 2, . . . ,m, (16)

where we again assume that λ`0 = λ`3 = 1 and t`0 = 0, t`3 = 1. As in (5), the un-knowns at every segment ` are the coefficients of a quaternion curve q`, parameterst`1, t

`2 and scalar coefficients λ`1, λ

`2. Additionally, we have four new unknowns µ`0,

µ`1, ϕ`0 and ϕ`1. As explained in [4], the first two correspond to derivatives of some

nonzero scalar function and the last two are the derivatives of the reparameteriza-tion function at t` = 0 and t` = 1. The number of unknowns is 24m and it is equalto the number of equations.

Definition 2 The solution of the nonlinear system (16) is admissible if the param-eters t`i are ordered as

0 < t`1 < t`2 < 1, ` = 1, 2, . . . ,m, (17)

and the other unknowns satisfy

λ`1 > 0, λ`2 > 0, ϕ`0 > 0, ϕ`1 > 0, ` = 1, 2, . . . ,m. (18)

11

Page 12: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Let us select the given data into the matrices

B` :=(U 3`−3, Q3`−3, Q3`−2, Q3`−1, Q3`, U 3`

)∈ R4,6, ` = 1, 2, . . . ,m,

and letβ`j,i := detB

[6−5j,i+1]` , i = j, j + 1, . . . , j + 4, j = 0, 1.

Note that β`0,0 = β`1,5 and assume that this determinants are nonzero. Since theproblem is completely local, it is enough to consider only the case ` = 1. In orderto simplify the notation, we will skip the superscript ` = 1 in all unknowns.

In the first step we eliminate in (16) (for ` = 1) the equations for coefficients ofq := q1 from the ones which involve the rest of the unknowns. Therefore we applyparticular divided differences,

[t0, t1, t2, t3] ([t0, .]q) =3∑i=0

[t0, ti]q

ω(ti)= 0,

(19)

[t0, t1, t2, t3] ([t3, .]q) =3∑i=0

[t3, ti]q

ω(ti)= 0,

where ω(t) := ω0,3(t). More precisely, equations (19) are of the form

3∑i=1

λiti ω(ti)

Qi +

(µ0

ω(0)−

3∑i=1

λ0ti ω(ti)

)Q0 +

λ0 ϕ0

ω(0)U 0 = 0,

(20)2∑i=0

λi(ti − 1)ω(ti)

Qi +

(µ1

ω(1)−

2∑i=0

λ3(ti − 1)ω(ti)

)Q3 +

λ3 ϕ1

ω(1)U 3 = 0.

Recall that λ0 = λ3 = 1. By applying linear functionals

det(·, Qi1 ,Qi2 ,Qi3

), 0 ≤ i1 < i2 < i3 ≤ 3,

to (20), the system transforms to

ϕjω(j)

βj,i−j+1 +(−1)iλi−j

t1−ji (ti−j − 1)j ω(ti−j)β0,0 = 0, i = 1, 2, 3, (21)

ϕjω(j)

βj,3j+1 +

µjω(j)

−3−j∑`=1−j

1

t1−j` (t` − 1)j ω(t`)

β0,0 = 0, (22)

for j = 0, 1, where βj,i := β1j,i . From (21) it is straightforward to express ϕj in

terms of t1 and t2,

ϕj = (−1)j+1 β0,0βj,4−3j

(t1t2

(1− t1)(1− t2)

)1−2j

, j = 0, 1. (23)

12

Page 13: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Further, from (22) one obtains

µj = (−1)j

3−j∑`=1−j

ω(j)

t1−j` (1− t`)j ω(t`)+βj,3j+1

βj,4−3j

(t1t2

(1− t1)(1− t2)

)1−2j ,

(24)for j = 0, 1, and from (21) it follows

λj =β0,j+1

β0,4

(t2 − t1)t2j(1− t3−j)

, j = 1, 2. (25)

By slightly modifying and dividing particular equations in (21) and applying (23),we obtain

β1,1β0,4

βj+1tj

1− tj=

(1− t1)(1− t2)t1t2

, j = 1, 2, (26)

where βj := β0,jβ1,j

. The system (26) has precisely one real solution

tj =uj

1 + uj, uj := 3

√√√√β0,4β1,1

3√β2β3βj+1

, j = 1, 2. (27)

Since the construction was completely local, let us summarize the results for thewhole spline qS .

Theorem 4 Let Q3`−3+i ∈ H, i = 0, 1, 2, 3, be a sequence of normalized quater-nions, and let U 3`−3 and U 3` be given velocity quaternions at every segment ` =1, 2, . . . ,m, such that β`j,i 6= 0, i = 0, 1, 2, 3, j = 0, 1. Then there exists a uniquecubic interpolating quaternion spline qS , satisfying (16) with λ`0 = λ`3 = 1, whereϕ`j , µ

`j , λ

`j+1 and t`j+1, j = 0, 1, are determined by (23), (24), (25) and (27), where

the superscript ` in all unknowns is omitted.

The obtained solution is not admissible if some of the relations in (17) and (18) arenot fulfilled.

Theorem 5 Suppose that the assumptions of Theorem 4 hold. Then the interpolat-ing quaternion spline qS is admissible iff

β`2 < β`3 < 0,β`0,j+2

β`0,4> 0,

(−1)jβ`0,0β`j,4−3j

< 0, j = 0, 1, ` = 1, 2, . . . ,m.

PROOF. The result follows directly from (23), (25), (27) and the fact that the lasttwo conditions imply β`0,4/β

`1,1 < 0.

Let us now construct the trajectory of the origin cS . By (3), polynomials (w`)i,i = 1, 2, 3, of degree at most 6, have to be determined. As in the Lagrange case,

13

Page 14: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

these polynomials are not uniquely determined and we will restrict the degrees to5. Therefore the polynomials (w`)i are uniquely defined by the conditions

w`(t`i) = r`(t

`i)C3`−3+i, i = 0, 1, 2, 3,

` = 1, 2, . . . ,m,w`(t

`3i) = ϕ`i r`(t

`3i) t3(`+i−1) + r`(t

`3i)C3(`+i−1), i = 0, 1,

where r` =∑3i=0(q`)

2i and ϕ`0, ϕ

`1, t

`i , i = 0, 1, 2, 3, are the parameters which have

already been determined in the spherical part of the motion. Polynomials w` canthus be computed by the standard Newton interpolation scheme componentwise,e.g.

Let us conclude the section by an example.

Example We sample the positions from a smooth motion given by the quaternioncurve q and trajectory c defined in (14) and (15). The interpolation conditions form spline segments are

Qi =q(ti)

‖q(ti)‖, U 3`−3 =

d

dt

(q

‖q‖

)(t3`−3), Ci = c(ti), t3`−3 = ˙c(t3`−3).

where ti = ih, i = 0, 1, . . . , 3m, and ` = 1, 2, . . . ,m+ 1.

Fig. 3 (left) shows the G1 spline motion of a cuboid with h = 1 and m = 3, whilein Fig. 3 (right) the spherical part of the motion together with the trajectory Rpof a cuboid center p is presented. The interpolation positions are denoted by boldcuboids.

Fig. 3. Ten positions of a cuboid interpolated by the spatial G1 continuous spline motion(left) and ten rotations of a cuboid interpolated by the spherical part of the motion (right).

14

Page 15: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

7 Examples

In this section, two more numerical examples are presented. In the first one theLagrange interpolation scheme, discussed in Section 4, is applied to interpolatelarger number of data, i.e., more than 6 positions. The data are sampled from thequaternion curve

q(t) =(√

t+ 1, cos(πt

5

), sin

(πt

5

), t)>

and are determined by

Qi =q(ti)

‖q(ti)‖,

where ti = ih, i = 0, 1, . . . , k, k � 5. The spatial motion which interpolatesthese k + 1 rotation data is constructed by using the following 6-point nonlinearinterpolatory subdivision scheme

Qk+12i = Qk

i ,i ∈ Z,

Qk+12i+1 = qki

(tki,2 + tki,3

2

),

where the initial quaternions are defined by Q0i := Qi and qki is a cubic Lagrange

interpolating quaternion, defined in Section 4, which satisfies

qki (tki,j−i+2) = λki,j−i+2Q

kj , j = i− 2, i− 1, . . . , i+ 3.

Fig. 4 shows the interpolating positions of the cuboid center, its positions after one,two and six steps of our subdivision scheme. In Fig. 5, the spherical motion of acuboid which corresponds to six steps of the subdivision scheme is shown.

As a second example, let us construct a G1 continuous spherical spline motion,where the input data are only the unit quaternions

Qi =q(i)

‖q(i)‖, i = 0, 1, . . . , 9, (28)

with q defined in (14). In Fig. 6 (left) velocity quaternions U 3i−3, i = 1, 2, 3, 4,are estimated using local normalized quartic polynomials through five consecutivequaternions. Furthermore, in Fig. 6 (right) comparison with the standard C1 mo-tion based on quintic quaternion curves interpolating the same data, constructedusing standard Hermite interpolation techniques, is shown. Both motions are quitesimilar, but of course the degree of the geometrically continuous motion is muchsmaller.

15

Page 16: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Fig. 4. Eleven initial positions of the cuboid center and its positions after one, two and sixsteps of the subdivision scheme.

Fig. 5. The spherical motion of a cuboid which interpolates eleven rotation data and corre-sponds to six steps of the subdivision scheme.

8 Conclusion

In this paper geometric approach has been used to interpolate given sequence ofrigid body positions (center positions and rotations) with a rational motion of thelowest possible degree. In comparison to the classical approaches, the degree of amotion has been reduced from 4n − 2 to 2n, when 2n positions are interpolated.The first nontrivial case, interpolation of six positions in a prescribed order by amotion of degree six, has been studied in detail. Under some natural restrictions,

16

Page 17: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

Fig. 6. Comparison between spherical parts of a G1 motion interpolating ten given rotations(28) with the velocity quaternions estimated by using local normalized quartic polynomials(left) and a standard C1 motion interpolating the same data (right).

such a motion exists and it is unique. Moreover it is given in a closed form. On theother hand, interpolation of eight positions by motions of degree eight is a highlynonlinear problem, which is difficult to solve even numerically. One can find ex-amples where more than one admissible solutions exist. Thus the usual approach tointerpolate a large number of data using splines composed of low degree segmentshas been considered and a construction of rational G1 continuous spline motions ofdegree six has been analysed. Many interesting examples have been given to illus-trate practical importance and advantages of the presented methods. To uniquelyconstruct the translational part of a motion the degree of the numerator has beenreduced for one. Instead, we could use the remaining free parameters and try tominimize some particular quantities of a motion. This is perhaps an issue whichwould be worth to consider in the future.

References

[1] G. Jaklic, J. Kozak, M. Krajnc, E. Zagar, On geometric interpolation by planarparametric polynomial curves, Math. Comp. 76 (260) (2007) 1981–1993.

[2] H.-P. Schrocker, B. Juttler, Motion interpolation with Bennett biarcs, in:A. Kecskemethy, A. Muller (Eds.), Proc. Computational Kinematics, Springer, 2009,pp. 141–148.

[3] B. Juttler, M. Krajnc, E. Zagar, Geometric interpolation by quartic rational splinemotions, in: Advances in Robot Kinematics: Motion in Man and Machine, Springer,New York, 2010, pp. 377–384.

[4] G. Jaklic, B. Juttler, M. Krajnc, V. Vitrih, E. Zagar, Hermite interpolation by rationalGk motions of low degree, to appear in J. Comput. Appl. Math.

17

Page 18: Construction of low degree rational Lagrange motionsosebje.famnit.upr.si/~vito.vitrih/papers/LagrangeMotion.pdf · positions by rational motion of degree 2n is presented and two particular

[5] O. Bottema, B. Roth, Theoretical kinematics, Dover Publications Inc., New York, 1990.

[6] G. Farin, Curves and surfaces for computer-aided geometric design, 4th Edition,Computer Science and Scientific Computing, Academic Press Inc., San Diego, CA,1997.

[7] J. Kozak, M. Krajnc, Geometric interpolation by planar cubic G1 splines, BIT 47 (3)(2007) 547–563.

[8] M. Krajnc, Geometric Hermite interpolation by cubic G1 splines, Nonlinear Anal.70 (7) (2009) 2614–2626.

18