Vector Operations Tutorial for Beginners: A Complete Step-by-Step Guide


Vector Operations Tutorial for Beginners: A Complete Step-by-Step Guide

In this vector operations tutorial for beginners, we’ll explore how to work with vectors. This guide will help you understand how to add, subtract, and multiply vectors and calculate their magnitude, dot product, cross product, and projection. Understanding how to perform vector operations will prepare you for more advanced topics such as vector calculus and linear transformations. Many of the operations covered in this article are similar to those covered in the article The Ultimate Step-by-Step Guide to Basic Matrix Operations for Beginners.

The following infographic illustrates the concepts covered in this article.

Vector Operations Infographic Resized. Related Article - Vector Operations Tutorial for Beginners: A Complete Step-by-Step Guide.

What Is a Vector?

A vector is a quantity with both magnitude and direction, whereas a scalar has only magnitude.

Representing a Vector

Vectors can be represented in several ways, including graphically as an arrow with a specific length and direction and algebraically as a list of components.

Notation

Vectors can be written in a couple of different but equivalent forms:

Component form – \( \vec{v} = \langle v_x, v_y, v_z \rangle \).

Unit vector form – \( \vec{v} = v_x \hat{i} + v_y \hat{j} + v_z \hat{k} \), where \( \hat{i} \), \( \hat{j} \), \( \hat{k} \) are unit vectors pointing along the \( x \)-, \( y \)-, and \( z \)-axes respectively.

Vector Addition

Vector addition allows us to combine two or more vectors to find a single vector with the same overall effect as all the original vectors.

Geometrically, vectors are added by placing the tail of the second vector at the head of the first vector and drawing a new vector from the tail of the first to the head of the second. This new vector represents the sum of the two vectors.

When working with coordinates, vectors are added component-wise.

Example

Example 1: Calculate:
(a) \( \langle 2, -1, 3 \rangle + \langle 4, 2, -1 \rangle \)
(b) \( \langle 3, 4 \rangle + \langle -1, 2 \rangle \)

Solution: (a) \( \langle 2, -1, 3 \rangle + \langle 4, 2, -1 \rangle \)

Adding corresponding components gives

$$\langle 2 + 4, -1 + 2, 3 – 1 \rangle.$$

Adding we arrive at a final answer of

$$ \langle 6, 1, 2 \rangle.$$

(b) \( \langle 3, 4 \rangle + \langle -1, 2 \rangle \)

Adding corresponding components gives

$$\langle 3 – 1, 4 + 2 \rangle.$$

Adding we arrive at a final answer of

$$ \langle 2, 6 \rangle.$$

Vector Subtraction

Just like vector addition, vector subtraction is performed component-wise. Instead of combining two vectors, subtraction finds the difference between them. Geometrically, subtracting one vector from another gives a new vector that points from the head of the second vector to the head of the first, assuming the tails correspond.

Example

Example 2: Calculate:
(a) \( \langle 6, 4 \rangle – \langle 2, 7 \rangle \)
(b) \( \langle 5, 2, 3 \rangle – \langle 1, 4, 2 \rangle \)

Solution: (a) \( \langle 6, 4 \rangle – \langle 2, 7 \rangle \)

Subtracting corresponding components gives

$$\langle 6 – 2, 4 – 7 \rangle.$$

Subtracting, we arrive at a final answer of

$$\langle 4, -3 \rangle.$$

(b) \( \langle 5, 2, 3 \rangle – \langle 1, 4, 2 \rangle \)

Subtracting corresponding components gives

$$\langle 5 – 1, 2 – 4, 3 – 2 \rangle.$$

Subtracting, we arrive at a final answer of

$$\langle 4, -2, 1 \rangle.$$

Scalar Multiplication

Scalar multiplication scales the magnitude of a vector and is found by multiplying each component by the scalar. If the scalar is positive, the resulting vector points in the same direction, whereas if k is negative, the resulting vector points in the opposite direction.

Example

Example 3: Calculate:
(a) \( 4\langle 2, -3 \rangle \)
(b) \( -2\langle 2, -3 \rangle \)
(c) \( 3\langle 1, -2, 3 \rangle \)

Solution: (a) \( 4\langle 2, -3 \rangle \)

Multiplying each component by 4 gives

$$\langle 4(2), 4(-3) \rangle.$$

Multiplying, we arrive at a final answer of

$$\langle 8, -12 \rangle.$$

(b) \( -2\langle 2, -3 \rangle \)

Multiplying each component by -2 gives

$$\langle -2(2), -2(-3) \rangle.$$

Multiplying, we arrive at a final answer of

$$\langle -4, 6 \rangle.$$

(c) \( 3\langle 1, -2, 3 \rangle \)

Multiplying each component by 3 gives

$$\langle 3(1), 3(-2), 3(3) \rangle.$$

Multiplying, we arrive at a final answer of

$$\langle 3, -6, 9 \rangle.$$

Magnitude of a Vector

The magnitude of a vector tells us how long the vector is. The magnitude of a vector is found by using the Pythagorean theorem and is denoted by \( ||\vec{v}|| \).

Example

Example 4: Calculate:
(a) \( ||\langle 3, 4 \rangle|| \)
(b) \( ||\langle 2, -1, 2 \rangle|| \)

Solution: (a) \( ||\langle 3, 4 \rangle|| \)

Applying the Pythagorean theorem, we get

$$\sqrt{3^2 + 4^2}.$$

Squaring gives

$$\sqrt{9 + 16}.$$

Adding we obtain

$$\sqrt{25}.$$

Taking the square root, we arrive at a final answer of

$$5.$$

(b) \( ||\langle 2, -1, 2 \rangle|| \)

Applying the Pythagorean theorem, we get

$$\sqrt{2^2 + (-1)^2 + 2^2}.$$

Squaring gives

$$\sqrt{4 + 1 + 4}.$$

Adding we obtain

$$\sqrt{9}.$$

Taking the square root, we arrive at a final answer of

$$3.$$

Dot Product

The dot product is an operation that takes two vectors and returns a scalar measuring the extent to which the vectors point in the same direction. It is calculated by summing the products of corresponding components.

Example

Example 5: Calculate:
(a) \( \langle 3, 4 \rangle \cdot \langle 2, -1 \rangle \)
(b) \( \langle 1, 2, 3 \rangle \cdot \langle 4, -5, 6 \rangle \)

Solution: (a) \( \langle 3, 4 \rangle \cdot \langle 2, -1 \rangle \)

Summing the products of corresponding components gives

$$3(2) + 4(-1).$$

Multiplying we obtain

$$6 – 4.$$

Subtracting, we arrive at a final answer of

$$2.$$

(b) \( \langle 1, 2, 3 \rangle \cdot \langle 4, -5, 6 \rangle \)

Summing the products of corresponding components gives

$$1(4) + 2(-5) + 3(6).$$

Multiplying we obtain

$$4 – 10 + 18.$$

Adding and subtracting, we arrive at a final answer of

$$12.$$

Cross Product

The cross product is an operation that takes two three-dimensional vectors and produces another vector perpendicular to both. It has a magnitude equal to the area of the parallelogram formed by the vectors. The formula for the cross product is

$$\langle a_x, a_y, a_z \rangle \times \langle b_x, b_y, b_z \rangle =
\begin{vmatrix}
\hat{i} & \hat{j} & \hat{k} \\
a_x & a_y & a_z \\
b_x & b_y & b_z
\end{vmatrix}.$$

For a review of determinants, please refer to the article How to Find the Determinant of a Matrix Step by Step: A Complete Beginner’s Guide.

Example

Example 6: Calculate \( \langle 2, -1, 3 \rangle \times \langle 1, 4, -2 \rangle \).

Solution: Applying the formula for cross products, we get

$$\begin{vmatrix}
\hat{i} & \hat{j} & \hat{k} \\
2 & -1 & 3 \\
1 & 4 & -2
\end{vmatrix}.$$

Extending the 3 x 3 matrix gives

$$\begin{vmatrix}
\hat{i} & \hat{j} & \hat{k} \\
2 & -1 & 3 \\
1 & 4 & -2
\end{vmatrix}
\begin{matrix}
\hat{i} & \hat{j} \\
2 & -1 \\
1 & 4
\end{matrix}.$$

Computing the determinant by summing the products of the three diagonals running from the top-left to the bottom-right and subtracting the products of the three diagonals running from the bottom-left to the top-right, we obtain

$$\hat{i}(-1)(-2) + \hat{j}(3)(1) + \hat{k}(2)(4) – \hat{i}(3)(4) – \hat{j}(2)(-2) – \hat{k}(-1)(1).$$

Multiplying we get

$$2\hat{i} + 3\hat{j} + 8\hat{k} – 12\hat{i} + 4\hat{j} + \hat{k}.$$

Adding and subtracting gives

$$-10\hat{i} + 7\hat{j} + 9\hat{k}.$$

Writing in component form, we obtain a final answer of

$$\langle -10, 7, 9 \rangle.$$

Vector Projection

The projection of one vector onto another computes the shadow of one vector onto another vector. It is calculated using the formula

$$\text{proj}_{\vec{b}} \vec{a} = \frac{\vec{a} \cdot \vec{b}}{\vec{b} \cdot \vec{b}} \vec{b}.$$

Example

Example 7: Calculate \( \text{proj}_{\langle 4, 0, 0 \rangle} \langle 3, 4, 0 \rangle \).

Solution: Applying the formula, we get

$$\frac{\langle 3, 4, 0 \rangle \cdot \langle 4, 0, 0 \rangle}{\langle 4, 0, 0 \rangle \cdot \langle 4, 0, 0 \rangle } \langle 4, 0, 0 \rangle.$$

Taking the dot products by summing the products of corresponding components gives

$$\frac{3(4) + 4(0) + 0(0)}{4(4) + 0(0) + 0(0)} \langle 4, 0, 0 \rangle.$$

Multiplying we obtain

$$\frac{12 + 0 + 0}{16 + 0 + 0} \langle 4, 0, 0 \rangle.$$

Adding gives

$$\frac{12}{16} \langle 4, 0, 0 \rangle.$$

This simplifies to

$$\frac{3}{4} \langle 4, 0, 0 \rangle.$$

Multiplying each component by \( \frac{3}{4} \) gives

$$\langle \frac{3}{4}(4), \frac{3}{4}(0), \frac{3}{4}(0) \rangle.$$

Multiplying, we arrive at a final answer of

$$\langle 3, 0, 0 \rangle.$$

Conclusion

In this vector operations tutorial for beginners, we covered basic operations like vector addition, vector subtraction, and scalar multiplication, as well as more advanced concepts like the dot product, cross product, magnitude, and projection. With these tools, you’re now prepared for more advanced topics in linear algebra and calculus.

Further Reading

The Ultimate Step by Step Guide to Basic Matrix Operations for Beginners – Matrix operations and vector operations are similar. Now that you understand vector operations, I recommend going back and reviewing matrix operations.

Frequently Asked Questions

Yes, while we often visualize vectors in 2D or 3D, vectors can have any number of dimensions.