MULTIVARIABLE CALCULUS • VECTORS AND GEOMETRY IN 3D

Distances & Angles: Lines/Planes — Distances and angles between lines/planes (intro)

Learn how vectors unlock the measurement of distances and angles between lines and planes in three-dimensional space.

Historical Context & Motivation

Humans have been measuring distances and angles since ancient civilizations built pyramids and mapped the stars. In two dimensions, these measurements are fairly intuitive — you can simply drop a perpendicular from a point to a line and measure with a ruler. But when we step into three-dimensional space, things become much more complex. Lines can twist past each other without ever meeting, and planes can tilt at countless angles. The mathematical tools to handle these 3D relationships developed over centuries, driven by problems in navigation, architecture, and eventually physics and engineering.

~300 BCE
Euclid's Elements
Euclid formalized the geometry of points, lines, and planes. His work included the notion of perpendicular distance and the angles formed by intersecting lines, laying the groundwork for all future geometric reasoning.
1637
Descartes & Coordinate Geometry
René Descartes introduced coordinate systems, allowing geometric objects like lines and planes to be described with algebraic equations. This fusion of algebra and geometry made distance and angle calculations systematic.
1843
Hamilton & Vectors
William Rowan Hamilton developed quaternions, and soon after, Josiah Willard Gibbs refined the modern vector notation we use today. Vectors provided elegant formulas for distances and angles in any number of dimensions.
1900s
Modern Applications
With the rise of computer graphics, robotics, and aerospace engineering, computing distances and angles between 3D objects became essential. Every 3D video game, GPS system, and autopilot relies on these exact calculations.

The core question this lesson addresses is: given two lines or planes floating in 3D space, how do we precisely compute the shortest distance between them and the angle at which they meet? Unlike flat geometry where two lines either intersect or are parallel, three-dimensional lines can be skew — meaning they pass by each other without intersecting and without being parallel. The tools of vectors and the dot product give us clean, powerful formulas for all of these measurements.

Core Principles & Definitions

Before jumping into formulas, you need to understand the key building blocks. A line in 3D is defined by a point it passes through and a direction vector that tells you which way it goes. A plane is defined by a point on it and a normal vector — a vector that sticks straight out of the plane like a flagpole sticking out of a tabletop. These vectors are the key ingredients in every distance and angle formula you will learn.

1

Direction Vector

A vector d⃗ that points along a line. Any scalar multiple of d⃗ also serves as a direction vector for the same line.
2

Normal Vector

A vector n⃗ that is perpendicular to every vector lying in a plane. It uniquely determines the plane's orientation in space.
3

Dot Product

The operation a⃗ · b⃗ = |a⃗||b⃗|cos θ measures how much two vectors point in the same direction. It's the tool behind every angle formula.
4

Cross Product

The operation a⃗ × b⃗ produces a vector perpendicular to both a⃗ and b⃗. Its magnitude equals the area of the parallelogram they span, which is key for distance formulas.
5

Skew Lines

Two lines in 3D that are neither parallel nor intersecting. They exist at different "levels" in space. Finding the distance between skew lines requires special vector techniques.
KEY TAKEAWAY
Think of the normal vector as a flagpole on a flat table. The flagpole's direction tells you the table's tilt, and any measurement of distance or angle to the table depends on that flagpole. Similarly, a line's direction vector is like the direction a car drives — knowing the car's heading lets you compute how sharply two roads cross and how far apart parallel roads are.

Visual Explanation — Lines & Planes in 3D

The diagram below shows the three fundamental relationships between lines and planes in 3D space. Study it carefully — each case has its own distance and angle formula, and understanding the geometry visually is the first step toward applying the math.

Three configurations: intersecting lines (left) with angle θ between direction vectors, skew lines (center) with shortest distance d shown as a dashed segment, and point-to-plane distance (right) found by projecting onto the normal vector n⃗.

In the left panel, two lines actually cross each other, so the distance between them is zero. The angle between them comes from their direction vectors using the dot product. In the center panel, the two lines are skew — they never meet and are not parallel. The shortest distance between them (the dashed yellow segment) requires the cross product. In the right panel, we measure the perpendicular distance from a point P down to a plane by projecting onto the plane's normal vector. These three scenarios are the foundation of everything in this lesson.

Mathematical Framework

Now let's formalize each scenario with precise formulas. Every formula below uses vector operations you already know — the dot product, cross product, and vector magnitude. The trick is knowing which operation to apply for each situation.

Angle Between Two Lines

ANGLE BETWEEN LINES
cos θ = |d⃗₁ · d⃗₂| / (|d⃗₁| × |d⃗₂|)
Where d⃗₁ and d⃗₂ are the direction vectors of the two lines, and θ is the acute angle between them. The absolute value ensures we always get the acute angle (0° ≤ θ ≤ 90°).

Angle Between Two Planes

ANGLE BETWEEN PLANES
cos θ = |n⃗₁ · n⃗₂| / (|n⃗₁| × |n⃗₂|)
Where n⃗₁ and n⃗₂ are the normal vectors of the two planes. This formula is identical in structure to the line angle formula — just swap direction vectors for normal vectors.

Distance from a Point to a Plane

POINT-TO-PLANE DISTANCE
d = |ax₀ + by₀ + cz₀ + D| / √(a² + b² + c²)
Where the plane is ax + by + cz + D = 0 and the point is P = (x₀, y₀, z₀). The vector ⟨a, b, c⟩ is the plane's normal. The absolute value ensures the distance is always positive.

Distance Between Skew Lines

SKEW LINE DISTANCE
d = |P₁P₂⃗ · (d⃗₁ × d⃗₂)| / |d⃗₁ × d⃗₂|
Where P₁ and P₂ are points on lines L₁ and L₂ respectively, d⃗₁ and d⃗₂ are their direction vectors, and P₁P₂⃗ = P₂ − P₁ is the vector connecting one point on each line.
💡 Why the Absolute Value?
In angle formulas, we use |d⃗₁ · d⃗₂| (with absolute value) because a direction vector can point either way along a line. The angle between two lines is always taken as the acute angle (between 0° and 90°). Without the absolute value, you might accidentally get the obtuse supplementary angle. In distance formulas, the absolute value ensures distance is never negative.

Detailed Breakdown — How Each Formula Works

Let's look more deeply at why the skew line distance formula works, since it is the most complex formula in this lesson. The idea is geometric: the cross product d⃗₁ × d⃗₂ gives a vector that is perpendicular to both lines simultaneously. If you project the vector connecting any point on L₁ to any point on L₂ onto this perpendicular direction, that projection length is the shortest distance between the two lines. The diagram below illustrates this projection.

The cross product d⃗₁ × d⃗₂ (yellow arrow) is perpendicular to both lines. Projecting the connecting vector P₁P₂⃗ onto that perpendicular direction gives the shortest distance d between the two skew lines.

The beauty of this approach is that it does not matter which specific points P₁ and P₂ you choose on the lines. The projection onto the perpendicular direction always yields the same distance, because sliding a point along its line only adds a component parallel to that line — and any parallel component is annihilated by the dot product with the perpendicular cross-product vector.

Summary of which formula and vector each scenario requires
ScenarioFormula UsesKey Vector
Angle between two linesDot product of direction vectorsd⃗₁, d⃗₂
Angle between two planesDot product of normal vectorsn⃗₁, n⃗₂
Point to plane distanceProjection onto normal vectorn⃗
Skew line distanceCross product + scalar projectiond⃗₁ × d⃗₂
Parallel plane distancePoint-to-plane with any pointShared n⃗

Worked Example

Let's work through two complete examples: first finding the distance from a point to a plane, then finding the distance between two skew lines.

Example A: Point-to-Plane Distance

Find the distance from P = (3, −1, 2) to the plane 2x − y + 2z − 4 = 0
1
Step 1 — Identify the componentsFrom the plane equation 2x − y + 2z − 4 = 0, we read off the normal vector n⃗ = ⟨2, −1, 2⟩ and D = −4. The point is P = (x₀, y₀, z₀) = (3, −1, 2).
2
Step 2 — Plug into the formulaUsing d = |ax₀ + by₀ + cz₀ + D| / √(a² + b² + c²), we compute the numerator: |2(3) + (−1)(−1) + 2(2) + (−4)| = |6 + 1 + 4 − 4| = |7| = 7.
Numerator = 7
3
Step 3 — Compute the denominatorThe denominator is the magnitude of the normal vector: √(2² + (−1)² + 2²) = √(4 + 1 + 4) = √9 = 3.
Denominator = 3
4
Step 4 — Calculate the distanced = 7 / 3 ≈ 2.33 units. This is the perpendicular distance from the point to the plane.
d = 7/3 ≈ 2.33

Example B: Distance Between Skew Lines

Find the distance between L₁: (1,0,−1) + t⟨1,2,1⟩ and L₂: (0,1,0) + s⟨2,1,−1⟩
1
Step 1 — Identify direction vectors and a connecting vectorDirection vectors: d⃗₁ = ⟨1, 2, 1⟩ and d⃗₂ = ⟨2, 1, −1⟩. Points on each line: P₁ = (1, 0, −1) and P₂ = (0, 1, 0). So P₁P₂⃗ = P₂ − P₁ = ⟨−1, 1, 1⟩.
2
Step 2 — Compute the cross product d⃗₁ × d⃗₂d⃗₁ × d⃗₂ = |i j k; 1 2 1; 2 1 −1| = i(2×(−1) − 1×1) − j(1×(−1) − 1×2) + k(1×1 − 2×2) = i(−2 − 1) − j(−1 − 2) + k(1 − 4) = ⟨−3, 3, −3⟩.
d⃗₁ × d⃗₂ = ⟨−3, 3, −3⟩
3
Step 3 — Compute the magnitude of the cross product|d⃗₁ × d⃗₂| = √((−3)² + 3² + (−3)²) = √(9 + 9 + 9) = √27 = 3√3.
|d⃗₁ × d⃗₂| = 3√3
4
Step 4 — Take the scalar projectionP₁P₂⃗ · (d⃗₁ × d⃗₂) = ⟨−1, 1, 1⟩ · ⟨−3, 3, −3⟩ = (−1)(−3) + (1)(3) + (1)(−3) = 3 + 3 − 3 = 3.
Dot product = 3
5
Step 5 — Calculate the distanced = |3| / 3√3 = 3 / (3√3) = 1/√3 = √3/3 ≈ 0.577 units.
d = √3/3 ≈ 0.577

Strengths, Limitations & Common Pitfalls

The vector-based formulas in this lesson are powerful and general, but there are several common mistakes students make. Understanding both the strengths and pitfalls of these methods helps you apply them confidently.

Strengths and common pitfalls of vector distance and angle methods
StrengthsLimitations / Pitfalls
Works in any number of dimensions (just extend the vectors)Cross product is only defined in 3D, so the skew-line formula doesn't generalize directly
Gives exact answers, not approximationsForgetting absolute values can give a negative "distance" or the obtuse angle
Doesn't require finding the actual closest pointsIf the cross product is the zero vector, the lines are parallel (not skew) — you must use a different method
Formulas are compact and easy to memorizeMixing up normal vectors vs. direction vectors leads to wrong answers
Angles and distances can be computed independentlyArithmetic errors in 3D cross products are very common — check each component carefully
⚠️ WATCH OUT
The most common error is applying the skew line formula when lines are actually parallel. If d⃗₁ × d⃗₂ = ⟨0, 0, 0⟩, the lines are parallel and you should instead pick any point on one line and use the point-to-line distance formula. Always check whether the cross product is zero before dividing by it!

Connection to Advanced Topics

The techniques you learned here are the starting point for much deeper topics in multivariable calculus, linear algebra, and applied mathematics. As you advance, the same ideas appear in more sophisticated settings.

How introductory concepts extend to advanced mathematics and science
This Lesson (Intro)Advanced Extension
Distance from a point to a planeDistance from a point to a surface (requires calculus — minimize a distance function)
Angle between two planesDihedral angles in molecular chemistry and crystal structures
Skew line distance in 3DClosest approach of trajectories in physics (e.g., satellite paths)
Perpendicular projection onto normalOrthogonal projections in linear algebra (projecting onto subspaces)

In college-level linear algebra, you'll see that projecting one vector onto another is a core operation used in everything from machine learning to signal processing. The idea of "drop a perpendicular" that underlies every formula in this lesson is the geometric heart of all these applications. In physics, the skew line distance formula is exactly what engineers use to compute the closest approach of two objects moving along straight-line paths — like two aircraft or two satellites.

🔭 Looking Ahead
In your next lesson, you'll explore how to find the line of intersection of two planes and the angle between a line and a plane (not two lines or two planes, but one of each). These build directly on the dot product and cross product skills from today's lesson.

Practice Problems

Test your understanding with these five problems. They increase in difficulty, so start at the top and work your way down.

PROBLEM 1CONCEPTUAL
Explain in your own words why the angle between two lines in 3D is always taken to be between 0° and 90° (inclusive), rather than allowing angles up to 180°. What would go wrong if you didn't use the absolute value in the formula?
PROBLEM 2BASIC CALCULATION
Find the distance from the point P = (1, 3, −2) to the plane 3x + 4y − 12z + 5 = 0.
PROBLEM 3INTERMEDIATE
Find the angle between the two planes: π₁: 2x − y + z = 4 and π₂: x + y − z = 1. Give your answer in degrees, rounded to one decimal place.
PROBLEM 4APPLIED
Two power cables run through the air along straight lines. Cable A passes through (2, 0, 3) in the direction ⟨1, 1, 0⟩, and Cable B passes through (0, 2, 1) in the direction ⟨0, 1, 1⟩. A maintenance worker needs to know the shortest distance between the two cables. Find it.
PROBLEM 5CRITICAL THINKING
Two planes are parallel: π₁: 4x − 2y + 4z = 8 and π₂: 2x − y + 2z = 1. Find the distance between them. (Hint: since they are parallel, you can pick any point on one plane and find its distance to the other.)

Lesson Summary

In this lesson, you learned how to measure distances and angles between lines and planes in 3D space using vector operations. The dot product is the essential tool for computing angles — between two lines (using their direction vectors) or between two planes (using their normal vectors). The absolute value in the angle formula guarantees the acute angle is always returned.

For distances, the point-to-plane distance formula projects a connecting vector onto the plane's normal. The skew line distance formula uses the cross product to find a direction perpendicular to both lines, then projects the connecting vector onto that direction. Always verify that lines are actually skew (cross product ≠ zero) before applying the skew line formula. These vector-based methods extend naturally to problems in physics, computer graphics, and engineering.

Varsity Tutors • Multivariable Calculus • Distances & Angles: Lines/Planes