In analytic geometry, the intersection of a line and a plane in three-dimensional space can be the empty set, a point, or a line.
It is the entire line if that line is embedded in the plane, and is the empty set if the line is parallel to the plane but outside it.
Otherwise, the line cuts through the plane at a single point.
Distinguishing these cases, and determining equations for the point and line in the latter cases, have use in computer graphics, motion planning, and collision detection.
In vector notation, a plane can be expressed as the set of points
is a normal vector to the plane and
denotes the dot product of the vectors
The vector equation for a line is where
is a unit vector in the direction of the line,
is a scalar in the real number domain.
Substituting the equation for the line into the equation for the plane gives Expanding gives And solving for
then the line and plane are parallel.
then the line is contained in the plane, that is, the line intersects the plane at each point of the line.
Otherwise, the line and plane have no intersection.
there is a single point of intersection.
can be calculated and the point of intersection,
A general point on a line passing through points
Similarly a general point on a plane determined by the triangle defined by the points
The point at which the line intersects the plane is therefore described by setting the point on the line equal to the point on the plane, giving the parametric equation: This can be rewritten as which can be expressed in matrix form as where the vectors are written as column vectors.
This produces a system of linear equations which can be solved for
If the solution satisfies the condition
, then the intersection point is on the line segment between
Likewise, if the solution satisfies
If the solution additionally satisfies
, then the intersection point lies in the triangle formed by the three points
The determinant of the matrix can be calculated as If the determinant is zero, then there is no unique solution; the line is either in the plane or parallel to it.
If a unique solution exists (determinant is not 0), then it can be found by inverting the matrix and rearranging: which expands to and then to thus giving the solutions: The point of intersection is then equal to 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.
In vision-based 3D reconstruction, a subfield of computer vision, depth values are commonly measured by so-called triangulation method, which finds the intersection between light plane and ray reflected toward camera.
The algorithm can be generalised to cover intersection with other planar figures, in particular, the intersection of a polyhedron with a line.