Curves Trajectories Anglais4(1)
Curves Trajectories Anglais4(1)
Curves Trajectories Anglais4(1)
Curves-Interpolation
Saïd MAMMAR
October 2023
P (x ) = a0 + a1 x + a2 x 2 + ... + an x n (1)
verifying P (xi ) = yi
Preuve:Let’s suppose that there exist two polynomials, P (x ) and Q (x ),
satisfying this property. Then the polynomial with a degree at most equal
to n
R (x ) = P (x ) Q (x ) (2)
It vanishes at (n + 1) distinct points xi . However, the polynomial R (x ),
being of degree at most n, cannot have more than n distinct roots. We
can therefore conclude that R (x ) is zero, and thus, P (x ) = Q (x ).
Suppose we are given two points (x0 , y0 ) and (x1 , y1 ). The polynomial
interpolation of these two points is a polynomial of degree 1, which
corresponds to the line passing through these two points. This polynomial
is given by:
P (x ) = y0 + g (x )(y1 y0 ) (3)
with
x x0 0 si x = x0
g (x ) = = (4)
x x1 1 si x = x1
What is the polynomial in the general case where we have (n + 1) points
(n > 1)?
1 si i = j
li (xj ) = δij =
0 si i 6= j
x0 = 0, x1 = 1, x2 = 2
1 2 3 1 2 1
l0 = x x + 1, l1 = x 2 + 2x, l2 = x x
2 2 2 2
(n )
The coe¢ cients λi can be calculated recursively using the following
formula
(n +1 ) (n )
λi = λi /(xi xj ) (i = 0, 1, ..., n) (14)
Furthermore, we can demonstrate the following equality:
n
∑ λi
(n )
=0 (15)
i =0
The coe¢ cients ai of the polynomial Pn (x ) can then be derived from the
(n )
coe¢ cients λi .
2
Pn (x0 ) = c0 = y0
6 Pn (x1 ) = c0 + c1 (x1 x0 )) = y1
6
4 ....
Pn (xn ) = c0 + c1 (xn x0 ) + c2 (xn x0 )(xn x1 ) + ... + cn (xn x0 )...(xn
c0 = y0 (18)
y1 c0
c1 = (19)
x1 x0
y2 y0 c1 (x2 x0 )
c2 = (20)
(x2 x0 )(x2 x1 )
y2 y0 y1 y0
= (21)
(x2 x0 )(x2 x1 ) (x1 x0 )(x2 x1 )
(y2 y0 )(x1 x0 ) (y1 y0 )(x2 x0 )
= (22)
(x2 x0 )(x2 x1 )(x1 x0 )
y1 y0 y2 y1
x1 x0 x2 x1
= (23)
(x2 x0 )
x0 f (x0 )
f [x0 , x1 ]
x1 f (x1 ) f [x0 , x1 , x2 ]
f [x1 , x2 ] f [x0 , x1 , x2 , x3 ]
x2 f (x2 ) f [x1 , x2 , x3 ] : :
f [x2 , x3 ] : : : :
x3 f (x3 ) : : : : :
: : : : : :
: : : : f [xn 3 xn 2 , xn 1 , xn ]
xn 1 f (xn 1 ) : f [xn 2 , xn 1 , xn ]
f [xn 1 , xn ]
xn f (xn )
avec
where
a min(x0 , x ) < ξ < max(x, xn ) b (32)
Preuve: Note developed here
x0 = a x1 = b (33)
then
x b x a
P (x ) = f (a ). + f (b ). (34)
a b b a
leads to
(x
a)(x b ) 00
f (x ) P (x ) = f (ξ ) (35)
2
Therefore, it is necessary to …nd an upper bound for jf 00 (ξ )j
x0 = 5, x1 = 3, x2 = 1, x3 = 0, x4 = 1, x5 = 3, x6 = 5
The dashed line polynomial is obtained with the point distribution given by
the formula 38 for a = 5, b = 5 et n = 6. The point distribution is
shown in the …gure 7
x00 = 5, x10 = 4.3301, x20 = 2.5, x30 = 0, x40 = 2.5, x50 = 4.3301, x60 = 5
De…nition
When the polynomials Si (x ) are of degree 1, it’s referred to as linear spline
interpolation. When they are of degree 2, it’s called quadratic spline
interpolation. If they are of degree 3, it’s referred to as cubic spline
interpolation.
S (xi ) = yi (41)
Si (xi ) = yi (42)
yi = ai xi + bi (43)
(n 1) equations of continuity for the spline (i = 0, 1, ..., n 2)
ai xi +1 + bi = yi +1 (45)
We can thus uniquely deduce
yi +1 yi
ai = , (i = 0, 1, ..., n 1) (46)
xi +1 xi
bi = yi ai xi , (i = 0, 1, ..., n 1) (47)
It is de…ned on ] ∞, +∞[
It is continious on ] ∞, +∞[
Its derivative is continious on ] ∞, +∞[, and
* f 0 (0 ) = f 0 (0+ ) = 0
* f 0 (1 ) = f 0 (1+ ) = 2
Si (xi ) = yi (49)
yi = ai xi2 + bi x + ci (50)
(n 1) equations of spline continuity
Si ( x ) = ai ( x xi )2 + bi (x xi ) + ci (53)
From the interpolation conditions, it is clear that, in this form, the ci are
uniquely determined
Remark
On peut donner n’importe quelle valeur à z0 , mais généralement on choisit
z0 = 0. Notons qu’au lieu de …xer z0 , on aurait pu …xer zn et faire une
récurrence descendante.
S. MAMMAR (Institute) Curves 10/23 32 / 66
Figures 7 and 7 show the results obtained for the Runge function at points
[ 5, 3, 1, 1, 3, 5] and[ 5, 3, 0, 1, 1, 3, 5], respectively. It can be
observed that adding the point 0 improves the results around 0 but
degrades the results in the interval [2, 5]. Indeed, there are signi…cant
amplitude oscillations.
Si ( x ) = ai ( x xi )3 + bi (x xi )2 + ci (x xi ) + di (62)
di = yi (65)
It should be noted that in this case, the oscillations are greatly reduced
compared to polynomial interpolation.
Remark
Quand on choisit
S. MAMMAR (Institute) y000 =Curves
yn00 = 0 10/23 (68)
37 / 66
Theorem (Optimality of the natural cubic spline)
Given f a C 2 function of the interval [a, b ] , and (n + 1) points
a = x0 , x1 , ..., xn = b (69)
with
f (a) = y0 , y1 , ..., yn = f (b ) (70)
then the natural cubic spline S (x ) interpolating the function f at points
(xi , yi ) veri…es
Z b Z b
00 2 2
S (x ) dx f 00 (x ) dx (71)
a a
x (s ) = s 3 xf (s 1)3 xi + αx s 2 (s 1) + βx s (s 1)2
y (s ) = s 3 yf (s 1)3 yi + αy s 2 (s 1) + βy s (s 1)2 (72)
z (s ) = s 3 zf (s 1)3 zi + αz s 2 (s 1) + βz s (s 1)2
Geometric inputs that drive the aircraft along the Cartesian path
S. MAMMAR (Institute) Curves 10/23 41 / 66
Cartesian polynomials III
κ (s ) = 4ζs
` `
κ 2 = κ 2 χ(s ) = 2ζs 2
`
=χ ` ζ Rs
χ 2 2 = 2 ) x (s ) = sin(2ζu 2 )du (76)
R
0.5 0
D (ζ ) = 2 sin(2ζu 2 )du Rs
0 y (s ) = cos(2ζu 2 )du
0
1 1
for 2 s 2.
R
0.5
3
D (ζ ) = 2 cos ζu 2 2u 2 du
0
d
`= D (ζ )
6ζ `2
κ (s ) = `3 4 s2
χ (s ) 6ζ
= `3 `2 s3 (77)
4 3
Rs
x (s ) = cos(χ(u ))du
0
Rs
y (s ) = sin(χ(u ))du
0
(x xi )(y yf ) = (x xf )(y yi )
xi + xf + c (yi + yf ) yi + yf + c (xi + xf )
Pc = ,
2 2
χi + χf 1
where c = tan 2
ẋ 2 (t ) + ẏ 2 (t ) = σ2 (t ) (78)
Zt2 Zt2 q
s= kṙ (t )k dt = ẋ 2 (t ) + ẏ 2 (t )dt
t1 t1
ẋ (t ) = w (t ) u 2 (t ) v 2 (t )
Hodograph of the curve r (t ) : or
ẏ (t ) = 2w (t )u (t )v (t )
p
ẋ 2 (t ) + ẏ 2 (t ) = σ(t ) = w (t ) u 2 (t ) + v 2 (t ) , u (t ), v (t ), w (t ) and
σ(t ) are non zero real polynomials, satisfying gcd (u (t ), v (t )) = 1
Zt2
s= σ(t )dt (79)
t1
(u 2 v 2 ,2uv ) (2uv ,v 2 u2 )
T = u 2 +v 2
N= u 2 +v 2
2 (u v̇ v u̇ ) (80)
κ= (u 2 +v 2 )
r0 (t ) = r (t ) dN (t )
ẋ (t ) = u 2 (t ) + v 2 (t ) p 2 (t ) q 2 (t )
ẏ (t ) = 2 (u (t )q (t ) + v (t )p (t ))
(81)
ż (t ) = 2 (v (t )q (t ) u (t )p (t ))
σ (t ) = u 2 (t ) + v 2 (t ) + p 2 (t ) + q 2 (t )
and
n n!
= (85)
k k!(n k )!
r0 σr 00 σ0 r 0 r0 r 00
T = N= B= (86)
σ σω σω
ω (r 0 r 00 ) .r 000
κ= τ= (87)
σ2 σ2 ω 2
Hence, the Pythagorean Hodograph curves may be regarded as
the complete set of polynomial curves that have rational Frenet
frame.
The four control points of the Bezier polygon are calculated by …rst
order Hermite interpolation
b0 = (xi , yi , zi )
b5 = (xf , yf , zf )
(88)
b1 = b0 + 51 (cos χi cos γi , sin χi cos γi , sin γi , )
b4 = b5 51 (cos χf cos γf , sin χf cos γf , sin γf , )
u (t ) = u0 (1 t )2 + 2u1 (1 t ) + u2 t 2
v (t ) = v0 (1 t )2 + 2v1 (1 t ) + v2 t 2
(89)
p (t ) = p0 (1 t )2 + 2p1 (1 t ) + p2 t 2
q (t ) = q0 (1 t )2 + 2q1 (1 t ) + q2 t 2
Pythagorean hodograph
V0 V1
Ṽ0 = Ṽ1 = (90)
P1 P0 P1 P0
Pythagorean hodograph
where
w ( τ ) = w0 ( 1 τ )2 + 2w1 τ (1 τ ) + w2 τ 2 (99)
is the so-called pre-image.
Si ,k (t ) = ai ,k + bi ,k (τ τ k ) + ci ,k (τ τ k )2 + di ,k (τ τ k )3 (101)
Q (s ) = (1 s )2 P0 + 2s (1 s )P1 + s 2 P2 0 s 1 (102)
Hi (R ) = ai R 3 + bi R 2 + ci R + di (103)
dHi 1 (R ) dHi (R )
jR i = jR i (105)
dR dR
d 2 Hi 1 ( R ) d 2 Hi ( R )
j R = jR i (106)
dR 2 i
dR 2
Boundary conditions of the …rst and last splines
H0 (0) = h0
(107)
HN 1 (RN ) = hN
dH0 (R )
j R 1 = S1 (108)
dR
dHN 1 (R )
j R N 1 = SN 1 (109)
dR
4N constraints exist to compute the N splines; the splines having 4
coe¢ cients each. The optimization problem is to minimize
Z RF
J= e 2 dR (110)
0
Ah̄ = a
(112)
B h̄ b
S. MAMMAR (Institute) Curves 10/23 65 / 66
β Splines VII