# Nakafa Learning Content

> For AI agents: use [llms.txt](https://nakafa.com/llms.txt) for the site index. Markdown versions are available by appending `.md` to content URLs or sending `Accept: text/markdown`.

URL: https://nakafa.com/en/subjects/mathematics/vector-operations/vector-subtraction
Source: https://raw.githubusercontent.com/nakafaai/nakafa.com/refs/heads/main/packages/contents/material/lesson/mathematics/vector-operations/vector-subtraction/en.mdx

Learn vector subtraction with worked examples, geometric visualization, and real-world applications. Learn algebraic methods and properties.

---

## Basic Concept of Vector Subtraction

Vector subtraction is one of the basic operations in vector mathematics. Unlike vector addition that combines two vectors, vector subtraction produces the difference between two vectors. When we subtract vector $$\vec{b}$$ from vector $$\vec{a}$$, the result is a vector that, when added to $$\vec{b}$$, will produce $$\vec{a}$$.

Visible text: Vector subtraction is one of the basic operations in vector mathematics. Unlike vector addition that combines two vectors, vector subtraction produces the difference between two vectors. When we subtract vector from vector , the result is a vector that, when added to , will produce .

Mathematically, vector subtraction is defined as:

```math
\vec{a} - \vec{b} = \vec{a} + (-\vec{b})
```

This means that subtracting vector $$\vec{b}$$ from vector $$\vec{a}$$ is equivalent to adding vector $$\vec{a}$$ with the negative of vector $$\vec{b}$$.

Visible text: This means that subtracting vector from vector is equivalent to adding vector with the negative of vector .

## Geometric Vector Subtraction

Geometrically, vector subtraction $$\vec{a} - \vec{b}$$ can be depicted by:

Visible text: Geometrically, vector subtraction can be depicted by:

1. Drawing vectors $$\vec{a}$$ and $$\vec{b}$$ with the same initial point.
2. Drawing vector $$-\vec{b}$$ (vector $$\vec{b}$$ with reversed direction).
3. Drawing a vector from the endpoint of $$\vec{b}$$ to the endpoint of $$\vec{a}$$.

Visible text: 1. Drawing vectors and with the same initial point.
2. Drawing vector (vector with reversed direction).
3. Drawing a vector from the endpoint of to the endpoint of .

The resulting vector, $$\vec{a} - \vec{b}$$, can also be obtained by drawing a line from the endpoint of vector $$\vec{b}$$ to the endpoint of vector $$\vec{a}$$ when both vectors are drawn from the same origin point.

Visible text: The resulting vector, , can also be obtained by drawing a line from the endpoint of vector to the endpoint of vector when both vectors are drawn from the same origin point.

Component: Vector3d
Props:
- title: Visualization of Vector Subtraction in 3D Space
- description: Vector subtraction $$a - b$$ is equivalent to vector{" "}
$$a$$ added to the negative of vector{" "}
$$b$$.
  Visible text: Vector subtraction is equivalent to vector{" "}
 added to the negative of vector{" "}
.
- vectors: [
{
from: [0, 0, 0],
to: [3, 2, 1],
color: getColor("TEAL"),
label: "a",
},
{
from: [0, 0, 0],
to: [1, 2, 2],
color: getColor("ROSE"),
label: "b",
},
{
from: [0, 0, 0],
to: [-1, -2, -2],
color: getColor("ORANGE"),
label: "-b",
},
{
from: [0, 0, 0],
to: [2, 0, -1],
color: getColor("PINK"),
label: "a - b",
},
]
- cameraPosition: [6, 4, 6]

## Algebraic Vector Subtraction

Vector subtraction can be performed by subtracting corresponding components. Suppose we have two vectors:

Component: MathContainer
Children:

```math
\vec{a} = (a_1, a_2, a_3)
```

```math
\vec{b} = (b_1, b_2, b_3)
```

Then vector subtraction $$\vec{a} - \vec{b}$$ can be calculated as:

Visible text: Then vector subtraction can be calculated as:

```math
\vec{a} - \vec{b} = (a_1 - b_1, a_2 - b_2, a_3 - b_3)
```

For two-dimensional vectors, the equation becomes:

```math
\vec{a} - \vec{b} = (a_1 - b_1, a_2 - b_2)
```

## Example of Vector Subtraction Calculation

Suppose there are two vectors:

Component: MathContainer
Children:

```math
\vec{a} = (3, 4)
```

```math
\vec{b} = (1, 2)
```

Vector subtraction $$\vec{a} - \vec{b}$$ is:

Visible text: Vector subtraction is:

```math
\vec{a} - \vec{b} = (3, 4) - (1, 2) = (3-1, 4-2) = (2, 2)
```

While vector subtraction $$\vec{b} - \vec{a}$$ is:

Visible text: While vector subtraction is:

```math
\vec{b} - \vec{a} = (1, 2) - (3, 4) = (1-3, 2-4) = (-2, -2)
```

Note that $$\vec{a} - \vec{b} \neq \vec{b} - \vec{a}$$ in general. In fact, $$\vec{a} - \vec{b} = -(\vec{b} - \vec{a})$$.

Visible text: Note that in general. In fact, .

Component: Vector3d
Props:
- title: Example of Vector Subtraction
- description: Visualization of vector subtraction{" "}
$$a - b = (3,4,0) - (1,2,0) = (2,2,0)$$.
  Visible text: Visualization of vector subtraction{" "}
.
- vectors: [
{
from: [0, 0, 0],
to: [3, 4, 0],
color: getColor("TEAL"),
label: "a",
},
{
from: [0, 0, 0],
to: [1, 2, 0],
color: getColor("ROSE"),
label: "b",
},
{
from: [0, 0, 0],
to: [2, 2, 0],
color: getColor("LIME"),
label: "a - b",
},
]
- cameraPosition: [8, 6, 8]

## Applications of Vector Subtraction

Vector subtraction has many applications in real life:

1. **Calculating Displacement**: If $$\vec{a}$$ is the final position and $$\vec{b}$$ is the initial position, then $$\vec{a} - \vec{b}$$ is the displacement vector.

2. **Calculating Distance**: In games like Angry Birds, vector subtraction is used to calculate the distance and direction between the bird and the target.

3. **Physics**: Vector subtraction is used to calculate the resultant force in systems with multiple forces.

Visible text: 1. **Calculating Displacement**: If is the final position and is the initial position, then is the displacement vector.

2. **Calculating Distance**: In games like Angry Birds, vector subtraction is used to calculate the distance and direction between the bird and the target.

3. **Physics**: Vector subtraction is used to calculate the resultant force in systems with multiple forces.

## Vector Subtraction to Find the Resultant

Vector subtraction can also be used to find the resultant vector. A resultant vector is a vector that represents the combined effect of two or more vectors.

Suppose an object moves from initial position $$\vec{p}_1$$ to final position $$\vec{p}_2$$. The displacement vector of the object is:

Visible text: Suppose an object moves from initial position to final position . The displacement vector of the object is:

```math
\vec{d} = \vec{p}_2 - \vec{p}_1
```

This resultant vector shows the direction and distance of the object's displacement.

## Properties of Vector Subtraction

Vector subtraction has several important properties:

1. $$\vec{a} - \vec{b} = \vec{a} + (-\vec{b})$$
2. $$\vec{a} - \vec{a} = \vec{0}$$ (zero vector)
3. $$\vec{a} - \vec{0} = \vec{a}$$
4. $$\vec{0} - \vec{a} = -\vec{a}$$
5. $$\vec{a} - \vec{b} = -(\vec{b} - \vec{a})$$

Visible text: 1. 
2. (zero vector)
3. 
4. 
5.

## Example Problem

A monkey is at position $$(3, 4)$$ and wants to get a banana located at position $$(2, 1)$$. Determine the displacement vector of the monkey to reach the banana.

Visible text: A monkey is at position and wants to get a banana located at position . Determine the displacement vector of the monkey to reach the banana.

**Solution:**

Monkey's position: $$\vec{m} = (3, 4)$$
Banana's position: $$\vec{p} = (2, 1)$$

Visible text: Monkey's position: 
Banana's position:

Displacement vector of the monkey to the banana:

```math
\vec{d} = \vec{p} - \vec{m} = (2, 1) - (3, 4) = (2-3, 1-4) = (-1, -3)
```

Therefore, the monkey needs to move $$1 \text{ unit}$$ in the negative $$x$$-axis direction and $$3 \text{ units}$$ in the negative $$y$$-axis direction to reach the banana.

Visible text: Therefore, the monkey needs to move in the negative -axis direction and in the negative -axis direction to reach the banana.

The magnitude of the displacement vector can be calculated using the Pythagorean theorem:

```math
|\vec{d}| = \sqrt{(-1)^2 + (-3)^2} = \sqrt{1 + 9} = \sqrt{10} \approx 3.16
```