Skip to lesson content

Lesson 2 of 4

Introduction to Three-dimensional Geometry · Lesson 2 of 4

Distance and Relationships Between Points

“Derive spatial distance from two right triangles, then use lengths to test collinearity and triangle types.”

Learning Objectives

• Derive the distance formula using three perpendicular coordinate differences. • Calculate distances from the origin and between arbitrary points. • Explain how equal coordinates simplify a distance calculation. • Use distance sums to test collinearity and identify the middle point. • Classify isosceles and right-angled triangles using side lengths and squared lengths.

Coordinate Movements and a Direct Segment

A point can be reached by moving along three coordinate directions, but that broken path is usually longer than the direct segment. The distance between two points is the straight segment joining them. The three coordinate differences are perpendicular components of that segment, so Pythagoras provides the connection.

Let P=(x₁,y₁,z₁) and Q=(x₂,y₂,z₂). Their signed coordinate differences are Δx=x₂−x₁, Δy=y₂−y₁ and Δz=z₂−z₁; Δ means change. The corresponding side lengths of a rectangular box are |Δx|, |Δy| and |Δz|. Reversing P and Q reverses all three signs but cannot change the segment length.

A rectangular parallelepiped is a box with rectangular faces. The source builds such a box with P and Q as opposite corners. One right triangle combines the x- and z-changes into a face diagonal; a second combines that diagonal with the y-change into the space diagonal PQ. This is Pythagoras applied twice, not a new rule added without explanation.

Deriving the Three-Dimensional Formula

To see the two right triangles clearly, choose intermediate corners along coordinate directions. Start at P, change one coordinate at a time, and keep track of which corner shares coordinates with Q. Each right angle comes from the perpendicular axes.

Let A=(x₁,y₂,z₁) and N=(x₂,y₂,z₁). Then PA runs parallel to the y-axis, AN parallel to the x-axis, and NQ parallel to the z-axis. In the right triangle ANQ, AQ²=AN²+NQ². Because PA is perpendicular to the plane containing the x- and z-directed sides, triangle PAQ is also right-angled, giving PQ²=PA²+AQ².

The two Pythagorean stepsLaTeX
Combining them gives PQ²=PA²+AN²+NQ². Each side length is the absolute value of a coordinate difference; its square is the square of that signed difference.
A face diagonal and a space diagonalxyzOPANQ
A face diagonal and a space diagonal— P=(0,0,0), A=(0,3,0), N=(2,3,0), Q=(2,3,3). AQ is a face diagonal; PQ is the direct space diagonal.

Substitute the coordinate changes into the combined equation, then take the nonnegative square root. The result measures a length, so the negative square root is not another possible distance. The order of addition is irrelevant; every independent perpendicular change contributes its square.

Distance between two spatial pointsLaTeX
P and Q are expressed in the same rectangular coordinate system and compatible length units. Distance is nonnegative and equals zero exactly when their three coordinates agree.
Example — Measure a spatial segment

Problem
Find the distance between P=(1,−3,4) and Q=(−4,1,2).

  1. 1.The coordinate changes from P to Q are −4−1=−5, 1−(−3)=4, and 2−4=−2.
  2. 2.Square each change: 25,16,4.
  3. 3.Add to obtain PQ²=25+16+4=45.
  4. 4.Therefore PQ=√45=3√5 units. Reversing the endpoint order gives the same squares and length.
Common mistake

Do not add |Δx|+|Δy|+|Δz| when asked for straight-line distance. That is the length of a route constrained to successive axis-parallel movements. Also, the sum of the three squares is distance squared; take its square root when the question asks for distance.

Distance from the Origin and Simpler Cases

The origin has coordinates (0,0,0), so subtracting its coordinates leaves the point’s own coordinates. Equal endpoint coordinates also make some terms vanish. These special cases show that the spatial formula contains the familiar plane and line formulas.

Distance from the originLaTeX
For P=(x,y,z), OP combines all three coordinate contributions. A coordinate alone usually measures distance to a plane, not distance to the origin.

If P and Q share their z-coordinate, Δz=0 and the distance becomes √[(Δx)²+(Δy)²]. They may lie in the XY-plane or in another plane parallel to it; the same reduction applies. If they share two coordinates, only one term remains, and the distance is the absolute value of the remaining change. None of these simplifications depends on the coordinates being positive.

Example — Three different kinds of distance

Problem
For P=(2,−3,6), find its distance from the origin and from the XY-plane. Also find the distance to Q=(2,−3,−1).

  1. 1.The origin distance is √(2²+(−3)²+6²)=√49=7.
  2. 2.The XY-plane distance is |6|=6 because the perpendicular to that plane changes only z.
  3. 3.P and Q have equal x and y, so PQ=|−1−6|=7.
  4. 4.The first and third distances happen to agree, but they refer to different segments. The plane distance is different.
Example — A segment parallel to a coordinate plane

Problem
Find the distance between (2,−1,3) and (−2,1,3).

  1. 1.Both endpoints have z=3, so the z-change is zero.
  2. 2.The x-change is −4 and the y-change is 2.
  3. 3.Distance=√(16+4+0)=√20=2√5 units.
  4. 4.The segment lies in the plane at z=3, parallel to the XY-plane; it does not have to lie in the XY-plane itself.

Collinearity from a Distance Equality

Three points are collinear when they lie on one straight line. For distinct points, one is between the other two. The distance from one outer point to the other then equals the sum of the two shorter segments, which supplies a test that works in three dimensions.

For any three points, travelling from P to R by way of Q cannot be shorter than the direct route PR. Thus PQ+QR≥PR, the triangle inequality. Equality occurs when the two pieces lie on the same straight segment with Q between P and R. To use this test, compute the three distances and identify the largest one before checking the sum.

Distance test for collinearityLaTeX
For three distinct points, this equality establishes that Q lies between P and R on a straight line. Other orders of the middle point require the corresponding reordered equality.
Example — Locate the middle point on a line

Problem
Show that P=(−2,3,5), Q=(1,2,3), R=(7,0,−1) are collinear.

  1. 1.PQ²=(1+2)²+(2−3)²+(3−5)²=9+1+4=14, so PQ=√14.
  2. 2.QR²=(7−1)²+(0−2)²+(−1−3)²=36+4+16=56, so QR=2√14.
  3. 3.PR²=(7+2)²+(0−3)²+(−1−5)²=81+9+36=126, so PR=3√14.
  4. 4.Since PQ+QR=√14+2√14=3√14=PR, the points are collinear.
  5. 5.Q lies between P and R, and PQ:QR=1:2. This additional ordering information comes from which distance equality holds.

Do not substitute squared distances into this addition test. For points one and two units apart on the same line, 1+2=3 but 1²+2² is not 3². Lengths add along a segment; their squares do not. Distinctness also matters: repeating one point can make an equality automatic without producing a genuine three-vertex figure.

Triangles from Side-Length Comparisons

Three distinct noncollinear points form a triangle, even when its plane is tilted relative to the coordinate planes. Its side lengths obey the same geometric rules as a triangle drawn on paper. We can therefore classify it without trying to flatten its drawing.

Definition
Isosceles triangle

A nondegenerate triangle with at least two equal side lengths. Equality can be checked using the squared lengths because all side lengths are nonnegative.

To test whether a triangle is right-angled, compare the largest squared side with the sum of the other two. The largest side is the only possible hypotenuse. Equality establishes a right angle opposite that side, by the converse of Pythagoras. If equality fails, no other side can be the hypotenuse, so the triangle is not right-angled.

Right-triangle testLaTeX
Here c is the largest side length and a,b are the other two lengths of a genuine triangle. For this comparison you can work directly with squared coordinate distances.
Example — A triangle that is not right-angled

Problem
Are A=(3,6,9), B=(10,20,30), C=(25,−41,5) the vertices of a right-angled triangle?

  1. 1.AB²=(10−3)²+(20−6)²+(30−9)²=49+196+441=686.
  2. 2.BC²=(25−10)²+(−41−20)²+(5−30)²=225+3721+625=4571.
  3. 3.CA²=(3−25)²+(6+41)²+(9−5)²=484+2209+16=2709.
  4. 4.The largest squared side is BC². But AB²+CA²=686+2709=3395, which is not 4571.
  5. 5.Therefore the triangle is not right-angled. Comparing an arbitrary pair without first choosing the largest side would be an incomplete test.
Example — Verify an isosceles triangle

Problem
For A=(0,7,−10), B=(1,6,−6), C=(4,9,−6), verify the triangle is isosceles.

  1. 1.AB²=(1−0)²+(6−7)²+(−6+10)²=1+1+16=18.
  2. 2.BC²=(4−1)²+(9−6)²+(−6+6)²=9+9+0=18.
  3. 3.AC²=(4−0)²+(9−7)²+(−6+10)²=16+4+16=36.
  4. 4.Thus AB=BC=√18. The points are not collinear since √18+√18>√36.
  5. 5.The triangle is isosceles; in fact AB²+BC²=AC² also gives a right angle at B.
Example — Verify a right angle

Problem
Show that A=(0,7,10), B=(−1,6,6), C=(−4,9,6) form a right-angled triangle.

  1. 1.AB²=(−1)²+(−1)²+(−4)²=18.
  2. 2.BC²=(−3)²+3²+0²=18.
  3. 3.AC²=(−4)²+2²+(−4)²=36.
  4. 4.Since AC is the largest side and AB²+BC²=AC², the right angle is at B.
  5. 5.The equality of the two legs also makes this an isosceles right triangle. A triangle can satisfy more than one classification.

Quiz

Quick check

Distance from (0,0,0) to (2,3,6) is:

Quick check

If two points share x and y, their distance is:

Quick check

For three distinct points with AB+BC=AC, which point is between the others?

Quick check

Squared side lengths are 9,16,25. The triangle is:

Quick check

Why do negative coordinate changes cause no negative distance?

Quick check

The straight distance for perpendicular changes 3,4,12 is:

Practice Problems

Practice Problems
  1. Find the distances between (2,3,5) and (4,3,1), between (−3,7,2) and (2,4,−1), and between (−1,3,−4) and (1,−3,4).
  2. For (−2,3,6), compare its origin distance with its distances from the three coordinate planes.
  3. Find the distance between (1,−2,4) and (1,5,4), and explain why two squared terms disappear.
  4. Test whether (0,0,0), (1,2,2) and (3,6,6) are collinear; identify the middle point.
  5. Classify the triangle with vertices (0,0,0), (2,0,0), (0,2,0) using squared distances.
  6. Explain why the route that changes coordinates by 3,4,12 in three successive perpendicular movements has length 19 but its direct segment has a different length.

Key Takeaways

Key Takeaways

• Two applications of Pythagoras give the sum of three squared coordinate differences. • Origin distance uses √(x²+y²+z²); plane distance uses one coordinate’s absolute value. • Equal endpoint coordinates remove the corresponding distance terms. • For distinct points, equality of the largest distance with the sum of the other two establishes collinearity and the middle point. • Use lengths for the collinearity sum, but squared lengths for triangle comparisons. • A right-triangle test must compare the largest squared side with the sum of the other two.