Harman Patil (Editor)

Line–plane intersection

Updated on
Edit
Like
Comment
Share on FacebookTweet on TwitterShare on LinkedInShare on Reddit
Line–plane intersection

In analytic geometry, the intersection of a line and a plane can be the empty set, a point, or a line. 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.

Contents

Algebraic form

In vector notation, a plane can be expressed as the set of points p for which

( p p 0 ) n = 0

where n is a normal vector to the plane and p 0 is a point on the plane. (The notation a b denotes the dot product of the vectors a and b .)

The vector equation for a line is

p = d l + l 0 d R

where l is a vector in the direction of the line, l 0 is a point on the line, and d is a scalar in the real number domain. Substituting the equation for the line into the equation for the plane gives

( d l + l 0 p 0 ) n = 0.

Expanding gives

d l n + ( l 0 p 0 ) n = 0.

And solving for d gives

d = ( p 0 l 0 ) n l n .

If l n = 0 then the line and plane are parallel. There will be two cases: if ( p 0 l 0 ) n = 0 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.

If l n 0 there is a single point of intersection. The value of d can be calculated and the point of intersection is given by

d l + l 0 .

Parametric form

A line is described by all points that are a given direction from a point. Thus a general point on a line can be represented as

l a + ( l b l a ) t , t R

where l a = ( x a , y a , z a ) and l b = ( x b , y b , z b ) are two distinct points along the line.

Similarly a general point on a plane can be represented as

p 0 + ( p 1 p 0 ) u + ( p 2 p 0 ) v , u , v R

where p k = ( x k , y k , z k ) , k = 0 , 1 , 2 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 point on the line equal to the point on the plane, giving the parametric equation:

l a + ( l b l a ) t = p 0 + ( p 1 p 0 ) u + ( p 2 p 0 ) v

This can be rewritten as

l a p 0 = ( l a l b ) t + ( p 1 p 0 ) u + ( p 2 p 0 ) v ,

which can be expressed in matrix form as:

[ x a x 0 y a y 0 z a z 0 ] = [ x a x b x 1 x 0 x 2 x 0 y a y b y 1 y 0 y 2 y 0 z a z b z 1 z 0 z 2 z 0 ] [ t u v ]

The point of intersection is then equal to

l a + ( l b l a ) t

If the line is parallel to the plane then the vectors l b l a , p 1 p 0 , and p 2 p 0 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 t [ 0 , 1 ] , , then the intersection point is on the line between l a and l b .

If the solution satisfies

u , v [ 0 , 1 ] , ( u + v ) 1 ,

then the intersection point is in the plane inside the triangle spanned by the three points p 0 , p 1 and p 2 .

This problem is solved by inverting the matrix:

[ t u v ] = [ x a x b x 1 x 0 x 2 x 0 y a y b y 1 y 0 y 2 y 0 z a z b z 1 z 0 z 2 z 0 ] 1 [ x a x 0 y a y 0 z a z 0 ] .

Uses

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.

References

Line–plane intersection Wikipedia