Game Development Reference
In-Depth Information
Section 2.4 discusses the often confusing relationship between points
and vectors and considers the rather philosophical question of why it
is so di cult to make absolute measurements.
Sections 2.5 -2.12 discuss the fundamental calculations we can perform
with vectors, considering both the algebra and geometric interpreta-
tions of each operation.
Section 2.13 presents a list of helpful vector algebra laws.
2.1
Mathematical Definition of Vector,
and Other Boring Stuff
To mathematicians, a vector is a list of numbers. Programmers will rec-
ognize the synonymous term array. Notice that the STL template array
class in C++ is named vector , and the basic Java array container class is
java.util.Vector . So mathematically, a vector is nothing more than an
array of numbers.
Yawn. . . If this abstract definition of a vector doesn't inspire you, don't
worry. Like many mathematical subjects, we must first introduce some
terminology and notation before we can get to the “fun stuff.”
Mathematicians distinguish between vector and scalar (pronounced
“SKAY-lur”) quantities. You're already an expert on scalars—scalar is
the technical term for an ordinary number. We use this term specifically
when we wish to emphasize that a particular quantity is not a vector quan-
tity. For example, as we will discuss shortly, “velocity” and “displacement”
are vector quantities, whereas “speed” and “distance” are scalar quantities.
The dimension of a vector tells how many numbers the vector contains.
Vectors may be of any positive dimension, including one. In fact, a scalar
can be considered a 1D vector. In this topic, we primarily are interested in
2D, 3D, and (later) 4D vectors.
When writing a vector, mathematicians list the numbers surrounded
by square brackets, for example, [1,2,3]. When we write a vector inline
in a paragraph, we usually put commas between the numbers. When we
write it out in an equation, the commas are often omitted. In either case, a
vector written horizontally is called a row vector. Vectors are also frequently
written vertically:
2
3
1
2
3
4
5
.
A 3D column vector
A vector written vertically is known as a column vector. This topic
uses both notations. For now, the distinction between row and column
 
Search WWH ::




Custom Search