What is a Vector in Linear Algebra? A Beginner's Guide to Magnitude, Direction, and Dot Product
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, .
This vector has 2 components, and . On a 2D plane, this vector can be visualized by an arrow 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 () moves the vector right 4 units, and the second components () 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 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 , which means "n-dimensional real space." A vector in always contains exactly components.
For example:
-
A vector in has 2 components:
-
A vector in has 3 components:
Each component corresponds to movement along one dimension of space.
For instance, the vector is a vector in , because it has two components. These components represent movement along the and directions of a two-dimensional plane.
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.
- Column/Row vectors:
- 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 ends at the point (4,3) in 2-dimensional space.
- The 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 , we would get , where the leftmost value becomes the top.
- Vertical vectors are called column vectors, while horizontal vectors are called row vectors
- Bold lowercase letter:
- 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 , we can simply refer to the vector as in later equations.
- Arrow notation:
- 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, 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

Looking back at this example, the magnitude of this vector would be the distance from the origin () to the endpoint ().
If you recall from geometry, this formula is
Plugging in our example:
The notation for a vector's magnitude is . We can express that our magnitude is like so:
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 , you divide it by its magnitude:
This is what is called normalization. This keeps the direction the same but scales to vector so its length is 1.
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
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:
Now you try:
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:
Now you try:
Practice Problem 3: Magnitude
Using the magnitude formula, find the following vector's magnitude:
Practice Problem 4: Dot Product
The dot product of two vectors is found by multiplying corresponding components and adding the results:
Example:
Now you try:
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:
-
The dot product is a scalar that tells you how much two vectors point in the same direction.
- Formula:
-
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
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