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), and the segment between them. Three groups of objects are hidden. Reveal them in order; they are the proof.

Two labeled points floating above a horizontal grid, a red point A at (1, 2, 1) and a blue point B at (4, 6, 3), joined by a thin shaded rod. There are no sliders; the reader reveals hidden objects in three groups. Revealing the first group drops dashed gray plumb lines from A and B to their shadows A' and B', two gray points on the floor, and lays a second rod along the floor between the shadows. Revealing the second group draws that floor rod's own two legs as dashed lines, a red one 3 units along the x direction and a green one 4 units along the y direction, so the floor rod is the hypotenuse of a 3-4-5 triangle. Revealing the third group adds a purple corner point C at (4, 6, 1), level with A and directly below B, with a rod from A to C of length 5 and a shorter vertical rod from C to B 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)
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. Hidden in the scene: the shadows AA' and BB' on the floor with the dark floor segment between them, the two dashed legs of that floor segment, and the corner C=(4,6,1)C = (4, 6, 1) with the two 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. Reveal the two shadows AA' and BB', the dashed plumb lines that drop to them, and the second 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. Reveal the two dashed floor legs: 33 units along the xx direction and 44 along the yy direction. They meet at a right angle on the floor, so ABA'B' is the hypotenuse of a 334455 triangle: its length is 55.
  4. Reveal the purple corner C=(4,6,1)C = (4, 6, 1) and the two legs ACAC and CBCB. The leg ACAC is level, so it is a copy of ABA'B' and has length 55; the leg CBCB is vertical, of length 31=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|=295.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 ABA'B', so it has the length just computed; the leg CBCB is vertical, of length |b3a3||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 (b1a1)2\sqrt{(b_1 - a_1)^2}, which is |b1a1||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 334455 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. Its chapter sequence is aligned to Interactive Linear Algebra (Margalit & Rabinoff, Georgia Tech, GNU FDL); this work is original, copies nothing from it, and is not affiliated with or endorsed by its authors. License: CC-BY-NC-SA-4.0.

These eBooks are a prerelease and are not yet certified conformant with WCAG 2.1 AA or ADA Title II. Every page is built against an automated accessibility gate, and the published editions will meet ADA Title II requirements when they release in late September 2026. If something is unusable, please tell us.