Graphics Reference
In-Depth Information
or
−
n
1
n
2
11
10
n
=[
t
1]
·
·
(8.7)
The reader can confirm that this generates identical results to the algebraic
form.
8.2 Non-Linear Interpolation
A linear interpolant ensures that equal steps in the parameter
t
give rise
to equal steps in the interpolated values; however, it is often required that
equal steps in
t
give rise to unequal steps in the interpolated values. We
can achieve this using a variety of mathematical techniques. For example, we
could use trigonometric functions or polynomials. To begin with, let's look at
a trigonometric solution.
8.2.1 Trigonometric Interpolation
In Chapter 4 we noted that sin
2
(
β
)+cos
2
(
β
) = 1, which satisfies one of the
requirements of an interpolant: the terms must sum to 1. If
β
varies between
0and
π/
2
,
cos
2
(
β
) varies between 1 and 0, and sin
2
(
β
) varies between 0 and 1,
which can be used to modify the two interpolated values
n
1
and
n
2
as follows:
n
=
n
1
cos
2
(
t
)+
n
2
sin
2
(
t
)
(8.8)
for 0
π/
2
The interpolation curves are shown in Figure 8.4.
If we make
n
1
=1and
n
2
= 3 in (8.8), we obtain the curves shown in
Figure 8.5. If we apply this interpolant to two 2D points in space, (1, 1) and
(4, 3), we obtain a straight-line interpolation, but the distribution of points is
≤
t
≤
1.2
1
0.8
0.6
0.4
0.2
0
0
5 10 15 20 25 30 35 40 45
Angle
50 55 60 65 70 75 80 85 90
Fig. 8.4.
The curves for cos
2
(
β
)andsin
2
(
β
).