In analytic geometry
, the intersection of a line
and a plane
can be the empty set
a line. Distinguishing these cases, and determining equations for the point and line in the latter cases have use, for example, in computer graphics
, motion planning
, and collision detection
A line is described by all points that are a given direction from a point. Thus a line can be represented as
are two distinct points along the line.
Similarly a plane can be represented as
are three points in the plane which are not co-linear.
The point at which the line intersects the plane is therefore described by setting the line equal to the plane in the parametric equation:
This can be simplified to
which can be expressed in matrix form as:
The point of intersection is then equal to
If the line is parallel to the plane then the vectors , , and will be linearly dependent and the matrix will be singular. This situation will also occur when the line lies in the plane.
If the solution satisfies the condition , then the intersection point is on the line between and .
If the solution satisfies
then the intersection point is in the plane inside the triangle spanned by the three points
This problem is typically solved by expressing it in matrix form, and inverting it:
The plane can also be defined by
is a point on the plane and
is a normal
to the plane. A normal can be found by taking the cross product
Combining with the equation for the line gives
In term of coordinates, if then the equation of the plane is
If the direction of the line is perpendicular to the normal then the denominator will be zero. If the line lies in the plane then both numerator and denominator will be zero, the equation is satisfied by all values of t.
In the ray tracing method of computer graphics a surface can be represented as a set of pieces of planes. The intersection of a ray of light with each plane is used to produce an image of the surface.
The algorithm can be generalised to cover intersection with other planar figures, in particular, the intersection of a polyhedron with a line.