Skip to content
Geometry and Algebra

Analytic geometry in space: lines, planes, distances and angles

The equation of a plane and its normal vector, the plane through three points, lines in parametric and Cartesian form, relative positions, skew lines, distances and angles.

In three-dimensional space the linear objects are planes and lines. With vectors, the dot product and the cross product you can solve all the classic problems: equations, relative positions, angles and distances. It is the geometry behind 3D graphics, robotics and mechanical design.

The plane

A plane is determined by a point P_0 = (x_0, y_0, z_0) and a normal vector \mathbf n = (a, b, c). A point P lies on the plane if \overrightarrow{P_0P} is perpendicular to \mathbf n:

    \[ a(x - x_0) + b(y - y_0) + c(z - z_0) = 0 \quad\Longleftrightarrow\quad ax + by + cz + d = 0 \]

As for a line in the plane, the coefficients of x, y, z are the components of a normal vector.

Plane through three points. If A, B, C are not collinear, the vector \overrightarrow{AB}\times\overrightarrow{AC} is normal to the plane. Example: A = (1, 0, 0), B = (0, 2, 0), C = (0, 0, 3). \overrightarrow{AB} = (-1, 2, 0), \overrightarrow{AC} = (-1, 0, 3), cross product (6, 3, 2). The plane is 6(x - 1) + 3y + 2z = 0, that is 6x + 3y + 2z = 6, or \frac x1 + \frac y2 + \frac z3 = 1 (intercept form: you read off where it crosses the axes).

Alternatively: the point P is on plane ABC if and only if \overrightarrow{AP}, \overrightarrow{AB}, \overrightarrow{AC} are coplanar, that is if their triple product, a 3×3 determinant, is zero.

The line

A line in space is written in parametric form, with a point and a direction vector \mathbf d = (l, m, n):

    \[ (x, y, z) = (x_0, y_0, z_0) + t\,(l, m, n) \]

or in Cartesian form, as the intersection of two non-parallel planes:

    \[ \begin{cases} a_1x + b_1y + c_1z + d_1 = 0\\ a_2x + b_2y + c_2z + d_2 = 0 \end{cases} \]

A single linear equation in space is a plane, not a line: a common mistake. To go from Cartesian to parametric form you solve the system (rank 2, one free variable); the direction vector is also \mathbf n_1\times\mathbf n_2, perpendicular to both normals.

Relative positions

Two planes are parallel if their normals are proportional; otherwise they meet in a line. The angle between two planes is the angle between their normals.

Line and plane. With \mathbf d the direction of the line and \mathbf n the normal of the plane: if \mathbf d\cdot\mathbf n \ne 0 they meet at a point; if \mathbf d\cdot\mathbf n = 0 the line is parallel to the plane (or lies in it). The line is perpendicular to the plane if \mathbf d is parallel to \mathbf n.

Two lines in space can intersect, be parallel or be skew: not parallel and with no common point, like two roads one above the other at a flyover. They are coplanar (so intersecting or parallel) if and only if the triple product of \overrightarrow{P_1P_2}, \mathbf d_1, \mathbf d_2 is zero.

Distances

Plane with its normal vector and the distance of a point from the plane
The distance of Q from the plane \pi is the length of the perpendicular segment: the component of \overrightarrow{P_0Q} along the normal vector \mathbf n.

Point-plane distance

    \[ d(Q, \pi) = \frac{|a x_Q + b y_Q + c z_Q + d|}{\sqrt{a^2 + b^2 + c^2}} \]

Proof. It is identical to the point-line distance in the plane: project \overrightarrow{P_0Q} onto the normal, d = |\overrightarrow{P_0Q}\cdot\mathbf n|/|\mathbf n|, and use ax_0 + by_0 + cz_0 = -d. Example: the distance of the origin from 6x + 3y + 2z = 6 is |-6|/\sqrt{49} = 6/7.

Point-line distance

The distance of Q from the line through P_0 with direction \mathbf d is the height of the parallelogram built on \overrightarrow{P_0Q} and \mathbf d, that is area divided by base:

    \[ d(Q, r) = \frac{|\overrightarrow{P_0Q}\times\mathbf d|}{|\mathbf d|} \]

Distance between skew lines

The vector \mathbf d_1\times\mathbf d_2 is perpendicular to both lines. The distance is the projection of \overrightarrow{P_1P_2} onto that direction, that is the volume of the parallelepiped divided by the area of its base:

    \[ d(r_1, r_2) = \frac{|\overrightarrow{P_1P_2}\cdot(\mathbf d_1\times\mathbf d_2)|}{|\mathbf d_1\times\mathbf d_2|} \]

Example. r_1: (0, 0, 0) + t(1, 0, 0), the x axis; r_2: (0, 1, 2) + s(0, 1, 1). \mathbf d_1\times\mathbf d_2 = (0, -1, 1), \overrightarrow{P_1P_2} = (0, 1, 2), dot product -1 + 2 = 1. Distance 1/\sqrt2. Since it is not zero, the lines are skew.

Angles

  • between two lines: \cos\theta = |\mathbf d_1\cdot\mathbf d_2|/(|\mathbf d_1||\mathbf d_2|);
  • between two planes: the same with the normals;
  • between a line and a plane: \sin\theta = |\mathbf d\cdot\mathbf n|/(|\mathbf d||\mathbf n|), because the angle with the plane is the complement of the angle with the normal.

A practical note

In 3D graphics every triangle of a model has a normal computed as the cross product of two of its sides: it is used to decide whether the face points towards the camera (back-face culling) and how much light it gets (the cosine between the normal and the light direction, a dot product). Ray tracing computes millions of line-plane intersections per second with the formulas of this lesson.

Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
0
Would love your thoughts, please comment.x
()
x