Game Development Reference
In-Depth Information
6
2
n
k
For example,
= 15. We read
as “n choose k,” because the value
n
k
also happens to be the number of subsets of k objects that can be
chosen from a set of n objects, disregarding the order.
Now let's look at the general formula for computing binomial coe -
cients. (We emphasize that this formula is primarily for entertainment
purposes, since our use of binomial coe cients in this chapter on curves
will be restricted to the first few lines of Pascal's triangle.) Remember
from Section 11.4.6 the factorial operator, denoted n!, which is the prod-
uct of all the whole numbers up to and including n:
of
n
Factorial operator
n! =
i = 1 × 2 × 3 × × n.
i=1
Using factorials, and defining 0! ≡ 1, we compute a binomial coe cient as
n
k
n!
k!(n − k)! .
=
Binomial coe cient
Binomial coe cients arise frequently in applications dealing with com-
binations and permutations, such as probability and analysis of algorithms.
Because of their importance, and the amazingly large number of patterns
that can be found in them, they have been the subject of quite a large
amount of study. A very thorough discussion of binomial coe cients, es-
pecially regarding their use in computer algorithms, is presented by Knuth
[39].
Back to curves. We've analyzed the pattern of the barycentric weights.
Now let's rewrite a Bezier curve, replacing each control point weight with
a function B i (t), and using the cubic curve formula (Equation (13.26)) as
our example:
b 0 (t) = (1 − t) 3 b 0 + 3t(1 − t) 2 b 1 + 3t 2 (1 − t) b 2 + t 3 b 3
= [B 0 (t)] b 0 + [B 1 (t)] b 1 + [B 2 (t)] b 2 + [B 3 (t)] b 3 .
More generally, we can write a Bezier curve of degree n (having n+1 control
points) as
n
Bezier curve of arbitrary
degree
b 0 (t) =
[B i (t)] b i .
i=0
Search WWH ::




Custom Search