evan's notes
cal 3discreteodeenv systems

On this page

  • Notes
  • Vectors in three dimensions
  • Vector arithmetic
  • Length, distance, and unit vectors
  • The standard basis
  • The dot product
  • Angles between vectors
  • Orthogonal vectors
  • Scalar and vector projection
  • Teaching walkthrough
  • The vector as a displacement in space
  • The dot product: connecting algebra to geometry
  • Measuring along a direction: scalar and vector projection

Intermediate Calculus

§4 Vectors and Geometry

Evan Luo · Sep 18, 2026

Intermediate Calculus

§4 Vectors and Geometry

Evan Luo2 days ago

9 min read

Notes

Vectors in three dimensions

A vector records both a direction and a length. In three dimensions, we write

v=⟨x,y,z⟩,\mathbf v=\langle x,y,z\rangle, v=⟨x,y,z⟩,

where xxx, yyy, and zzz are the vector's components. The symbol v\mathbf vv is read “vector vvv.”

A point P=(x,y,z)P=(x,y,z)P=(x,y,z) determines the position vector from the origin O=(0,0,0)O=(0,0,0)O=(0,0,0) to PPP:

OP→=⟨x,y,z⟩.\overrightarrow{OP}=\langle x,y,z\rangle. OP=⟨x,y,z⟩.

If

P=(x,y,z),Q=(a,b,c),P=(x,y,z), \qquad Q=(a,b,c), P=(x,y,z),Q=(a,b,c),

then the displacement from PPP to QQQ is found by subtracting the starting point from the ending point:

PQ→=⟨a−x,b−y,c−z⟩.\overrightarrow{PQ} =\langle a-x,b-y,c-z\rangle. 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⟩.\langle x,y,z\rangle+\langle a,b,c\rangle =\langle x+a,y+b,z+c\rangle. ⟨x,y,z⟩+⟨a,b,c⟩=⟨x+a,y+b,z+c⟩.

Multiplying by a real number α\alphaα scales every component:

α⟨x,y,z⟩=⟨αx,αy,αz⟩.\alpha\langle x,y,z\rangle =\langle \alpha x,\alpha y,\alpha z\rangle. α⟨x,y,z⟩=⟨αx,αy,αz⟩.

When α>1\alpha>1α>1, the vector becomes longer without changing direction. When 0<α<10<\alpha<10<α<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⟩\mathbf v=\langle x,y,z\rangle v=⟨x,y,z⟩

is

∥v∥=x2+y2+z2.\boxed{\|\mathbf v\|=\sqrt{x^2+y^2+z^2}}. ∥v∥=x2+y2+z2​​.

It is the distance from the origin to the endpoint of the vector. Scaling obeys

∥αv∥=∣α∣ ∥v∥.\|\alpha\mathbf v\|=|\alpha|\,\|\mathbf v\|. ∥α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.\boxed{ d(P,Q) =\|\overrightarrow{PQ}\| =\sqrt{(a-x)^2+(b-y)^2+(c-z)^2}. } d(P,Q)=∥PQ​∥=(a−x)2+(b−y)2+(c−z)2​.​

A unit vector has length 111. If v≠0\mathbf v\ne\mathbf0v=0, dividing by its norm keeps its direction and changes its length to 111:

u=v∥v∥.\boxed{\mathbf u=\frac{\mathbf v}{\|\mathbf v\|}}. u=∥v∥v​​.

This process is called normalizing the vector.

The standard basis

The standard basis vectors in R3\mathbb R^3R3, read “RRR three,” are

i=⟨1,0,0⟩,j=⟨0,1,0⟩,k=⟨0,0,1⟩.\mathbf i=\langle1,0,0\rangle, \qquad \mathbf j=\langle0,1,0\rangle, \qquad \mathbf k=\langle0,0,1\rangle. 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.\langle x,y,z\rangle =x\mathbf i+y\mathbf j+z\mathbf k. ⟨x,y,z⟩=xi+yj+zk.

The same coordinate ideas work in R2\mathbb R^2R2 and, more generally, in Rn\mathbb R^nRn.

The dot product

For

v=⟨x1,y1,z1⟩,w=⟨x2,y2,z2⟩,\mathbf v=\langle x_1,y_1,z_1\rangle, \qquad \mathbf w=\langle x_2,y_2,z_2\rangle, v=⟨x1​,y1​,z1​⟩,w=⟨x2​,y2​,z2​⟩,

the dot product is

v⋅w=x1x2+y1y2+z1z2.\boxed{ \mathbf v\cdot\mathbf w =x_1x_2+y_1y_2+z_1z_2. } v⋅w=x1​x2​+y1​y2​+z1​z2​.​

The result is a real number, not another vector. The dot product satisfies

v⋅v=∥v∥2,\mathbf v\cdot\mathbf v=\|\mathbf v\|^2, v⋅v=∥v∥2, u⋅(v+w)=u⋅v+u⋅w,\mathbf u\cdot(\mathbf v+\mathbf w) =\mathbf u\cdot\mathbf v+\mathbf u\cdot\mathbf w, u⋅(v+w)=u⋅v+u⋅w, v⋅w=w⋅v,\mathbf v\cdot\mathbf w=\mathbf w\cdot\mathbf v, v⋅w=w⋅v,

and

(αv)⋅w=α(v⋅w)=v⋅(αw).(\alpha\mathbf v)\cdot\mathbf w =\alpha(\mathbf v\cdot\mathbf w) =\mathbf v\cdot(\alpha\mathbf w). (αv)⋅w=α(v⋅w)=v⋅(αw).

Angles between vectors

Let θ\thetaθ be the angle between two nonzero vectors v\mathbf vv and w\mathbf ww. Their dot product also has the geometric form

v⋅w=∥v∥ ∥w∥cos⁡θ.\boxed{ \mathbf v\cdot\mathbf w =\|\mathbf v\|\,\|\mathbf w\|\cos\theta. } v⋅w=∥v∥∥w∥cosθ.​

Therefore,

cos⁡θ=v⋅w∥v∥ ∥w∥.\boxed{ \cos\theta =\frac{\mathbf v\cdot\mathbf w} {\|\mathbf v\|\,\|\mathbf w\|}. } 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\mathbf vv, w\mathbf ww, and w−v\mathbf w-\mathbf vw−v form a triangle. The law of cosines gives

∥w−v∥2=∥v∥2+∥w∥2−2∥v∥ ∥w∥cos⁡θ.\|\mathbf w-\mathbf v\|^2 =\|\mathbf v\|^2+\|\mathbf w\|^2 -2\|\mathbf v\|\,\|\mathbf w\|\cos\theta. ∥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.\begin{aligned} \|\mathbf w-\mathbf v\|^2 &=(\mathbf w-\mathbf v)\cdot(\mathbf w-\mathbf v)\\ &=\|\mathbf w\|^2-2\mathbf v\cdot\mathbf w+\|\mathbf v\|^2. \end{aligned} ∥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⁡θ.\mathbf v\cdot\mathbf w =\|\mathbf v\|\,\|\mathbf w\|\cos\theta. v⋅w=∥v∥∥w∥cosθ.

Orthogonal vectors

Two vectors are orthogonal when they meet at a right angle. For nonzero vectors, θ=π/2\theta=\pi/2θ=π/2, so

cos⁡(π2)=0.\cos\left(\frac\pi2\right)=0. cos(2π​)=0.

Thus,

v⋅w=0⟺v and w are orthogonal.\boxed{ \mathbf v\cdot\mathbf w=0 \quad\Longleftrightarrow\quad \mathbf v\text{ and }\mathbf w\text{ are orthogonal}. } 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.\begin{aligned} \langle2,2,-1\rangle\cdot\langle5,-4,2\rangle &=2(5)+2(-4)+(-1)(2)\\ &=10-8-2\\ &=0. \end{aligned} ⟨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\mathbf vv points in the direction of w\mathbf ww? Assume w≠0\mathbf w\ne\mathbf0w=0.

The scalar projection, or component of v\mathbf vv along w\mathbf ww, is

comp⁡wv=v⋅w∥w∥=∥v∥cos⁡θ.\boxed{ \operatorname{comp}_{\mathbf w}\mathbf v =\frac{\mathbf v\cdot\mathbf w}{\|\mathbf w\|} =\|\mathbf v\|\cos\theta. } compw​v=∥w∥v⋅w​=∥v∥cosθ.​

It is a signed length. A positive value means the component points in the same general direction as w\mathbf ww; 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\mathbf ww direction:

proj⁡wv=comp⁡wv(w∥w∥)=(v⋅w∥w∥)(w∥w∥).\begin{aligned} \operatorname{proj}_{\mathbf w}\mathbf v &=\operatorname{comp}_{\mathbf w}\mathbf v \left(\frac{\mathbf w}{\|\mathbf w\|}\right)\\ &=\left(\frac{\mathbf v\cdot\mathbf w}{\|\mathbf w\|}\right) \left(\frac{\mathbf w}{\|\mathbf w\|}\right). \end{aligned} projw​v​=compw​v(∥w∥w​)=(∥w∥v⋅w​)(∥w∥w​).​

Therefore,

proj⁡wv=v⋅w∥w∥2w.\boxed{ \operatorname{proj}_{\mathbf w}\mathbf v =\frac{\mathbf v\cdot\mathbf w}{\|\mathbf w\|^2}\mathbf w. } projw​v=∥w∥2v⋅w​w.​

If w\mathbf ww is already a unit vector, then ∥w∥=1\|\mathbf w\|=1∥w∥=1 and the formula simplifies to

proj⁡wv=(v⋅w)w.\operatorname{proj}_{\mathbf w}\mathbf v =(\mathbf v\cdot\mathbf w)\mathbf w. projw​v=(v⋅w)w.

A projection keeps only the part in one direction

Vector projection geometryVector v points above vector w. The projection of v onto w lies along w, and a dashed perpendicular segment joins the tip of v to the tip of the projection.
v
w
projw​v
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⟩.\mathbf v=\langle1,1,2\rangle, \qquad \mathbf w=\langle-2,3,1\rangle. v=⟨1,1,2⟩,w=⟨−2,3,1⟩.

First compute the dot product:

v⋅w=−2+3+2=3.\mathbf v\cdot\mathbf w =-2+3+2=3. v⋅w=−2+3+2=3.

Then compute the squared norm of w\mathbf ww:

∥w∥2=(−2)2+32+12=14.\|\mathbf w\|^2 =(-2)^2+3^2+1^2 =14. ∥w∥2=(−2)2+32+12=14.

Substitute into the vector-projection formula:

proj⁡wv=314w=314⟨−2,3,1⟩=⟨−37,914,314⟩.\begin{aligned} \operatorname{proj}_{\mathbf w}\mathbf v &=\frac{3}{14}\mathbf w\\ &=\frac{3}{14}\langle-2,3,1\rangle\\ &=\boxed{\left\langle-\frac37,\frac9{14},\frac3{14}\right\rangle}. \end{aligned} projw​v​=143​w=143​⟨−2,3,1⟩=⟨−73​,149​,143​⟩​.​

A useful check is that the answer must be a scalar multiple of w\mathbf ww. If it is not parallel to w\mathbf ww, it cannot be the projection onto w\mathbf ww.

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⟩\mathbf v = \langle x, y, z \ranglev=⟨x,y,z⟩

The numbers xxx, yyy, and zzz 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\|\mathbf v\| = \sqrt{x^2 + y^2 + z^2}∥v∥=x2+y2+z2​

When v≠0\mathbf v\ne\mathbf 0v=0 and we care only about direction rather than magnitude, we can rescale v\mathbf vv to have length 111 by dividing by its norm:

u=v∥v∥\mathbf u = \frac{\mathbf v}{\|\mathbf v\|}u=∥v∥v​

This u\mathbf uu 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⟩\mathbf v = \langle x_1, y_1, z_1 \ranglev=⟨x1​,y1​,z1​⟩ and w=⟨x2,y2,z2⟩\mathbf w = \langle x_2, y_2, z_2 \ranglew=⟨x2​,y2​,z2​⟩, their dot product is computed by multiplying matching components and adding the results:

v⋅w=x1x2+y1y2+z1z2\mathbf v \cdot \mathbf w = x_1 x_2 + y_1 y_2 + z_1 z_2v⋅w=x1​x2​+y1​y2​+z1​z2​

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⁡θ\mathbf v \cdot \mathbf w = \|\mathbf v\|\,\|\mathbf w\|\cos\thetav⋅w=∥v∥∥w∥cosθ

where θ\thetaθ is the angle between the nonzero vectors v\mathbf vv and w\mathbf ww. By rearranging this relationship, we can determine their angle from their coordinates:

cos⁡θ=v⋅w∥v∥ ∥w∥\cos\theta = \frac{\mathbf v \cdot \mathbf w}{\|\mathbf v\|\,\|\mathbf w\|}cosθ=∥v∥∥w∥v⋅w​

Notice what happens when two nonzero vectors are perpendicular (θ=π/2\theta = \pi/2θ=π/2). Because cos⁡(π/2)=0\cos(\pi/2) = 0cos(π/2)=0, their dot product must be zero:

v⋅w=0  ⟺  v and w are orthogonal\mathbf v \cdot \mathbf w = 0 \iff \mathbf v \text{ and } \mathbf w \text{ are orthogonal}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\mathbf w\ne\mathbf 0w=0. We can answer a practical question: how much of a vector v\mathbf vv points in the direction of w\mathbf ww?

Imagine dropping a perpendicular line from the tip of v\mathbf vv straight onto the line containing w\mathbf ww. This casts a "shadow" along w\mathbf ww. We can describe this shadow in two ways:

  1. Scalar projection (comp⁡wv\operatorname{comp}_{\mathbf w}\mathbf vcompw​v): This is the signed length of the shadow: comp⁡wv=v⋅w∥w∥\operatorname{comp}_{\mathbf w}\mathbf v = \frac{\mathbf v \cdot \mathbf w}{\|\mathbf w\|}compw​v=∥w∥v⋅w​ If v≠0\mathbf v\ne\mathbf0v=0 as well and θ\thetaθ is the angle between the vectors, this also equals ∥v∥cos⁡θ\|\mathbf v\|\cos\theta∥v∥cosθ. It is positive if the shadow points in the same general direction as w\mathbf ww, and negative if it points in the opposite direction.

  2. Vector projection (proj⁡wv\operatorname{proj}_{\mathbf w}\mathbf vprojw​v): 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\mathbf ww: proj⁡wv=(v⋅w∥w∥)(w∥w∥)=v⋅w∥w∥2w\operatorname{proj}_{\mathbf w}\mathbf v = \left(\frac{\mathbf v \cdot \mathbf w}{\|\mathbf w\|}\right)\left(\frac{\mathbf w}{\|\mathbf w\|}\right) = \frac{\mathbf v \cdot \mathbf w}{\|\mathbf w\|^2}\mathbf wprojw​v=(∥w∥v⋅w​)(∥w∥w​)=∥w∥2v⋅w​w

A reliable check on your work is that proj⁡wv\operatorname{proj}_{\mathbf w}\mathbf vprojw​v must always end up as a scalar multiple of w\mathbf ww, because its entire purpose is to represent the part of v\mathbf vv that lies directly along w\mathbf ww.

Source: https://notes.ohevan.com/notes/intermediate-calculus/04-vectors-and-geometry

© 2026 Evan Luo. All rights reserved.

Back to Intermediate Calculus

0 reads

·Last edited Today
  • stay up to date

  • about me

  • coffee

© 2026 Evan Luo. All rights reserved.