Vectors and the Dot Product: Magnitude, Direction, and Angles
Solver AI TeamPublished Updated 12 min read
Learn vectors from the ground up. Covers vector components, magnitude, addition, scalar multiplication, the dot product, and using it to find the angle between two vectors.
Frequently asked questions
What is the dot product of two vectors?
The dot product multiplies the matching components of two vectors and adds the results: ⟨a₁, a₂⟩ · ⟨b₁, b₂⟩ = a₁b₁ + a₂b₂. The result is a single number (a scalar), not a vector. For example, ⟨2, 3⟩ · ⟨4, −1⟩ = 8 − 3 = 5.
How do you find the angle between two vectors?
Use cos θ = (a · b) / (|a||b|), then take the inverse cosine. For ⟨1, 0⟩ and ⟨1, 1⟩, the dot product is 1, the magnitudes are 1 and √2, so cos θ = 1/√2 and θ = 45°. Make sure your calculator is in the right angle mode.
What does it mean if the dot product is zero?
For two nonzero vectors, a dot product of zero means they are perpendicular (orthogonal), since cos 90° = 0. A positive dot product means the angle between them is acute, and a negative one means the angle is obtuse. This makes the dot product a quick test for right angles.
What is the difference between the dot product and the cross product?
The dot product gives a scalar and measures how much two vectors point the same way. The cross product, defined in 3D, gives a vector perpendicular to both, with magnitude |a||b| sin θ. Use the dot product for angles and projections, and the cross product for areas and perpendicular directions.
How do you find the magnitude of a vector?
Square each component, add them, and take the square root: |⟨a, b⟩| = √(a² + b²). For ⟨3, 4⟩ the magnitude is √(9 + 16) = 5. In 3D, add the third component's square under the root. Magnitude is also √(v · v).
A vector has both a magnitude and a direction, and the dot product of two vectors multiplies their matching components and adds the results: ⟨a₁, a₂⟩ · ⟨b₁, b₂⟩ = a₁b₁ + a₂b₂. The answer is a single number, not a vector. It also equals |a||b|cos θ, so dividing it by the two magnitudes gives the cosine of the angle between the vectors.
What Is a Vector?
Definition — Vector
A vector is a quantity that has both a magnitude (size) and a direction. This contrasts with a scalar, which has only magnitude.
Speed ("60 mph") is a scalar. Velocity ("60 mph north") is a vector. Force, displacement, momentum, and acceleration are all vectors.
Geometrically, a vector is often drawn as an arrow: the length represents the magnitude, and the arrow points in the direction. Algebraically, a 2D vector is written as v = ⟨a, b⟩ or v = ai + bj, where a is the horizontal component and b is the vertical component. In 3D, vectors have three components: v = ⟨a, b, c⟩ or v = ai + bj + ck.
Position vectors and equality
The position vector from the origin to a point (x, y) is just ⟨x, y⟩. Vectors that are not anchored at the origin are still described by their components — the direction and magnitude are what matter, not the starting point. Two vectors are equal if and only if they have the same components (same magnitude and same direction), regardless of where they start.
The Key Insight
Vectors are foundational in physics, engineering, computer graphics, and machine learning. Every direction-aware quantity in the universe is modeled as a vector.
Vector Magnitude
The Rule — Magnitude of a Vector
The magnitude (or length) of a vector measures how long the arrow is. For a 2D vector v = ⟨a, b⟩, the magnitude is |v| = √(a² + b²). This is just the Pythagorean theorem applied to the components. For a 3D vector v = ⟨a, b, c⟩, it generalizes to |v| = √(a² + b² + c²).
Example 1 — magnitude in 2D
Find the magnitude of v = ⟨3, 4⟩.
|v| = √(3² + 4²) = √(9 + 16) = √25 = 5.
Answer|v| = 5
Example 2 — magnitude in 3D
Find the magnitude of v = ⟨2, −1, 2⟩.
|v| = √(4 + 1 + 4) = √9 = 3.
Answer|v| = 3
Unit vectors
Definition — Unit Vector
A unit vector is a vector with magnitude 1. To find the unit vector in the same direction as v, divide v by its magnitude: û = v/|v|.
Unit vectors are useful because they isolate the direction of a vector from its magnitude.
Vector Addition and Scalar Multiplication
Vector addition
The Rule — Vector Addition
Vector addition: Add corresponding components. ⟨a, b⟩ + ⟨c, d⟩ = ⟨a + c, b + d⟩. Geometrically, this is the parallelogram rule (or tip-to-tail method).
Example 1 — adding two vectors
⟨2, 3⟩ + ⟨5, −1⟩ = ⟨7, 2⟩.
Answer⟨7, 2⟩
Vector subtraction
The Rule — Vector Subtraction
Vector subtraction: Same as addition with the negative of the second vector. ⟨a, b⟩ − ⟨c, d⟩ = ⟨a − c, b − d⟩.
Example 2 — subtracting vectors
⟨5, 7⟩ − ⟨2, 3⟩ = ⟨3, 4⟩.
Answer⟨3, 4⟩
Scalar multiplication
The Rule — Scalar Multiplication
Scalar multiplication: Multiply each component by the scalar. k · ⟨a, b⟩ = ⟨ka, kb⟩. Geometrically, scalar multiplication scales the vector's length by |k|. If k > 0, the direction stays the same; if k < 0, the direction reverses.
Example 3 — positive scalar
3 · ⟨2, −5⟩ = ⟨6, −15⟩.
Answer⟨6, −15⟩
Example 4 — negative scalar reverses direction
−2 · ⟨1, 4⟩ = ⟨−2, −8⟩.
Answer⟨−2, −8⟩
The Key Insight
Properties: Vector addition is commutative and associative. Scalar multiplication distributes over vector addition: k(u + v) = ku + kv. These properties make vector algebra feel natural and consistent with regular arithmetic — with the important difference that vectors point in directions.
What Is the Dot Product?
Definition — Dot Product
The dot product (also called the scalar product or inner product) takes two vectors and returns a single number (a scalar). For vectors u = ⟨a, b⟩ and v = ⟨c, d⟩, the dot product is u · v = ac + bd. In 3D, ⟨a, b, c⟩ · ⟨d, e, f⟩ = ad + be + cf.
Example 1 — dot product in 2D
⟨3, 4⟩ · ⟨2, 1⟩ = 3(2) + 4(1) = 10.
Answer10
Example 2 — dot product in 3D
⟨1, 2, 3⟩ · ⟨4, 5, 6⟩ = 4 + 10 + 18 = 32.
Answer32
Geometric meaning
The Key Insight
The dot product has a beautiful geometric meaning: u · v = |u| · |v| · cos(θ), where θ is the angle between the vectors. This formula connects algebra (component multiplication) with geometry (lengths and angles) in a single elegant equation.
Case
Condition
Angle
Why
1
u · v = 0
Perpendicular (90°)
The vectors are perpendicular (orthogonal), since cos(90°) = 0.
2
u · v > 0
Acute (between 0° and 90°)
The angle is acute.
3
u · v < 0
Obtuse (between 90° and 180°)
The angle is obtuse.
The Takeaway
The dot product is the workhorse of physics (work done by a force), computer graphics (lighting calculations), and machine learning (cosine similarity for comparing vectors).
Finding the Angle Between Two Vectors
The Rule — Angle Between Vectors
Solving the dot product formula u · v = |u| · |v| · cos(θ) for θ gives cos(θ) = (u · v)/(|u| · |v|), so θ = arccos((u · v)/(|u| · |v|)).
Find the angle between u = ⟨1, 1, 0⟩ and v = ⟨1, 0, 1⟩.
Dot product: 1 + 0 + 0 = 1.
|u| = √2, |v| = √2.
cos(θ) = 1/(√2 · √2) = 1/2.
Answerθ = 60°
The Takeaway
The angle between two vectors is one of the most important quantities in linear algebra, geometry, and physics — and the dot product makes it computable in a single line.
Applications and the Cross Product
Work done by a force
The Rule — Work as a Dot Product
Work done by a force: If a force F moves an object through a displacement d, the work done is W = F · d.
The dot product captures the fact that only the component of force in the direction of motion does work. A force perpendicular to motion does zero work — exactly what the dot product gives when the vectors are perpendicular.
Vector projections
The Rule — Projection of u onto v
Vector projections: The projection of u onto v is proj_v(u) = ((u · v)/|v|²) · v. This decomposes u into a component along v and a component perpendicular to v — a fundamental trick in physics for resolving forces.
More applications
Computer graphics: The dot product of a surface normal with a light direction gives the brightness of a pixel — this is how 3D shading works.
Machine learning: The cosine similarity between two vectors (their dot product divided by their magnitudes) measures how similar two documents, embeddings, or features are.
The cross product (in 3D)
Corollary — The Cross Product
The cross product (in 3D): While the dot product gives a scalar, the cross productu × v gives a vector that's perpendicular to both u and v, with magnitude |u| · |v| · sin(θ). The cross product is used for finding normal vectors to planes, computing torque in physics, and calculating areas of parallelograms.
The Takeaway
The cross product is its own deep topic, covered in a dedicated guide. For now, the dot product alone unlocks an enormous range of geometric and physical applications. If you're working on vector problems, scan them with Solver AI for full step-by-step solutions including dot products, magnitudes, and angle calculations.