A vector records both a direction and a length. In three dimensions, we write
v=⟨x,y,z⟩,
where x, y, and z are the vector's components. The symbol v is read “vector v.”
A point P=(x,y,z) determines the position vector from the origin O=(0,0,0) to P:
OP=⟨x,y,z⟩.
If
P=(x,y,z),Q=(a,b,c),
then the displacement from P to Q is found by subtracting the starting point from the ending point:
PQ=⟨a−x,b−y,c−z⟩.
This is the same as subtracting the corresponding position vectors.
Vector arithmetic
Vectors are added component by component:
⟨x,y,z⟩+⟨a,b,c⟩=⟨x+a,y+b,z+c⟩.
Multiplying by a real number α scales every component:
α⟨x,y,z⟩=⟨αx,αy,αz⟩.
When α>1, the vector becomes longer without changing direction. When 0<α<1, it becomes shorter. A negative value reverses the direction as well as changing the length.
Length, distance, and unit vectors
The norm, or magnitude, of
v=⟨x,y,z⟩
is
∥v∥=x2+y2+z2.
It is the distance from the origin to the endpoint of the vector. Scaling obeys
∥αv∥=∣α∣∥v∥.
The absolute value appears because a length cannot be negative.
The distance between two points is the norm of their displacement vector:
d(P,Q)=∥PQ∥=(a−x)2+(b−y)2+(c−z)2.
A unit vector has length 1. If v=0, dividing by its norm keeps its direction and changes its length to 1:
u=∥v∥v.
This process is called normalizing the vector.
The standard basis
The standard basis vectors in R3, read “R three,” are
i=⟨1,0,0⟩,j=⟨0,1,0⟩,k=⟨0,0,1⟩.
They point along the positive coordinate directions. Every vector can be decomposed into those directions:
⟨x,y,z⟩=xi+yj+zk.
The same coordinate ideas work in R2 and, more generally, in Rn.
The dot product
For
v=⟨x1,y1,z1⟩,w=⟨x2,y2,z2⟩,
the dot product is
v⋅w=x1x2+y1y2+z1z2.
The result is a real number, not another vector. The dot product satisfies
v⋅v=∥v∥2,u⋅(v+w)=u⋅v+u⋅w,v⋅w=w⋅v,
and
(αv)⋅w=α(v⋅w)=v⋅(αw).
Angles between vectors
Let θ be the angle between two nonzero vectors v and w. Their dot product also has the geometric form
v⋅w=∥v∥∥w∥cosθ.
Therefore,
cosθ=∥v∥∥w∥v⋅w.
This formula connects coordinates to geometry: the component calculation on the left tells us the angle between the directions.
Why the angle formula works
The vectors v, w, and w−v form a triangle. The law of cosines gives
∥w−v∥2=∥v∥2+∥w∥2−2∥v∥∥w∥cosθ.
The dot product gives another expression for the same squared length:
∥w−v∥2=(w−v)⋅(w−v)=∥w∥2−2v⋅w+∥v∥2.
Equating these expressions and canceling the common squared norms leaves
v⋅w=∥v∥∥w∥cosθ.
Orthogonal vectors
Two vectors are orthogonal when they meet at a right angle. For nonzero vectors, θ=π/2, so
cos(2π)=0.
Thus,
v⋅w=0⟺v and w are orthogonal.
For example,
⟨2,2,−1⟩⋅⟨5,−4,2⟩=2(5)+2(−4)+(−1)(2)=10−8−2=0.
Therefore, the two vectors are orthogonal.
Scalar and vector projection
A projection answers this question: how much of v points in the direction of w? Assume w=0.
The scalar projection, or component of v along w, is
compwv=∥w∥v⋅w=∥v∥cosθ.
It is a signed length. A positive value means the component points in the same general direction as w; a negative value means it points in the opposite direction.
To turn that signed length into a vector, multiply by the unit vector in the w direction:
projwv=compwv(∥w∥w)=(∥w∥v⋅w)(∥w∥w).
Therefore,
projwv=∥w∥2v⋅ww.
If w is already a unit vector, then ∥w∥=1 and the formula simplifies to
projwv=(v⋅w)w.
A projection keeps only the part in one direction
The projection is parallel to w. The dashed remainder is perpendicular to w, so the original vector splits into a parallel part and a perpendicular part.
Example: projecting one vector onto another
Let
v=⟨1,1,2⟩,w=⟨−2,3,1⟩.
First compute the dot product:
v⋅w=−2+3+2=3.
Then compute the squared norm of w:
∥w∥2=(−2)2+32+12=14.
Substitute into the vector-projection formula:
projwv=143w=143⟨−2,3,1⟩=⟨−73,149,143⟩.
A useful check is that the answer must be a scalar multiple of w. If it is not parallel to w, it cannot be the projection onto w.
Teaching walkthrough
The vector as a displacement in space
Imagine moving from one location to another across a room. That displacement has two fundamental properties: how far you travel and in what direction you go. A three-dimensional vector captures both:
v=⟨x,y,z⟩
The numbers x, y, and z are the vector's components, recording how far the vector reaches along each coordinate axis.
To find the length, or norm, of this vector, we calculate:
∥v∥=x2+y2+z2
When v=0 and we care only about direction rather than magnitude, we can rescale v to have length 1 by dividing by its norm:
u=∥v∥v
This u is a unit vector. Keeping track of pure direction this way will prove essential when we project vectors later on.
The dot product: connecting algebra to geometry
When two vectors point in different directions, we often need to measure how they relate. Given v=⟨x1,y1,z1⟩ and w=⟨x2,y2,z2⟩, their dot product is computed by multiplying matching components and adding the results:
v⋅w=x1x2+y1y2+z1z2
A common point of confusion is expecting another vector as the answer. The dot product always produces a single real number (a scalar).
The reason this simple calculation is so useful is its geometric identity:
v⋅w=∥v∥∥w∥cosθ
where θ is the angle between the nonzero vectors v and w. By rearranging this relationship, we can determine their angle from their coordinates:
cosθ=∥v∥∥w∥v⋅w
Notice what happens when two nonzero vectors are perpendicular (θ=π/2). Because cos(π/2)=0, their dot product must be zero:
v⋅w=0⟺v and w are orthogonal
This provides a direct algebraic test for right angles without having to measure any angles visually.
Measuring along a direction: scalar and vector projection
Now suppose w=0. We can answer a practical question: how much of a vector v points in the direction of w?
Imagine dropping a perpendicular line from the tip of v straight onto the line containing w. This casts a "shadow" along w. We can describe this shadow in two ways:
Scalar projection (compwv): This is the signed length of the shadow:
compwv=∥w∥v⋅w
If v=0 as well and θ is the angle between the vectors, this also equals ∥v∥cosθ.
It is positive if the shadow points in the same general direction as w, and negative if it points in the opposite direction.
Vector projection (projwv): This is the shadow turned into an actual vector. We take the signed length from the scalar projection and multiply it by the unit vector in the direction of w:
projwv=(∥w∥v⋅w)(∥w∥w)=∥w∥2v⋅ww
A reliable check on your work is that projwv must always end up as a scalar multiple of w, because its entire purpose is to represent the part of v that lies directly along w.