Lines in 3D: Equations and Trace Points

A line in space is determined by a point A and a direction vector d and is written parametrically as r = A + t·d; its trace points are the points where it meets the coordinate planes. In brief: the line through A(1, 2, 3) and B(4, 0, 5) has d = (3, −2, 2) and the equations x = 1 + 3t, y = 2 − 2t, z = 3 + 2t. It meets the plane z = 0 at t = −3/2, that is at (−3.5, 5, 0).

In space, one linear equation describes a plane, so a line needs either a parametric description or two plane equations. This guide presents the parametric, symmetric and two-plane forms, how to convert between them, how to find trace points on the coordinate planes, and how to compute the angle between lines and the distance from a point, with worked examples and a table.

What are the equations of a line in space?

A line through A = (x0, y0, z0) with the direction d = (p, q, s) has three equivalent descriptions.

Example 1: through two points

A(1, 2, 3), B(4, 0, 5): d = AB = (3, −2, 2). Parametric: x = 1 + 3t, y = 2 − 2t, z = 3 + 2t. Symmetric: (x − 1)/3 = (y − 2)/(−2) = (z − 3)/2. The parameters t = 0 and t = 1 give A and B, and t between them gives the segment AB.

Example 2: a point on the line?

Does P(7, −2, 7) lie on the line from Example 1? From x: 1 + 3t = 7, t = 2; then y = 2 − 4 = −2 ✓ and z = 3 + 4 = 7 ✓. Yes. For Q(7, 0, 7): y = 0 would need t = 1, a contradiction, so Q is not on the line.

How do you convert between forms?

To go from two planes to parametric form, compute the direction n1 × n2 and find one point by choosing a value for one coordinate (often 0) and solving for the other two.

Example 3: from two planes to parametric

x + y + z = 6 and x − y + 2z = 3. Normals (1, 1, 1) and (1, −1, 2). Direction: (1 · 2 − 1 · (−1), 1 · 1 − 1 · 2, 1 · (−1) − 1 · 1) = (3, −1, −2). Point: with z = 0, x + y = 6 and x − y = 3, so x = 4.5, y = 1.5. The line: (4.5 + 3t, 1.5 − t, −2t). Check with t = 1: (7.5, 0.5, −2): 7.5 + 0.5 − 2 = 6 ✓ and 7.5 − 0.5 − 4 = 3 ✓.

Example 4: from symmetric to two planes

(x − 1)/3 = (y − 2)/(−2) = (z − 3)/2 gives two equations: −2(x − 1) = 3(y − 2), that is 2x + 3y − 8 = 0; and 2(y − 2) = −2(z − 3), that is y + z − 5 = 0.

What are trace points and how do you find them?

The trace points (or piercing points) of a line are its intersections with the coordinate planes. To find the point on the xy-plane, set z = 0 in the parametric equation, solve for t, and substitute; use y = 0 for the xz-plane and x = 0 for the yz-plane. If the corresponding component of the direction vector is 0, the line is parallel to that plane (it either misses it or lies in it). Trace points show where a line enters and leaves each octant, and they help to draw it.

Example 5: all three traces

For x = 1 + 3t, y = 2 − 2t, z = 3 + 2t:

Example 6: a line parallel to a coordinate plane

x = 2 + t, y = 1 − t, z = 4. Here the direction (1, −1, 0) has zero z-component, so the line lies in the plane z = 4 and has no xy-trace. Its xz-trace: y = 0 at t = 1, the point (3, 0, 4).

How do you find the angle between lines?

With directions d1 and d2, the angle θ between the lines satisfies cos θ = |d1 · d2|/(|d1||d2|), with 0° ≤ θ ≤ 90°. The lines are parallel if d1 × d2 = 0, and perpendicular if d1 · d2 = 0. Perpendicular lines need not intersect in space.

Example 7: an angle

d1 = (1, 2, 2), d2 = (2, 3, 6): d1 · d2 = 20, |d1| = 3, |d2| = 7, cos θ = 20/21, θ ≈ 17.75°.

How do you find the distance from a point to a line?

For a line through A with direction d and a point P: dist = |AP × d|/|d|. It is the area of the parallelogram on AP and d divided by its base |d|.

Example 8: a distance

The distance from the origin to the line through A(1, 2, 3) with d = (3, −2, 2). AP = (−1, −2, −3). AP × d = ((−2)(2) − (−3)(−2), (−3)(3) − (−1)(2), (−1)(−2) − (−2)(3)) = (−10, −7, 8). Its length is √(100 + 49 + 64) = √213. |d| = √17. The distance is √(213/17) ≈ 3.54.

Example 9: a point on the line closest to P

The closest point has t such that (A + td − P) · d = 0: (1 + 3t, 2 − 2t, 3 + 2t) · (3, −2, 2) = 3 + 9t − 4 + 4t + 6 + 4t = 5 + 17t = 0, so t = −5/17.

Table of forms and formulas

Descriptions of a line in space and main formulas
Item Formula Example
parametricA + t·d(1 + 3t, 2 − 2t, 3 + 2t)
direction from two pointsB − A(3, −2, 2)
direction from two planesn1 × n2(3, −1, −2)
xy-traceset z = 0(−3.5, 5, 0)
angle between lines|d1 · d2|/(|d1||d2|)20/21 → 17.75°
distance from a point|AP × d|/|d|√(213/17) ≈ 3.54

Where do these ideas come from?

Analytic geometry of space was developed in the seventeenth and eighteenth centuries. Descartes mentioned the extension of his method to three dimensions, and systematic equations of lines and planes in space appear in works of Euler and Lagrange in the eighteenth century. The vector description with a point and a direction became standard after the vector analysis of Gibbs and Heaviside in the 1880s.

Which mistakes are common?

Using the same parameter for two lines

When two lines are compared, give them different parameters (t and s), otherwise real intersection points are lost.

Writing a symmetric form with a zero denominator

If a component of d is 0, write that coordinate as a constant equation instead of dividing by 0.

Expecting a single equation

One linear equation in x, y, z describes a plane, not a line. Two equations or a parametrization are needed.

Assuming perpendicular lines intersect

In space, lines with d1 · d2 = 0 may be skew; they intersect only if they are coplanar and not parallel.