Lines & Planes in Space

Study Sheet

Lines & Planes in Space

Normals, distances, and intersections

Equations of Lines and Planes

Tip
A plane is a point and a normal

Every plane in space is captured by ONE linear equation ax+by+cz=dax + by + cz = d, and the coefficient vector n=(a,b,c)\mathbf n = (a, b, c) is no accident: it is the NORMAL, perpendicular to the plane.

Why: if P0P_0 lies on the plane and PP is any other plane point, the displacement PP0P - P_0 lies in the plane, and the equation says exactly n(PP0)=0\mathbf n\cdot(P - P_0) = 0 — the normal is perpendicular to every in-plane direction. So building planes is mechanical: given a point and a normal, dot them; given three points, form two edge vectors and take their CROSS PRODUCT for the normal. Given the equation, read the normal straight off the coefficients. Parallel planes share a normal and differ only in dd; perpendicular planes have perpendicular normals — every geometric relationship between planes translates into a dot- or cross-product statement about their normals.

Side note
Why lines need a parameter but planes need an equation

In 3D a single linear equation removes ONE degree of freedom, leaving a 2-dimensional plane — so a line (1-dimensional) needs TWO equations, or more usefully a parametric form r(t)=p+tv\mathbf r(t) = \mathbf p + t\mathbf v: start at a point, walk along a direction. The dimension count (3equations=dimension3 - \text{equations} = \text{dimension}) is rank–nullity from linear algebra wearing geometric clothes — one of many places these two courses are secretly the same course.

Tip
All distances are projections onto the normal

Distance from a point P0=(x0,y0,z0)P_0 = (x_0, y_0, z_0) to the plane ax+by+cz=dax + by + cz = d: ax0+by0+cz0da2+b2+c2\dfrac{|ax_0 + by_0 + cz_0 - d|}{\sqrt{a^2 + b^2 + c^2}}. The logic: take any plane point QQ, and project the displacement P0QP_0 - Q onto the unit normal — only the normal component carries you away from the plane.

The numerator is the (signed) un-normalized projection; dividing by n|\mathbf n| finishes it. The same idea handles parallel planes (d1d2n\tfrac{|d_1 - d_2|}{|\mathbf n|}) and, with a cross product replacing the dot, point-to-line distances. One projection, every distance formula in the chapter.

Try it
Try it: a plane through three points

Find the plane through (1,0,0)(1, 0, 0), (0,2,0)(0, 2, 0), (0,0,3)(0, 0, 3). Work: edge vectors (1,2,0)(-1, 2, 0) and (1,0,3)(-1, 0, 3); cross product =(6,3,2)= (6, 3, 2); plane 6x+3y+2z=d6x + 3y + 2z = d with d=6d = 6 from the first point. Check the other two: 32=63\cdot2 = 6 ✓, 23=62\cdot3 = 6 ✓.

Shortcut worth knowing: intercepts p,q,rp, q, r give xp+yq+zr=1\tfrac xp + \tfrac yq + \tfrac zr = 1 instantly.

Proofs & Why It Matters

Tip
Proof: the point-to-plane distance formula

Let QQ be any point on the plane (nQ=d\mathbf n\cdot Q = d) and P0P_0 the outside point. The distance is the length of the projection of P0QP_0 - Q onto the unit normal: n(P0Q)n=nP0nQn=ax0+by0+cz0da2+b2+c2\left|\dfrac{\mathbf n\cdot(P_0 - Q)}{|\mathbf n|}\right| = \dfrac{|\mathbf n\cdot P_0 - \mathbf n\cdot Q|}{|\mathbf n|} = \dfrac{|ax_0 + by_0 + cz_0 - d|}{\sqrt{a^2+b^2+c^2}} — the arbitrary QQ vanished into dd, which is why the formula needs no particular plane point. \blacksquare SIGNIFICANCE: this projection pattern is the template for every "distance to a flat object" problem — and in machine learning it is literally the margin of a linear classifier.

Reminder — Distance and midpoint:d=(x2x1)2+(y2y1)2,M=(x1+x22, y1+y22)d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2}, \qquad M=\left(\frac{x_1+x_2}{2},\ \frac{y_1+y_2}{2}\right)
Side note
Where this leads

Planes are the first example of the general idea "linear equation = flat object + normal vector." In linear algebra the same picture becomes hyperplanes and the row space; in optimization, constraint surfaces and Lagrange multipliers; in graphics, every triangle of every 3D model carries its normal for lighting. The dot-product test you just learned is computed billions of times per frame in a video game.

Going Deeper: Worked Problems

Example
Worked: the line where two planes meet

Find parametric equations for the intersection of x+y+z=6x + y + z = 6 and xy+2z=3x - y + 2z = 3.

Step 1 — the direction of the line is perpendicular to BOTH normals, so take the cross product (1,1,1)×(1,1,2)=(121(1),;1112,;1(1)11)=(3,1,2)(1,1,1)\times(1,-1,2) = (1\cdot2 - 1\cdot(-1),; 1\cdot1 - 1\cdot2,; 1\cdot(-1) - 1\cdot1) = (3, -1, -2).

Step 2 — find one point on both planes: set z=0z = 0 and solve x+y=6x + y = 6, xy=3x - y = 3: x=4.5x = 4.5, y=1.5y = 1.5.

Step 3 — assemble: r(t)=(4.5,1.5,0)+t(3,1,2)\mathbf r(t) = (4.5, 1.5, 0) + t(3, -1, -2).

Step 4 — verify at t=1t = 1: the point (7.5,0.5,2)(7.5, 0.5, -2) gives 7.5+0.52=67.5 + 0.5 - 2 = 6 ✓ and 7.50.54=37.5 - 0.5 - 4 = 3 ✓. Two planes, one cross product, one small system.

Example
Worked: distance from a point to a line in space

Find the distance from P=(1,2,3)P = (1, 2, 3) to the line through A=(0,0,1)A = (0, 0, 1) with direction v=(1,1,0)\mathbf v = (1, 1, 0).

Step 1 — displacement w=PA=(1,2,2)\mathbf w = P - A = (1, 2, 2).

Step 2 — the perpendicular distance is w×vv\dfrac{|\mathbf w\times\mathbf v|}{|\mathbf v|} (the parallelogram area divided by its base). Compute w×v=(2021,;2110,;1121)=(2,2,1)\mathbf w\times\mathbf v = (2\cdot0 - 2\cdot1,; 2\cdot1 - 1\cdot0,; 1\cdot1 - 2\cdot1) = (-2, 2, -1), magnitude 33.

Step 3 — divide by v=2|\mathbf v| = \sqrt2: distance 32=322\dfrac{3}{\sqrt2} = \dfrac{3\sqrt2}{2}.

Step 4 — cross-check by projection: the component of w\mathbf w along v\mathbf v is 32\tfrac{3}{\sqrt2}, and w2(32)2=94.5=4.5=(322)2|\mathbf w|^2 - \left(\tfrac{3}{\sqrt2}\right)^2 = 9 - 4.5 = 4.5 = \left(\tfrac{3\sqrt2}{2}\right)^2 ✓ — Pythagoras agrees with the cross product.