Graphics Reference
In-Depth Information
Chapter 9
In mathematics, functions are often described by an algebraic expression, like
f
(
x
)=
x
2
+
1. Sometimes, on the other hand, they're
tabulated,
that is, the values
for each possible argument are listed, as in
f
:
{
1, 2, 3
}→{
0, 9
}
;
(9.1)
f
(
1
)=
f
(
2
)=
0
;
f
(
3
)=
9.
(9.2)
A third, and very common, way to describe a function is to give its values
at particular points and tell how to
interpolate
between these known values. For
instance, we might plot the temperature at noon and midnight of each day of a
week; such a plot consists of 15 distinct dots (see Figure 9.1). But we could also
make a guess about the temperatures at times between each of these, saying, for
instance, that if it was 60
◦
at noon and 24
◦
at midnight, that drop of 36
◦
took place
at a steady rate of 3
◦
per hour. In other words, we would be
linearly interpolating
to define the function for
all
times rather than just at noon and midnight each day.
The resultant function, defined on the whole week rather than just the 15 special
times, is a connect-the-dots version of the original.
Let's now write that out in equations. Suppose that
t
0
<
t
1
<
t
2
< ... <
t
n
are the times at which the temperature is known, and that
f
0
,
f
1
,
...
,
f
n
are the
temperatures in degrees Fahrenheit at those times.
Then
f
:[
t
0
,
t
n
]
→
R
:
t
→
(
1
−
s
)
f
i
+
sf
i
+
1
(9.3)
where
t
i
≤
t
≤
t
i
+
1
and
(9.4)
t
i
t
i
+
1
−
t
−
s
=
t
i
.
(9.5)
201