Graphics Reference
In-Depth Information
3.5
3
2.5
2
1.5
1
0.5
0
0
5 10 15 20 25 30 35 40 45
Degrees
50 55 60 65 70 75 80 85 90
Fig. 8.5.
Interpolating between 1 and 3 using a trigonometric interpolant.
3.5
3
2.5
2
1.5
1
0.5
0
0
1
2
3
4
5
x
Fig. 8.6.
Interpolating between two points (1, 1) and (4, 3). Note the non-linear
distribution of points.
non-linear, as shown in Figure 8.6. In other words, equal steps in
t
give rise
to unequal distances.
The main problem with this approach is that it is impossible to change
the nature of the curve -it is a
sinusoid
, and its slope is determined by the
interpolated values. One way of gaining control over the interpolated curve is
to use a
polynomial
, which is the subject of the next section.
8.2.2 Cubic Interpolation
To begin with, let's develop a cubic blending function that will be similar
to the previous sinusoidal one. This can then be extended to provide extra
flexibility. A
cubic polynomial
will form the basis of the interpolant
V
1
=
at
3
+
bt
2
+
ct
+
d
(8.9)
and the final interpolant will be of the form
n
1
n
2
n
=[
V
1
V
2
]
ยท
(8.10)