Vectors in space
An arrow in the plane needs two numbers. A cable running from a lamp up to a ceiling hook needs three. Do length, adding, scaling and the angle test all carry over when the third number arrives?
Where you are 10 in Polar coordinates and vectors
Why this exists
Every vector so far has lived on a flat page: a run and a rise, \langle a, b \rangle. Real directions are rarely that flat. A cable from a lamp to a ceiling hook goes across, along and up at once, and a force pulling along that cable has a part in each of the three directions. Two numbers cannot describe it.
The fix costs one more number. A vector in space is written \langle a, b, c \rangle, and every tool of the plane survives the change: components from two points, length from the Pythagorean theorem, adding and scaling part by part, the dot product and the angle it gives, and the test for a right angle. This lesson recalls each 2D idea in one line and then does the 3D version.
Definition
Axes. Space gets three perpendicular number lines through an origin O, as in Coordinates and distance in three dimensions. They are set up as a right-hand system: curl the fingers of your right hand from the positive x-axis toward the positive y-axis, and your thumb points along the positive z-axis. In the figures here the y-axis runs right, the z-axis runs up, and the x-axis comes toward you, drawn slanting down and to the left. A point (a, b, c) is plotted by drawing the box with one corner at O and the opposite corner at the point: a along x, b along y, c up.
Components. In the plane, the component form lists the change in x and the change in y from tail to head. In space a vector \mathbf{v} lists three changes:
The vector from P(x_1, y_1, z_1) to Q(x_2, y_2, z_2) is head minus tail:
As in the plane, a vector has no fixed position: every arrow with the same three changes is the same vector. The zero vector is \mathbf{0} = \langle 0, 0, 0 \rangle.
Standard unit vectors. The plane had \mathbf{i} and \mathbf{j} (Unit vectors and i, j notation). Space adds a third, along the z-axis:
so that \langle a, b, c \rangle = a\mathbf{i} + b\mathbf{j} + c\mathbf{k}.
Dot product. In the plane, multiply matching components and add. In space there are three pairs:
Intuition
The vector \mathbf{v} = \langle 2, 6, 3 \rangle, drawn from the origin, is the long diagonal of a box 2 deep, 6 wide and 3 tall. Its length comes in two steps. Across the floor, from O to the corner (2, 6, 0) under the tip, is the hypotenuse of a right triangle with legs 2 and 6, so its square is 4 + 36 = 40. That floor diagonal and the upright edge of 3 meet at a right angle, since the edge stands straight up from the floor. So
The figure is a slanted drawing, so lengths on the page are not true lengths: the x-edge is drawn at half length. Always compute; never measure the picture.
Results
Magnitude. As in Magnitude and direction of a vector, length is the square root of the sum of the squared components, now with three terms:
Scaling and adding. Scalar multiples and sums (tip to tail) work component by component:
and \|k\mathbf{v}\| = |k|\,\|\mathbf{v}\|. For a nonzero \mathbf{v}, the unit vector in its direction is \dfrac{\mathbf{v}}{\|\mathbf{v}\|}.
Dot product and angle. For any \mathbf{v}, \mathbf{v} \cdot \mathbf{v} = \|\mathbf{v}\|^2. For nonzero \mathbf{u} and \mathbf{v} with angle \theta between them, 0^\circ \le \theta \le 180^\circ, the formula from The dot product and the angle between vectors holds unchanged:
Orthogonality. As in Orthogonal vectors, two nonzero vectors in space are perpendicular if and only if \mathbf{u} \cdot \mathbf{v} = 0.
Why it is true
Magnitude. Place \mathbf{v} = \langle a, b, c \rangle with its tail at O, so its tip is P(a, b, c). The point F(a, b, 0) lies directly under P. In the floor (z = 0), the triangle with corners O, (a, 0, 0) and F has a right angle at (a, 0, 0), so OF^2 = a^2 + b^2. The segment FP is vertical, and a vertical line is perpendicular to every line in the floor, so the triangle OFP has a right angle at F and
This is the The Pythagorean theorem in three dimensions, used twice.
Scaling and adding. Each component is a change along one axis, and the changes along different axes do not interact. Following \mathbf{u} then \mathbf{v} changes x by u_1 + v_1, and so on. Stretching by k multiplies every change by k. Then \displaystyle \|k\mathbf{v}\| = \sqrt{k^2(a^2 + b^2 + c^2)} = |k|\,\|\mathbf{v}\|.
The angle formula. Put \mathbf{u} and \mathbf{v} tail to tail. Two arrows from one point lie in a single plane, so the triangle with sides \mathbf{u}, \mathbf{v} and \mathbf{u} - \mathbf{v} is an ordinary flat triangle, and the law of cosines applies:
Expand the left side with the magnitude formula. Each component gives (u_i - v_i)^2 = u_i^2 - 2u_i v_i + v_i^2, so the left side is \|\mathbf{u}\|^2 + \|\mathbf{v}\|^2 - 2(u_1v_1 + u_2v_2 + u_3v_3). Cancel the squared lengths on both sides and divide by -2:
Orthogonality. Both lengths are positive, so the dot product is 0 exactly when \cos\theta = 0, and on [0^\circ, 180^\circ] that happens only at 90^\circ.
Worked examples
From two points to a unit vector
Find \overrightarrow{AB} for A(1, -2, 4) and B(7, -4, 7), its magnitude, and the unit vector in its direction. Write \overrightarrow{AB} with \mathbf{i}, \mathbf{j}, \mathbf{k}.
SolutionHead minus tail, coordinate by coordinate:
Its length is \displaystyle \sqrt{36 + 4 + 9} = \sqrt{49} = 7. Dividing by 7 scales the length to 1 without changing direction:
Check: \displaystyle \frac{36 + 4 + 9}{49} = 1. The vector \overrightarrow{BA} is \langle -6, 2, -3 \rangle, the same length pointing the other way.
Combining vectors
Brynhildur has \mathbf{u} = \langle 4, -1, 2 \rangle and \mathbf{v} = \langle -3, 2, 5 \rangle. (a) Find 2\mathbf{u} - 3\mathbf{v}. (b) Find \|\mathbf{u} + \mathbf{v}\| and compare it with \|\mathbf{u}\| + \|\mathbf{v}\|. (c) Find the vector of length 15 in the direction of \langle -2, 1, 2 \rangle.
Solution(a) Scale each vector, then add matching components:
(b) \mathbf{u} + \mathbf{v} = \langle 1, 1, 7 \rangle, so \displaystyle \|\mathbf{u} + \mathbf{v}\| = \sqrt{1 + 1 + 49} = \sqrt{51} \approx 7.14. Separately, \displaystyle \|\mathbf{u}\| = \sqrt{21} \approx 4.58 and \displaystyle \|\mathbf{v}\| = \sqrt{38} \approx 6.16, with sum about 10.75. The sum is shorter than the two legs together, as the Triangle inequality requires: \mathbf{u}, \mathbf{v} and \mathbf{u} + \mathbf{v} form a triangle.
(c) \displaystyle \|\langle -2, 1, 2 \rangle\| = \sqrt{4 + 1 + 4} = 3. Multiplying by 5 keeps the direction and makes the length 15: the vector is \langle -10, 5, 10 \rangle.
The angle between two vectors
Find the angle between \mathbf{u} = \langle 2, -1, 2 \rangle and \mathbf{v} = \langle 3, 0, 4 \rangle.
SolutionThe dot product is (2)(3) + (-1)(0) + (2)(4) = 14. The lengths are \displaystyle \|\mathbf{u}\| = \sqrt{9} = 3 and \displaystyle \|\mathbf{v}\| = \sqrt{25} = 5. So
using the inverse cosine of Inverse trig functions, whose outputs run from 0^\circ to 180^\circ, exactly the range of angles between vectors.
Testing for right angles
(a) Show that \langle 1, 2, 2 \rangle, \langle 2, 1, -2 \rangle and \langle 2, -2, 1 \rangle are pairwise orthogonal. (b) Find c so that \langle c, 2, -1 \rangle \perp \langle 3, c, 4 \rangle.
Solution(a) Three pairs, three dot products: 2 + 2 - 4 = 0, 2 - 4 + 2 = 0 and 4 - 2 - 2 = 0. All are zero, so the three arrows meet at right angles like the edges at the corner of a box, only tilted. Space has room for three mutually perpendicular directions; the plane has room for two.
(b) Orthogonal means the dot product is zero: 3c + 2c - 4 = 5c - 4 = 0, so \displaystyle c = \frac{4}{5}. Check: \displaystyle 3 \cdot \frac{4}{5} + 2 \cdot \frac{4}{5} - 4 = \frac{12}{5} + \frac{8}{5} - 4 = 0.
Two cables in an atrium
Romualdo hangs a lamp in an atrium. In meters, with the origin at a floor corner and z measured up, the lamp is at L(6, 8, 3) and its two cables run to anchors A(2, 4, 10) and B(10, 4, 10) on the ceiling. How long is each cable, what angle do the cables make with each other, and what angle does each make with the vertical?
SolutionMeasure both cables from the lamp:
Each has length \displaystyle \sqrt{16 + 16 + 49} = \sqrt{81} = 9 meters. Their dot product is -16 + 16 + 49 = 49, so
The vertical direction is \mathbf{k} = \langle 0, 0, 1 \rangle. Dotting with \mathbf{k} picks out the third component, so for either cable \displaystyle \cos\alpha = \frac{7}{9 \cdot 1} and \alpha \approx 38.9^\circ. The two cables lean the same amount, which fits the picture: A and B are mirror images across the plane x = 6 through the lamp.
Diagonals of a cube
Kjartan places a cube with one corner at the origin and edges of length 1 along the positive axes. (a) Find the angle between a space diagonal and an edge. (b) Find the angle between two space diagonals.
Solution(a) The diagonal from O to (1, 1, 1) is \langle 1, 1, 1 \rangle, of length \displaystyle \sqrt{3}, and the edge along the x-axis is \mathbf{i}. Then \displaystyle \cos\theta = \frac{1}{\sqrt{3}} and \theta \approx 54.7^\circ. By symmetry the diagonal makes this same angle with all three edges at the corner.
(b) The diagonal from (1, 0, 0) to (0, 1, 1) is \langle -1, 1, 1 \rangle. With \langle 1, 1, 1 \rangle the dot product is -1 + 1 + 1 = 1, so
Two diagonals of a square meet at 90^\circ; two diagonals of a cube do not. Without coordinates this angle is hard to find; with them it is one line of arithmetic.
Boundaries
- Handedness is a choice. Swapping two axis labels gives a left-hand system. Lengths, dot products and angles come out the same in either, but the direction of the cross product depends on it, so this course always uses the right-hand system.
- The zero vector has no direction. It has no unit vector, and the angle formula divides by \|\mathbf{0}\| = 0, so no angle is defined.
- No single direction angle. In the plane one angle from the x-axis fixes a direction. In space one angle is not enough: Example 5’s two cables make the same angle with the vertical yet point different ways.
- Orthogonal directions fill a plane. The vectors orthogonal to one nonzero vector in space are not all multiples of one vector, so the 2D swap-and-negate trick finds some but not all of them.
- Components combine only with matching length. \langle 1, 2 \rangle + \langle 1, 2, 3 \rangle is undefined. A plane vector can be treated as \langle a, b, 0 \rangle only by choosing to place the plane as the floor.
Where this goes next
The cross product takes two vectors in space and builds a third orthogonal to both, with a length equal to the area of the parallelogram they span; the right-hand system decides which way it points. Nothing in this lesson used the number three in an essential way: Vectors in n dimensions and Dot product, length and orthogonality in n dimensions carry components, length, the dot product and orthogonality into any number of coordinates, where there is no picture left to check against. The Vector and scalar projection of the plane carries over word for word as well.
Exercises
Points and components
- Find the component form and magnitude of \overrightarrow{PQ} for P(3, 5, -1) and Q(7, -3, 0).
- Write \langle -3, 0, 7 \rangle using \mathbf{i}, \mathbf{j}, \mathbf{k}, and write 5\mathbf{i} - 2\mathbf{k} in component form.
- Find \|\langle 12, -4, 3 \rangle\|.
- Find the unit vector in the direction of \langle 8, -4, 1 \rangle.
- The vector from A to B is \langle 3, -1, 5 \rangle, and B = (2, 2, 2). Find A.
- The box used to plot P(2, 6, 9) has O and P at opposite corners. Find the length of its floor diagonal from O and the length of \overrightarrow{OP}.
Scaling and adding
- For \mathbf{u} = \langle 1, -3, 4 \rangle and \mathbf{v} = \langle 2, 5, -2 \rangle, find \mathbf{u} + \mathbf{v}, 3\mathbf{u} - 2\mathbf{v} and \|\mathbf{u} - \mathbf{v}\|.
- Find the vector of length 12 that points opposite to \langle 2, -1, 2 \rangle.
- Find numbers s and t with s\langle 1, 2, 0 \rangle + t\langle 0, 1, 3 \rangle = \langle 2, 7, 9 \rangle.
- Find every k for which \|\langle k, k, 7 \rangle\| = 9.
Dot product and angles
- Find \langle 3, -2, 5 \rangle \cdot \langle 4, 6, -1 \rangle. Is the angle between the vectors acute, right or obtuse?
- Find the angle between \langle 1, 1, 0 \rangle and \langle 0, 1, 1 \rangle.
- Find the angle between \langle 2, 1, -2 \rangle and \langle 6, -3, 2 \rangle, to one decimal place.
- Find the angle between \langle 2, -3, 6 \rangle and the positive z-axis.
- Brynhildur marks P(2, 1, 0), Q(4, 3, 1) and R(0, 3, 1). Find \angle QPR.
- Kjartan’s unit cube has a face diagonal \langle 1, 1, 0 \rangle and a space diagonal \langle 1, 1, 1 \rangle from the same corner. Find the angle between them.
Orthogonality
- Are \langle 2, -3, 1 \rangle and \langle 4, 3, 1 \rangle orthogonal?
- Find c so that \langle c, 3, -2 \rangle \perp \langle 4, -2, c \rangle.
- Find two nonzero vectors orthogonal to \langle 1, 2, 3 \rangle, neither a multiple of the other.
- Show that the triangle A(1, 1, 1), B(3, 2, -1), C(2, 3, 3) has a right angle, and say where.
Reasoning
- Explain why the magnitude formula needs the Pythagorean theorem twice, and why each of the two triangles has a right angle.
- Prove that \|k\mathbf{v}\| = |k|\,\|\mathbf{v}\| for every vector \mathbf{v} in space and every real number k.
- Brynhildur says every vector orthogonal to \langle 1, 2, 3 \rangle is a multiple of one single vector, as in the plane. Use Exercise 19 to show she is wrong.
- Show that \mathbf{i}, \mathbf{j}, \mathbf{k} are pairwise orthogonal unit vectors, and that \mathbf{v} \cdot \mathbf{i}, \mathbf{v} \cdot \mathbf{j}, \mathbf{v} \cdot \mathbf{k} are the three components of \mathbf{v}.
Answers
- \langle 4, -8, 1 \rangle, magnitude 9. \displaystyle \sqrt{16 + 64 + 1} = \sqrt{81}.
- -3\mathbf{i} + 7\mathbf{k} and \langle 5, 0, -2 \rangle. A missing letter means a zero component.
- 13. \displaystyle \sqrt{144 + 16 + 9} = \sqrt{169}.
- \left\langle \tfrac{8}{9}, -\tfrac{4}{9}, \tfrac{1}{9} \right\rangle. The length is \displaystyle \sqrt{64 + 16 + 1} = 9.
- A = (-1, 3, -3). A = B - \langle 3, -1, 5 \rangle, coordinate by coordinate.
- Floor diagonal \displaystyle \sqrt{40} = 2\sqrt{10} \approx 6.32; \|\overrightarrow{OP}\| = 11. 4 + 36 = 40, then 40 + 81 = 121.
- \langle 3, 2, 2 \rangle; \langle -1, -19, 16 \rangle; \displaystyle \sqrt{101} \approx 10.05. 3\mathbf{u} - 2\mathbf{v} = \langle 3 - 4, -9 - 10, 12 + 4 \rangle and \mathbf{u} - \mathbf{v} = \langle -1, -8, 6 \rangle.
- \langle -8, 4, -8 \rangle. \|\langle 2, -1, 2 \rangle\| = 3, so multiply by -4.
- s = 2, t = 3. The first components give s = 2, the second 2s + t = 7, and the third 3t = 9 agrees.
- k = 4 or k = -4. 2k^2 + 49 = 81, so k^2 = 16.
- -5; obtuse. 12 - 12 - 5 = -5 < 0.
- 60^\circ. The dot product is 1 and both lengths are \displaystyle \sqrt{2}, so \displaystyle \cos\theta = \frac{1}{2}.
- \approx 76.2^\circ. The dot product is 12 - 3 - 4 = 5 and the lengths are 3 and 7, so \displaystyle \cos\theta = \frac{5}{21}.
- \approx 31.0^\circ. The length is \displaystyle \sqrt{4 + 9 + 36} = 7 and the dot product with \mathbf{k} is 6, so \displaystyle \cos\theta = \frac{6}{7}.
- \approx 83.6^\circ. \overrightarrow{PQ} = \langle 2, 2, 1 \rangle and \overrightarrow{PR} = \langle -2, 2, 1 \rangle, each of length 3, with dot product -4 + 4 + 1 = 1, so \displaystyle \cos\theta = \frac{1}{9}.
- \approx 35.3^\circ. The dot product is 2 and the lengths are \displaystyle \sqrt{2} and \displaystyle \sqrt{3}, so \displaystyle \cos\theta = \frac{2}{\sqrt{6}} = \frac{\sqrt{6}}{3}.
- Yes. 8 - 9 + 1 = 0.
- c = 3. 4c - 6 - 2c = 2c - 6 = 0.
- For example \langle 2, -1, 0 \rangle and \langle 3, 0, -1 \rangle. Their dot products with \langle 1, 2, 3 \rangle are 2 - 2 = 0 and 3 - 3 = 0. A multiple of \langle 2, -1, 0 \rangle has third component 0, so it cannot be \langle 3, 0, -1 \rangle.
- The right angle is at A. \overrightarrow{AB} = \langle 2, 1, -2 \rangle and \overrightarrow{AC} = \langle 1, 2, 2 \rangle give 2 + 2 - 4 = 0. Check: \|\overrightarrow{BC}\|^2 = 1 + 1 + 16 = 18 = 9 + 9.
- One right triangle lies in the floor, with legs |a| and |b| along two perpendicular axes, and gives the floor diagonal \displaystyle \sqrt{a^2 + b^2}. The second has that floor diagonal and the vertical edge |c| as legs; the edge is vertical and so perpendicular to every line in the floor. Its hypotenuse is the vector, so \|\mathbf{v}\|^2 = (a^2 + b^2) + c^2.
- For \mathbf{v} = \langle a, b, c \rangle, \|k\mathbf{v}\|^2 = (ka)^2 + (kb)^2 + (kc)^2, which factors as k^2(a^2 + b^2 + c^2) = k^2\|\mathbf{v}\|^2. Take square roots: \displaystyle \|k\mathbf{v}\| = \sqrt{k^2}\,\|\mathbf{v}\| = |k|\,\|\mathbf{v}\|, since \displaystyle \sqrt{k^2} = |k| for every real k.
- If all were multiples of one vector \mathbf{w}, then \langle 2, -1, 0 \rangle = s\mathbf{w} and \langle 3, 0, -1 \rangle = t\mathbf{w} with s \ne 0, making \displaystyle \langle 3, 0, -1 \rangle = \frac{t}{s}\langle 2, -1, 0 \rangle, a multiple. Exercise 19 showed it is not. In space the orthogonal vectors fill a plane.
- \mathbf{i} \cdot \mathbf{j} = \mathbf{i} \cdot \mathbf{k} = \mathbf{j} \cdot \mathbf{k} = 0, since each product pairs a 1 with a 0, and each has length \displaystyle \sqrt{1} = 1. For \mathbf{v} = \langle a, b, c \rangle, \mathbf{v} \cdot \mathbf{i} = a \cdot 1 + b \cdot 0 + c \cdot 0 = a, and likewise \mathbf{v} \cdot \mathbf{j} = b and \mathbf{v} \cdot \mathbf{k} = c.