Distance between P(x₁, y₁, z₁) and Q(x₂, y₂, z₂) in space. Direct extension of the 2D formula using Pythagoras twice.
Let P(x1,y1,z1) and Q(x2,y2,z2) be two points in space.
Step 1: Drop a perpendicular from P to the xy-plane, meeting it at A(x1,y1,0). Similarly B(x2,y2,0) for Q.
Step 2: In the xy-plane, AB=(x2−x1)2+(y2−y1)2.
Step 3: PQ is the hypotenuse of a right triangle with legs AB (horizontal) and z2−z1 (vertical):
PQ=AB2+(z2−z1)2=(x2−x1)2+(y2−y1)2+(z2−z1)2
Distance from origin: For P(x,y,z):
OP=x2+y2+z2
Collinearity test: Three points A, B, C are collinear iff AB+BC=AC (one distance equals the sum of the other two).