Linear Algebra, Interactive EditionXYZ Homework Edition

⇩ Download ▾

0.1 Points and Distance in Space

A point on a line is a number. A point in the plane is a pair (x,y)(x, y): walk xx units along the first axis, then yy units parallel to the second. A point in space is a triple (x,y,z)(x, y, z) — the same two walks, then a climb of zz. The three axes meet at the origin (0,0,0)(0, 0, 0), and each pair of axes spans a coordinate plane: the xyxy-plane is the floor z=0z = 0, the xzxz-plane and yzyz-plane are two walls. The three planes cut space into eight rooms, the octants; the point (4,6,3)(4, 6, 3) sits in the room where all three coordinates are positive, and (4,−6,3)(4, -6, 3) sits in the room next door.

The set of all triples is written ℝ3\mathbb{R}^3, and nothing about the notation stops at three. The set of all lists of nn real numbers, (x1,x2,…,xn)(x_1, x_2, \dots, x_n), is ℝn\mathbb{R}^n, with origin (0,0,…,0)(0, 0, \dots, 0). We cannot draw ℝ4\mathbb{R}^4, but every formula in this chapter is written so that it does not care — and the first of them is the distance between two points.

The figure below holds two points, A=(1,2,1)A = (1, 2, 1) and B=(4,6,3)B = (4, 6, 3), the segment between them, and three groups of objects built around that segment. The three groups are the proof; the steps below take them one at a time.

Two labeled points above a horizontal grid, a red point A at (1, 2, 1) and a blue point B at (4, 6, 3), joined by a rainbow-shaded rod. There are no sliders. The rest of the construction is drawn as well, in three groups. Gray plumb lines drop from A and B to their shadows A' and B', two gray points on the floor, and a thinner gray rod lies along the floor between the shadows. That floor rod has two legs, a red line 3 units along the x direction and a green line 4 units along the y direction, so the floor rod is the hypotenuse of a right triangle with sides 3, 4 and 5. A purple corner point C at (4, 6, 1), level with A and directly below B, is joined to A by a gray rod of length 5 and to B by a shorter, vertical gray rod of length 2, making a right triangle whose hypotenuse is the original rod AB, of length the square root of 29.Explore in 3D (opens in a new tab)

Two labeled points above a horizontal grid, a red point A at (1, 2, 1) and a blue point B at (4, 6, 3), joined by a rainbow-shaded rod. There are no sliders. The rest of the construction is drawn as well, in three groups. Gray plumb lines drop from A and B to their shadows A' and B', two gray points on the floor, and a thinner gray rod lies along the floor between the shadows. That floor rod has two legs, a red line 3 units along the x direction and a green line 4 units along the y direction, so the floor rod is the hypotenuse of a right triangle with sides 3, 4 and 5. A purple corner point C at (4, 6, 1), level with A and directly below B, is joined to A by a gray rod of length 5 and to B by a shorter, vertical gray rod of length 2, making a right triangle whose hypotenuse is the original rod AB, of length the square root of 29.

The points A=(1,2,1)A = (1, 2, 1) and B=(4,6,3)B = (4, 6, 3) joined by the rod whose length we want. Around it: the shadows A′A' and B′B' on the floor with the gray floor segment between them, the red and green legs of that floor segment, and the purple corner C=(4,6,1)C = (4, 6, 1) with the two gray legs of the right triangle ACBACB.

Explore the figure

  1. Orbit until you are looking straight down, and read each point's first two coordinates off the grid: AA sits above (1,2)(1, 2) and BB above (4,6)(4, 6). Orbit back to a side view and read the heights, 11 and 33. Three numbers locate a point completely.
  2. Find the two shadows A′A' and B′B', the gray points on the floor, the gray plumb lines that drop to them from AA and BB, and the thinner gray rod lying along the floor between the shadows. The floor segment is the rod ABAB with its height forgotten — a problem in the plane, where you already know how to measure.
  3. Find the two floor legs: the red one, 33 units along the xx direction, and the green one, 44 along the yy direction. They meet at a right angle on the floor, so A′B′A'B' is the hypotenuse of a 33–44–55 triangle: its length is 55.
  4. Find the purple corner C=(4,6,1)C = (4, 6, 1) and the two gray legs ACAC and CBCB. The leg ACAC is level, so it is a copy of A′B′A'B' and has length 55; the leg CBCB is vertical, of length 3−1=23 - 1 = 2; and they meet at a right angle. The rod ABAB is the hypotenuse: |AB|2=52+22=29|AB|^2 = 5^2 + 2^2 = 29, so |AB|=29≈5.39|AB| = \sqrt{29} \approx 5.39.
  5. Predict before you check: if BB were lowered to height 11, level with AA, the vertical leg would vanish and the distance would drop to exactly 55. If instead BB were raised to height 66, the vertical leg would be 55 and the distance 25+25=52\sqrt{25 + 25} = 5\sqrt{2}.

Two right triangles

Nothing in the figure depended on the particular numbers. Take any two points A=(a1,a2,a3)A = (a_1, a_2, a_3) and B=(b1,b2,b3)B = (b_1, b_2, b_3). Their shadows on the floor are A′=(a1,a2,0)A' = (a_1, a_2, 0) and B′=(b1,b2,0)B' = (b_1, b_2, 0), and the distance between shadows is a plane problem, settled by Pythagoras in the floor:

| A ′ B ′ | 2 = ( b 1 − a 1 ) 2 + ( b 2 − a 2 ) 2 |A'B'|^2 = (b_1 - a_1)^2 + (b_2 - a_2)^2

Now let C=(b1,b2,a3)C = (b_1, b_2, a_3) be the point directly below BB at the height of AA. The leg ACAC is horizontal and is a copy of A′B′A'B', so it has the length just computed; the leg CBCB is vertical, of length |b3−a3||b_3 - a_3|; and the two legs are perpendicular, because one lies in a horizontal plane and the other runs straight up. Pythagoras once more, in the vertical triangle ACBACB:

| A B | 2 = | A C | 2 + | C B | 2 = ( b 1 − a 1 ) 2 + ( b 2 − a 2 ) 2 + ( b 3 − a 3 ) 2 |AB|^2 = |AC|^2 + |CB|^2 = (b_1 - a_1)^2 + (b_2 - a_2)^2 + (b_3 - a_3)^2

That is the distance formula in ℝ3\mathbb{R}^3: the distance between two points is the square root of the sum of the squared coordinate differences. The absolute value on the vertical leg was harmless to drop, since squaring forgets a sign anyway.

Look at the shape of the answer rather than its derivation. In ℝ1\mathbb{R}^1 the distance is (b1−a1)2\sqrt{(b_1 - a_1)^2}, which is |b1−a1||b_1 - a_1|. In ℝ2\mathbb{R}^2 it is the sum of two squared differences under a root; in ℝ3\mathbb{R}^3, three. The pattern is the formula, and it is the pattern we keep when the picture runs out: for A=(a1,…,an)A = (a_1, \dots, a_n) and B=(b1,…,bn)B = (b_1, \dots, b_n) in ℝn\mathbb{R}^n, we define

| A B | = ( b 1 − a 1 ) 2 + ( b 2 − a 2 ) 2 + ⋯ + ( b n − a n ) 2 |AB| = \sqrt{(b_1 - a_1)^2 + (b_2 - a_2)^2 + \cdots + (b_n - a_n)^2}

There is no fourth axis to drop a plumb line along. But every property of distance that we will ever use — that it is never negative, that it is zero only between a point and itself, that it is the same measured from either end — follows from this formula directly, without a picture.

29\sqrt{29}
The distance in the figure ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The distance in the figure, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The three coordinate differences between A=(1,2,1)A = (1, 2, 1) and B=(4,6,3)B = (4, 6, 3), handed to a computer algebra system as one vector. Its length comes back as 29\sqrt{29} — exactly, not as a decimal — which is what the two right triangles claimed.

55
The floor segment alone ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The floor segment alone, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The same differences with the vertical one left out: the floor rod between the shadows has length exactly 55, the 33–44–55 triangle of step 3. The engine returns the whole number rather than 25\sqrt{25}.

77
The worked example's distance ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text The worked example's distance, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The distance from A=(1,−2,0)A = (1, -2, 0) to B=(3,1,6)B = (3, 1, 6), recomputed from the same head-minus-tail differences: 77.

44
And the same formula in four dimensions ✓ Computed · mojocas 0.1.0 ✓ Agrees with the text And the same formula in four dimensions, computed exactly by mojocas 0.1.0, and confirmed to agree with the result stated in the text.

The second half of the worked example, where no picture is available: the four coordinate differences between P=(1,2,3,4)P = (1, 2, 3, 4) and Q=(3,4,5,6)Q = (3, 4, 5, 6) in ℝ4\mathbb{R}^4. The op does not care how many components it is given, which is the section's point — the pattern is the definition.

An original work of XYZ Homework, built around interactive XYZ 3D figures. Chapters 1–6 follow the topic sequence of Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL). Chapter 0's scope (its topics, their order, and the idea each figure shows) follows the Vectors chapter of Ximera's Linear Algebra: An Interactive Introduction. The prose, worked examples and figures were written for this book, which is not affiliated with or endorsed by the authors of either work. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or any other accessibility standard. Every page is built against an automated accessibility gate, and our target for the published editions is WCAG 2.2 Level AA. If something is unusable, please tell us.