Precalculus / Calculus 3

3D Vectors and Space

Vectors in three dimensions, dot product, cross product, equations of lines and planes in 3D space — the complete guide for precalculus and multivariable calculus.

The 3D Coordinate System

Three-dimensional space is described by three mutually perpendicular axes: x, y, and z. Every point is an ordered triple (x, y, z). The three coordinate planes — the xy-plane, xz-plane, and yz-plane — divide space into eight octants.

xy-Plane

z = 0

Contains all points where z = 0. Equivalent to the familiar 2D coordinate plane.

xz-Plane

y = 0

Contains all points where y = 0. Extends along the x and z directions.

yz-Plane

x = 0

Contains all points where x = 0. The plane you see when looking along the positive x-axis.

Distance Between Two Points in 3D

The distance between P₁(x₁, y₁, z₁) and P₂(x₂, y₂, z₂) extends the Pythagorean theorem into three dimensions:

d = √((x₂ − x₁)² + (y₂ − y₁)² + (z₂ − z₁)²)

Example: distance from (1, 2, 3) to (4, 6, 3): d = √(9 + 16 + 0) = √25 = 5

Vector Operations in 3D

A vector v = (a, b, c) = ai + bj + ck has components a, b, c along the x, y, z axes respectively.

Vector Addition

(a₁, b₁, c₁) + (a₂, b₂, c₂) = (a₁+a₂, b₁+b₂, c₁+c₂)

Add corresponding components. Geometrically this is the tip-to-tail rule: place the tail of the second vector at the tip of the first.

(1, 2, 3) + (4, −1, 2) = (5, 1, 5)

Scalar Multiplication

c · (a, b, d) = (ca, cb, cd)

Multiply each component by the scalar c. Positive c scales the vector; negative c reverses direction and scales.

3 · (2, −1, 4) = (6, −3, 12)

Vector Subtraction

a − b = a + (−b)

Subtract corresponding components. The vector from point A to point B is B − A (not A − B).

(5, 3, 1) − (2, 7, −1) = (3, −4, 2)

Magnitude (Length)

|v| = √(a² + b² + c²)

The length of the vector, always non-negative. Zero only for the zero vector (0, 0, 0).

|(3, 4, 0)| = √(9 + 16 + 0) = 5

Unit Vector

û = v / |v|

Divide each component by the magnitude to get a vector of length 1 pointing in the same direction.

v = (2, −1, 2): |v| = 3, û = (2/3, −1/3, 2/3)

Dot Product

The dot product (also called the scalar product or inner product) takes two vectors and returns a single number. It encodes the angle between the vectors.

a · b = a₁b₁ + a₂b₂ + a₃b₃ = |a||b|cos(θ)

a · b > 0

Angle between the vectors is acute (0° < θ < 90°). The vectors point generally in the same direction.

a · b = 0

The vectors are orthogonal (perpendicular). The angle between them is exactly 90°.

a · b < 0

Angle between the vectors is obtuse (90° < θ < 180°). The vectors point generally in opposite directions.

a · b = |a||b|

The vectors are parallel and pointing in the same direction. θ = 0° and cos(0°) = 1.

Finding the Angle Between Vectors

θ = arccos( (a · b) / (|a| |b|) )

The result is always in [0°, 180°]. Compute the dot product, divide by the product of the magnitudes, then take the inverse cosine.

Projection of a onto b

proj_b(a) = (a · b / |b|²) · b

The scalar projection (component of a along b) is comp_b(a) = a · b / |b|. The vector projection is that scalar times the unit vector b̂.

Dot Product Properties

  • Commutative: a · b = b · a
  • Distributive: a · (b + c) = a · b + a · c
  • Scalar factor: (ca) · b = c(a · b)
  • Self-dot product: a · a = |a|²

Cross Product

The cross product a × b produces a new vector perpendicular to both a and b. Its magnitude equals the area of the parallelogram spanned by the two vectors. The cross product is only defined in three dimensions.

a = (a₁, a₂, a₃), b = (b₁, b₂, b₃)

a × b = (a₂b₃ − a₃b₂,  a₃b₁ − a₁b₃,  a₁b₂ − a₂b₁)

Determinant Method (3×3)

Expand the determinant of the 3×3 matrix with i, j, k in the first row:

| i   j   k |

| a₁ a₂ a₃ |

| b₁ b₂ b₃ |

= i(a₂b₃ − a₃b₂) − j(a₁b₃ − a₃b₁) + k(a₁b₂ − a₂b₁)

Right-Hand Rule

Point fingers of your right hand in the direction of a, curl them toward b. Your thumb points in the direction of a × b. Swapping order reverses direction: b × a = −(a × b).

Area of Parallelogram

The area of the parallelogram with sides a and b equals |a × b| = |a||b|sin(θ). The area of the triangle formed by a and b is half that: (1/2)|a × b|.

Standard Unit Vector Cross Products

Cross ProductResultCross ProductResult
i × jkj × i−k
j × kik × j−i
k × iji × k−j
i × i0j × j0

Cyclic rule: i → j → k → i gives positive cross products; reversing gives negative.

Equations of Lines in 3D

A line in 3D space is determined by a point on it and a direction vector. Unlike 2D, you cannot describe a line with a single equation — you need parametric or symmetric form.

Parametric Equations

Line through P₀(x₀, y₀, z₀) with direction vector d = (a, b, c):

x = x₀ + at

y = y₀ + bt

z = z₀ + ct

The parameter t ranges over all real numbers. At t = 0 you get the starting point P₀; as t increases or decreases you move along the line.

Symmetric Equations

Solve each parametric equation for t and set the expressions equal:

(x − x₀)/a = (y − y₀)/b = (z − z₀)/c

If any direction component is 0 (say b = 0), that coordinate is fixed: y = y₀, and the other two form a ratio. Direction vectors for parallel lines are scalar multiples of each other.

Finding the Direction Vector

Any non-zero scalar multiple of d works as a direction vector. Common sources:

  • Given directly in the problem
  • Difference of two points on the line: d = P₂ − P₁
  • The normal to two planes whose intersection is the line: d = n₁ × n₂

Equations of Planes in 3D

A plane in 3D space is determined by a normal vector (perpendicular to the plane) and any point on the plane. Unlike a line, a plane can be described by a single equation.

Normal Vector Form (Point-Normal)

Plane with normal n = (a, b, c) through point P₀(x₀, y₀, z₀):

a(x − x₀) + b(y − y₀) + c(z − z₀) = 0

Simplified: ax + by + cz = d

Where d = ax₀ + by₀ + cz₀. The coefficients (a, b, c) of x, y, z are always the components of the normal vector.

Intercept Form

If the plane crosses the axes at (p, 0, 0), (0, q, 0), and (0, 0, r), then:

x/p + y/q + z/r = 1

Useful when intercepts are given or easily read. Multiply through to put in standard form.

Plane Through Three Points

Given three non-collinear points A, B, C:

  1. Form two vectors: AB = B − A and AC = C − A
  2. Find normal: n = AB × AC
  3. Use point-normal form with n and any of the three points

Parallel Planes

Two planes are parallel if and only if their normal vectors are parallel (scalar multiples). Example: 2x + y − 3z = 4 and 4x + 2y − 6z = 1 are parallel (normals (2,1,−3) and (4,2,−6) = 2(2,1,−3)).

Perpendicular Planes

Two planes are perpendicular if and only if their normal vectors are orthogonal (dot product = 0). The line of intersection of two perpendicular planes has direction vector n₁ × n₂.

Distance from a Point to a Plane

The shortest distance from a point to a plane is measured along the normal direction.

D = |ax₁ + by₁ + cz₁ + d| / √(a² + b² + c²)

For point P₁(x₁, y₁, z₁) and plane ax + by + cz + d = 0 (note: bring d to the left side first):

  1. Write the plane in the form ax + by + cz + d = 0 (move the constant to the left)
  2. Compute the numerator: |ax₁ + by₁ + cz₁ + d| (take absolute value)
  3. Compute the denominator: √(a² + b² + c²) (magnitude of the normal vector)
  4. Divide numerator by denominator

Example: Distance from (1, 2, 3) to plane 2x − y + 2z = 5

Rewrite: 2x − y + 2z − 5 = 0, so a=2, b=−1, c=2, d=−5

Numerator: |2(1) + (−1)(2) + 2(3) − 5| = |2 − 2 + 6 − 5| = 1

Denominator: √(4 + 1 + 4) = √9 = 3

Distance = 1/3

Worked Examples

Example 1 — Dot Product and Angle Between Vectors

a = (3, −1, 2), b = (1, 4, −2)

Step 1: Dot product: 3(1) + (−1)(4) + 2(−2) = 3 − 4 − 4 = −5

Step 2: |a| = √(9 + 1 + 4) = √14

Step 3: |b| = √(1 + 16 + 4) = √21

Step 4: cos(θ) = −5 / (√14 · √21) = −5 / √294

Step 5: θ = arccos(−5 / √294) ≈ arccos(−0.2915) ≈ 106.9°

The angle is approximately 107°. Since a · b < 0, the angle is obtuse ✓

Example 2 — Cross Product and Area of a Parallelogram

a = (1, 2, 0), b = (3, 0, 4)

Cross product components:

i: (2)(4) − (0)(0) = 8

j: −[(1)(4) − (0)(3)] = −4

k: (1)(0) − (2)(3) = −6

a × b = (8, −4, −6)

Verify orthogonality: (8,−4,−6)·(1,2,0) = 8 − 8 + 0 = 0 ✓

                      (8,−4,−6)·(3,0,4) = 24 + 0 − 24 = 0 ✓

|a × b| = √(64 + 16 + 36) = √116 = 2√29 ≈ 10.77

Area of parallelogram ≈ 10.77. Area of triangle = 5.39.

Example 3 — Line Through Two Points in 3D

Points: A(1, −1, 2) and B(3, 3, 0)

Direction vector: d = B − A = (2, 4, −2) = 2(1, 2, −1)

Use simplified direction (1, 2, −1) and point A(1, −1, 2):

Parametric:

x = 1 + t, y = −1 + 2t, z = 2 − t

Symmetric:

(x − 1)/1 = (y + 1)/2 = (z − 2)/(−1)

Verify B: t = 2 → x=3, y=3, z=0 = B ✓

Example 4 — Plane Through Three Points

A(2, 0, 0), B(0, 3, 0), C(0, 0, 4)

AB = B − A = (−2, 3, 0)

AC = C − A = (−2, 0, 4)

Normal n = AB × AC:

i: (3)(4) − (0)(0) = 12

j: −[(−2)(4) − (0)(−2)] = 8

k: (−2)(0) − (3)(−2) = 6

n = (12, 8, 6) = 2(6, 4, 3)

Using n = (6, 4, 3) and A(2, 0, 0):

6(x−2) + 4y + 3z = 0 → 6x + 4y + 3z = 12

Plane: 6x + 4y + 3z = 12. Verify: B: 0+12+0=12 ✓, C: 0+0+12=12 ✓

Example 5 — Orthogonal Vectors and Projection

Find the projection of a = (1, 3, 2) onto b = (2, 1, −1)

a · b = 2 + 3 − 2 = 3

|b|² = 4 + 1 + 1 = 6

Scalar projection: comp_b(a) = 3/√6 = √6/2 ≈ 1.22

Vector projection: (3/6) · (2, 1, −1) = (1/2)(2, 1, −1) = (1, 1/2, −1/2)

Orthogonal component: a − proj = (1−1, 3−1/2, 2+1/2) = (0, 5/2, 5/2)

Verify orthogonality: (0, 5/2, 5/2)·(2, 1, −1) = 0 + 5/2 − 5/2 = 0 ✓

Quick Reference: Key Formulas

ConceptFormulaNotes
Magnitude|v| = √(a²+b²+c²)Always ≥ 0
Dot Producta·b = a₁b₁+a₂b₂+a₃b₃Scalar result
Angleθ = arccos(a·b / |a||b|)0° ≤ θ ≤ 180°
Cross Producta×b = (a₂b₃−a₃b₂, a₃b₁−a₁b₃, a₁b₂−a₂b₁)Vector result
Area Parallelogram|a×b|= |a||b|sin(θ)
Line (parametric)r = r₀ + tdt ∈ ℝ
Line (symmetric)(x−x₀)/a = (y−y₀)/b = (z−z₀)/cDirection (a,b,c)
Planea(x−x₀) + b(y−y₀) + c(z−z₀) = 0Normal (a,b,c)
Point-to-Plane Dist|ax₁+by₁+cz₁+d| / √(a²+b²+c²)Plane: ax+by+cz+d=0
Vector Projectionproj_b(a) = (a·b/|b|²)bOnto vector b

Frequently Asked Questions

What is a vector in three dimensions?

A vector in three dimensions is a quantity with both magnitude and direction, represented as an ordered triple (a, b, c) or in component form as v = ai + bj + ck, where i = (1,0,0), j = (0,1,0), and k = (0,0,1) are the standard unit vectors along the x, y, and z axes. The scalars a, b, c are the components of the vector. For example, the vector from point P(1, 2, 3) to point Q(4, 0, 7) is PQ = (4−1, 0−2, 7−3) = (3, −2, 4). This is different from a point: vectors have direction and magnitude but no fixed position.

How do you calculate the magnitude (length) of a 3D vector?

The magnitude (or length) of a vector v = (a, b, c) is |v| = √(a² + b² + c²). This is the 3D version of the Pythagorean theorem applied twice. Example: for v = (2, −3, 6), |v| = √(4 + 9 + 36) = √49 = 7. A unit vector in the same direction is obtained by dividing each component by the magnitude: û = v / |v| = (2/7, −3/7, 6/7). Unit vectors always have magnitude 1 and are used to describe direction alone.

What is the dot product and what does it measure?

The dot product of two vectors a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃) is a · b = a₁b₁ + a₂b₂ + a₃b₃. The result is a scalar (a number, not a vector). The dot product equals |a||b|cos(θ) where θ is the angle between the vectors. This means: if a · b = 0, the vectors are perpendicular (orthogonal); if a · b > 0, the angle between them is acute (less than 90°); if a · b < 0, the angle is obtuse (greater than 90°). Example: a = (1, 2, 3), b = (4, −1, 2) → a · b = 4 − 2 + 6 = 8.

How do you find the angle between two 3D vectors?

Use the dot product formula: cos(θ) = (a · b) / (|a| |b|), then θ = arccos((a · b) / (|a| |b|)). The angle θ always satisfies 0 ≤ θ ≤ π (0° to 180°). Example: a = (1, 0, 1) and b = (0, 1, 1). Dot product: 0 + 0 + 1 = 1. |a| = √2, |b| = √2. cos(θ) = 1/(√2 · √2) = 1/2. θ = arccos(1/2) = 60°. For orthogonal (perpendicular) vectors the angle is 90° and the dot product is 0. For parallel vectors the angle is 0° or 180°.

What is the cross product and how is it different from the dot product?

The cross product a × b produces a vector (not a scalar) that is perpendicular to both a and b. For a = (a₁, a₂, a₃) and b = (b₁, b₂, b₃), the cross product is a × b = (a₂b₃ − a₃b₂, a₃b₁ − a₁b₃, a₁b₂ − a₂b₁). The magnitude |a × b| = |a||b|sin(θ) equals the area of the parallelogram spanned by a and b. Key differences: the dot product is a scalar and measures how parallel two vectors are; the cross product is a vector and measures how perpendicular they are. The cross product is only defined in 3D (and 7D). The direction of a × b follows the right-hand rule.

What is the right-hand rule for the cross product?

The right-hand rule determines the direction of the cross product a × b. Point the fingers of your right hand in the direction of a, then curl them toward b (through the smaller angle between them). Your thumb points in the direction of a × b. Consequence: a × b = −(b × a), so the cross product is anti-commutative — swapping the order reverses the direction. For the standard unit vectors: i × j = k, j × k = i, k × i = j. If you reverse the order: j × i = −k, k × j = −i, i × k = −j. Memorize these using the cyclic pattern i → j → k → i.

How do you write parametric and symmetric equations of a line in 3D?

A line through point P₀(x₀, y₀, z₀) with direction vector d = (a, b, c) has parametric equations: x = x₀ + at, y = y₀ + bt, z = z₀ + ct, where t is a real-number parameter. To eliminate t, solve each equation for t and set them equal: (x − x₀)/a = (y − y₀)/b = (z − z₀)/c. These are the symmetric equations. Example: line through (2, −1, 3) with direction (4, 2, −1): parametric: x = 2 + 4t, y = −1 + 2t, z = 3 − t. Symmetric: (x−2)/4 = (y+1)/2 = (z−3)/(−1). If any direction component is 0, that variable is set equal to that constant instead of forming a fraction.

How do you find the equation of a plane in 3D?

A plane is determined by a normal vector n = (a, b, c) (perpendicular to the plane) and a point P₀(x₀, y₀, z₀) on it. The equation is a(x − x₀) + b(y − y₀) + c(z − z₀) = 0, which simplifies to ax + by + cz = d where d = ax₀ + by₀ + cz₀. To find a plane through three non-collinear points P, Q, R: form two vectors PQ and PR, then compute the normal n = PQ × PR. Example: plane through (1, 0, 0), (0, 1, 0), (0, 0, 1). PQ = (−1,1,0), PR = (−1,0,1). n = PQ × PR = (1,1,1). Equation: (x−1) + y + z = 0 → x + y + z = 1.

How do you find the distance from a point to a plane?

The distance from point P₁(x₁, y₁, z₁) to the plane ax + by + cz + d = 0 is D = |ax₁ + by₁ + cz₁ + d| / √(a² + b² + c²). The denominator is just the magnitude of the normal vector. Example: distance from (1, 2, 3) to the plane 2x − y + 2z = 5 (rewritten as 2x − y + 2z − 5 = 0). Numerator: |2(1) − 2 + 2(3) − 5| = |2 − 2 + 6 − 5| = |1| = 1. Denominator: √(4 + 1 + 4) = 3. Distance = 1/3. This formula is analogous to the 2D point-to-line distance formula.

Related Topics

Practice 3D Vectors

Interactive problems with step-by-step solutions and private tutoring — dot products, cross products, planes, and more. Free to try.

Start Practicing Free