Vectors and components: keeping direction in the calculation
Add directed quantities, resolve components, and use a dot product to measure alignment.
On this page
The question for today
What you’ll understand
- Distinguish a vector from its coordinate list and magnitude.
- Add and scale vectors component by component.
- Interpret a dot product and a projection geometrically.
Walking three meters east and four meters north does not leave you seven meters from where you started. A scalar total records distance traveled, while a vector displacement retains direction. Coordinates let you calculate with that direction systematically. The same language will later describe forces, velocities, gradients, and features in a machine-learning model. This lesson begins with ordinary two-dimensional Euclidean space so that the geometry stays visible.
The arrow and its coordinates are related, not identical
A geometric vector describes a directed displacement. Drawing its tail at another location does not change the displacement if its length and direction remain the same. To calculate, choose perpendicular unit axes and list how much displacement lies along each one. Those numbers are components in the chosen basis. Rotating the axes changes the component list while leaving the underlying geometric displacement unchanged.
A vector's magnitude is its length, a nonnegative scalar. In an orthonormal Cartesian basis, the Pythagorean theorem computes length from the components. That assumption about the basis matters: if basis vectors are not perpendicular unit vectors, blindly squaring and summing coordinates generally gives the wrong geometric length. We use orthonormal coordinates throughout this introductory lesson so that ordinary Euclidean geometry applies.
Addition follows the journey
To add two displacements, place the second arrow's tail at the first arrow's head. The resulting arrow runs from original start to final end. In a common basis, this operation adds matching components. It is commutative because the same two moves in reversed order reach the same endpoint in flat space. The path and total traveled distance can differ from the magnitude of the resultant.
Multiplying a vector by a positive scalar stretches it without changing direction. A negative scalar also reverses direction, and zero produces the zero vector. Unit vectors separate direction from size. Divide a nonzero vector by its magnitude to make a unit vector; the zero vector has no defined direction and cannot be normalized this way. Do not let a software division hide this geometric restriction.
A dot product measures alignment
The dot product multiplies corresponding components and adds the products. Geometrically it equals the product of the lengths times the cosine of their included angle. It is positive for acute alignment, zero for perpendicular nonzero vectors, and negative for obtuse alignment. Unlike a vector sum, its result is a scalar. Its physical unit is the product of the units carried by its inputs.
Dotting a vector with a unit direction gives its signed component along that direction. This explains why mechanical work uses force dotted with displacement: a perpendicular force contributes no work along that displacement. In data analysis a normalized dot product can measure similarity, but that interpretation depends on the chosen representation and metric. A numerical similarity is not automatically a statement about semantic meaning or causation.
Work it through
A two-leg displacement
A robot moves (3, 0) m and then (0, 4) m in a fixed Cartesian frame. Find its resultant displacement, magnitude, and component along the east direction.
Add matching coordinates to obtain (3 + 0, 0 + 4) = (3, 4) meters. Keep coordinate order tied to the declared east and north axes.
The squared length is 9 + 16 = 25 square meters, so magnitude is 5 meters. Route length is instead 3 + 4 = 7 meters.
The east unit direction is (1, 0). Its dot product with (3, 4) is 3 meters, giving the signed eastward component even though total displacement length is 5 meters.
The resultant is (3, 4) m, with length 5 m and eastward component 3 m.
The living notebook
Explore the model
Interactive lab · vectors
Resolve one arrow into components
The controls set the angle in degrees and magnitude of one Euclidean vector. Rotate the arrow while keeping its magnitude fixed, and watch the x/y projections change. The lab shows a single vector and its components, not the two-leg robot journey or dynamics.
- x component
- 1.393
- y component
- 0.975
- Magnitude
- 1.7
Playback traces a fixed vector and its projections. Angle and magnitude set the geometry; the moving marker does not change them. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forRotating a fixed-length vector changes components without changing magnitude.
Pause & reason
Check your understanding
Your turn
Try it yourself
For u = (2, −1) and v = (1, 2), find u + v, their dot product, and the magnitude of u.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
Add matching components, then calculate the two component products separately.
Compare with the solution
The sum is . The dot product is , so these nonzero vectors are perpendicular. The magnitude of u is . A zero dot product does not require either vector to have zero length.
Keep the idea
Take it with you
- Coordinates describe a vector relative to a basis; magnitude describes length.
- Vector addition retains direction by adding matching components.
- A dot product produces a scalar measure of alignment and supports projection.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.