JMU
Vector Mathematics in 2D
An Introduction to 2D Vectors


Prof. David Bernstein
James Madison University

Computer Science Department
bernstdh@jmu.edu


Some Notation
Members of \(\mathbb{R}^{2}\)
Two Things to be Aware Of
Visualization of Points

Points

point2d
Multiplication by a Scalar
Addition
Subtraction
Subtraction (cont.)
Visualization of Points and Directions Revisited
vector2d

We will use the different visualization techniques in different situations. So, you will have to be very careful.

Visualization of Addition Revisited
An Example of the Visualization of Points and Directions
The Standard Basis
The Standard Basis (cont.)

Visualization

standardbasis2d
The Standard Basis (cont.)
The Standard Basis and the Unit Circle
standard-basis_unit-circle

Since the distance from the origin to \(\bs{p}\) is 1, it follows that: \[ \cos(\theta) = \frac{p_1}{1} \\ \sin(\theta) = \frac{p_2}{1} \]

Which is to say that \( \bs{p} := (p_1, p_2) = (\cos(\theta), \sin(\theta)) \)

Hence, any point, \(\bs{q}\), on the unit sphere can be represented as: \[ \bs{q} = (1, 0) \cdot \cos(\theta) + (0, 1) \cdot \sin(\theta) = \bs{i} \cos(\theta) + \bs{j} \sin(\theta) \]

The Inner (Dot) Product
The Euclidean Norm (Length) of a Vector
The Euclidean Norm (Length) of a Vector (cont.)
Unit Vector
Normalization
Generalizing the Pythagorean Theorem
The Angle Formed by Vectors
The Angle Formed by Vectors (cont.)
Weighted Combinations
Weighted Combinations (cont.)

Weighted Combinations of \(\bs{q}\) and \(\bs{r}\)

weightedcombinations2d
Weighted Combinations (cont.)

Convex Combinations of \(q\) and \(r\)

convexcombinations2d
Weighted Combinations (cont.)

Barycentric Combinations of \(q\) and \(r\)

barycentriccombinations2d
Weighted Combinations (cont.)