What is a Vector in Linear Algebra? A Beginner's Guide to Magnitude, Direction, and Dot Product

Posted on April 4, 2026 by Boden Bensema

Imagine standing at the origin of a map. You need to walk 3 steps East and 4 steps North. That combination of directions and distances is what a vector captures: both how far and which way.

In math, physics, and computer science, vectors are the building blocks that describe motion, position, forces, and even complex data used in AI.

In this article, we'll break down what vectors are in linear algebra, how to visualize them, and how to work with them both on paper and in Python.

What are Vectors?

At its core, a vector is simply an ordered list of numbers, each representing a component along a dimension. Let's take a look at this example 2D vector, [4,3][4, 3].

This vector has 2 components, 44 and 33. On a 2D plane, this vector can be visualized by an arrow on a graph:

Visual of a simple vector on a graph

Let's go over what this graph tells us:

  • Vectors begin at a starting point called the origin. In this example, the origin is (0, 0).

  • The components of a vector determine where the arrow ends. The first component (44) moves the vector right 4 units, and the second components (33) moves the vector up 3 units.

  • The arrow from (0,0) to (4,3) represents the vector. The length of the arrow shows the vector's magnitude, and the direction it points shows (unsurprisingly) the vector's direction.

In short, the vector [4,3][4,3] describes the movement "go 4 units right and 3 units up."

How are Vectors used in Real Life?

Vectors are used in many real life applications. The most common are

  • Physics: representing force, velocity, and other quantities that have magnitude and direction

  • Machine Learning (AI): feature vectors, embeddings

  • Computer Graphics: position, normals

  • Economics: price baskets

Dimensions of a Vector

The amount of components a vector has is determined by how many dimensions a vector needs.

In linear algebra, this is written using the notation RnR^n, which means "n-dimensional real space." A vector in RnR^n always contains exactly nn components.

For example:

  • A vector in R2R^2 has 2 components: [v1,v2][v_1,v_2]

  • A vector in R3R^3 has 3 components: [v1,v2,v3][v_1,v_2,v_3]

Each component corresponds to movement along one dimension of space.

For instance, the vector [4,3][4,3] is a vector in R2R^2, because it has two components. These components represent movement along the xx and yy directions of a two-dimensional plane.

Important Note

It's important to know that vectors aren't just a point, they represent direction and magnitude, not just position.

Important Note
It's important to know that vectors aren't just a point, they represent direction and magnitude, not just position.

In higher dimensions, vectors work the same way, even if we can't easily visualize them.

How are vectors represented?

Vectors are most commonly represented in three ways.

  1. Column/Row vectors: [v1,v2,...,vn]T[v_1, v_2, ..., v_n]^T
  • We've already explored this notation. It explicitly lists the components of the vector, which determine its position or direction in space.
  • For example, the vector [4,3][4,3] ends at the point (4,3) in 2-dimensional space.
  • The T^T at the end of this equation tells us to transpose the vector. You can think of this as flipping the vector on its side. If we transposed [4,3][4,3], we would get [43]\begin{bmatrix} 4 \\ 3 \\ \end{bmatrix}, where the leftmost value becomes the top.
  • Vertical vectors are called column vectors, while horizontal vectors are called row vectors
  1. Bold lowercase letter: v\mathbf{v}
  • Vectors are often written using bold lowercase letters instead of listing their components.
  • This notation is a convenient shorthand when the exact components are already known or defined elsewhere.
  • For example, if v=[4,3]\mathbf{v}=[4,3], we can simply refer to the vector as v\mathbf{v} in later equations.
  1. Arrow notation: v\vec{v}
  • Another common way to write a vector is with an arrow above the letter.
  • The arrow emphasizes that the quantity has both magnitude and direction, which is especially common in physics.
  • For example, v\vec{v} might represent a velocity vector pointing in a specific direction.

Scalars vs. Vectors

A scalar is any value that has magnitude, but no direction. Some examples of a scalar are speed (60 mph), mass (10 kg), and time (1 hour).

These don't have any direction. An apple can still weigh 1 pound whether it's facing the ceiling, the floor, a wall, anything. Similarly, I can be going 60 miles per hour in any direction.

Vectors add some more information to scalars: direction. As we've explored already, I can turn 60 mph into a vector by saying I'm going 60 mph East.

What is a Vector Magnitude?

The magnitude of a vector describes the length of the vector when it is drawn on a graph. It tells you how large or strong the vector is, regardless of its direction.

A vector's magnitude will always be a scalar value, meaning it has size or strength but no direction. This makes sense because the length of a line does not point anywhere, it only measures distance.

For example, if you take the magnitude of a velocity vector, you get the object's speed. While velocity includes both direction and magnitude, speed only measures how fast something is moving, making it a scalar quantity.

What Vector Magnitudes Are Mathematically

Visual of a simple vector on a graph

Looking back at this example, the magnitude of this vector would be the distance from the origin ((0,0)(0,0)) to the endpoint ((4,3)(4,3)).

If you recall from geometry, this formula is

(x1x2)2+(y1y2)2\sqrt{(x_1 - x_2)^2 + (y_1 - y_2)^2}

Plugging in our example:

(04)2+(03)2=5\sqrt{(0 - 4)^2 + (0 - 3)^2} = 5

The notation for a vector's magnitude is v\|v\|. We can express that our magnitude is 55 like so:

v=5\|v\| = 5

The Unit Vector

A unit vector is simply a vector that has a magnitude of 1. In other words, it points in a direction but has been scaled down so its length is exactly one.

Unit vectors are important because they focus on direction without worrying about size. For example, in physics, a force or velocity can be broken into a direction (a unit vector) and a magnitude (how strong the force is or how fast something is moving).

To make a unit vector from any vector vv, you divide it by its magnitude:

v^=vv\hat{v} = \frac{v}{\|v\|}

This is what is called normalization. This keeps the direction the same but scales to vector so its length is 1.

Quick Tip

Think of a unit vector as an arrow that only tells you which way to point, without telling you how far to go.

Quick Tip
Think of a unit vector as an arrow that only tells you which way to point, without telling you how far to go.

The concept of unit vectors are useful in areas like computer graphics, physics, and engineering because they allow calculations like movement, orientation, or lighting to depend only on direction, not the length of a vector.

The Dot Product

The dot product is a way to combine two vectors and get a single number (a scalar) as the result.

At a basic level, the dot product tells you how much two vectors point in the same direction.

To calculate it, you multiply the matching components of the vectors and then add them together. For example, the dot product of [2,3] and [4,1] is

[2,3][4,1]=(24)+(31)=8+3=11[2,3] \cdot [4,1] = (2 \cdot 4) + (3 \cdot 1) = 8 + 3 = 11

The result tells you about the alignment of the vectors.

  • A large positive result means the vectors point mostly in the same direction
  • 0 tells you they're perpendicular
  • A negative result means the point in opposite directions.

In other words, the dot product captures how much one vector goes in the direction of the other.

Real World Use of the Dot Product

A real-world example of the dot product is in physics, when calculating work.

Work depends on the force applied in the direction of motion. If you push something straight forward, you do more work. If you push something downward towards a surface, you do very little. The dot product handles this perfectly, because it only counts the part of the force that is actually aligned with the movement.

In short, the dot product is a simple but powerful tool that turns two vectors into a number, giving insight into their direction and alignment.

Vector practice problems

Now that you have a basic understanding of vectors, let's try some example problems to solidify your understanding.

Practice Problem 1: Addition

Vectors can be added together to get a new vector. To do this, you add each component together like so:

[2,5]+[3,1]=[1,6][2,5] + [-3,1] = [-1,6]

Now you try:

[2,3]+[1,1]=?[2,3] + [1,-1] = ?

Practice Problem 2: Scalar Multiplication

Vectors can be multiplied by a scalar (a single number) to scale the vector. To do this, multiply each component by the scalar like so:

3[2,1]=[6,3]3 \cdot [2,-1] = [6,-3]

Now you try:

2[4,3]=?-2 \cdot [4,-3] = ?

Practice Problem 3: Magnitude

Using the magnitude formula, find the following vector's magnitude:

[5,12]=?\|[5,12]\| = ?

Practice Problem 4: Dot Product

The dot product of two vectors is found by multiplying corresponding components and adding the results:

vw=v1w1+v2w2+...+vnwnv \cdot w = v_1 w_1 + v_2 w_2 + ... + v_n w_n

Example:

[2,3][4,1]=(24)+(31)=8+3=11[2,3] \cdot [4,1] = (2 \cdot 4) + (3 \cdot 1) = 8 + 3 = 11

Now you try:

[1,5][2,3]=?[1,5] \cdot [2,-3] = ?

Summary

  • Vectors give direction and magnitude.

  • Scalars give only magnitude.

  • Each number in a vector is called a component.

  • The number of components in a vector is its dimension.

  • Magnitude (or length) is a scalar that tells you how strong the vector is.

    • Formula: v=v12+v22+...+vn2\|v\| = \sqrt{v_1^2 + v_2^2 + ... + v_n^2}
  • The dot product is a scalar that tells you how much two vectors point in the same direction.

    • Formula: vw=(v1w1)+(v2w2)+...+(vnwn)\mathbf{v} \cdot \mathbf{w} = (v_1 \cdot w_1) + (v_2 \cdot w_2) + ... + (v_n \cdot w_n)
  • A unit vector is a vector with direction and a magnitude of 1.

Conclusion

Vectors are one of the most important concepts in linear algebra, and understanding them is important for fields like physics, engineering, computer graphics, and machine learning. A vector describes both magnitude and direction, while a scalar only describes magnitude.

Throughout this article, we've explored how to visualize vectors on a graph, how to calculate their magnitude, how to find a unit vector for direction, and how to compute the dot product to measure alignment between vectors.

By mastering these basics, you gain the tools to work with vectors in higher dimensions, understand forces and motion in physics, manipulate data in machine learning, and perform calculations in computer graphics.

People Also Ask

What is a vector in linear algebra?
A vector in linear algebra is an ordered list of numbers that represents both a direction and a magnitude in space. Each number in the list is called a component, and the vector can exist in any number of dimensions. Vectors are used to describe quantities like velocity, force, position, or even data in machine learning.
How do I calculate the magnitude of a vector?
To calculate the magnitude of a vector, square each of its components, add those squares together, and then take the square root of the sum. For example, the magnitude of the vector [3,4] is sqrt(3^2 + 4^2) = 5. The magnitude is always a scalar number that shows the length of the vector.
What is the dot product and why is it useful?
The dot product combines two vectors to produce a single number, called a scalar. You calculate it by multiplying corresponding components and adding the results. The dot product measures how much two vectors point in the same direction. A positive result means they align, zero means they are perpendicular, and a negative result means they point in opposite directions.

About the Author

This article was written by Boden Bensema, an electronics hobbyist focused on teaching beginner-friendly circuit design, breadboarding, and electronics fundamentals.

About page