Application Center - Maplesoft

App Preview:

The Intersection of a Line and a Plane

You can switch back to the summary page by clicking here.

Learn about Maple
Download Application


 

Ray and Object Intersections: Plane

>


by Otto Wilke

otto_wilke@hotmail.com

I am vaguely aware that graphics is normally done with vector operations, generic

solids positioned at the origin, and transformation matrices to move rays to and fro.

I thought it would be interesting to use rectangular coordinates and objects located

anywhere in space and oriented in any direction.

This is one of four files covering the plane, the sphere, the cylinder, and the cone.

INTERSECTION OF A LINE AND A PLANE

The general equation of a plane is

> A*x+B*y+C*z+D=0;

A*x+B*y+C*z+D = 0

After division by D, and redefining A, B, and C

> A*x+B*y+C*z+1=0;

A*x+B*y+C*z+1 = 0

Any three points define a plane.  Using the points (1,5,-4), (1,1,-2), and (8,1,-2), solve

three simultaneous equations for A, B, and C.

> solve({A+5*B-4*C+1=0,A+B-2*C+1=0,8*A+B-2*C+1=0},{A,B,C});

{A = 0, B = 1/3, C = 2/3}

For the three points,

> y/3+2*z/3+1=0;

1/3*y+2/3*z+1 = 0

or,

> y+2*z+3=0;

y+2*z+3 = 0

If a line L with direction numbers A, B, and C is normal to a plane P, then P has the form

> A*x+B*y+C*z+D=0;

A*x+B*y+C*z+D = 0

Any multiple of 0*x+1*y+2*x+3=0 would give the A, B, C, and D for a line perpendicular to the plane above.

>

If P1(x1,y1,z1) and P2(x2,y2,z2) are two points on a line L, then A=(x2-x1), B=(y2-y1), and C=(z2-z1) are

direction numbers of L.  The line L on the point P1 and with direction numbers A, B, and C has parametric equations

> x = x1 + A*t; y=y1+B*t;z=z1+C*t;

x = x1+A*t

y = y1+B*t

z = z1+C*t

If P1(x1,y1,z1) and P2(x2,y2,z2) are two points on a line L, not necessarily perpendicular to a particular plane P, then a=(x2-x1), b=(y2-y1), and c=(z2-z1) are

direction numbers of L.  The line L on the point P1 and with direction numbers a, b, and c has parametric equations

> x = x1 + a*t; y=y1+b*t;z=z1+c*t;

x = x1+a*t

y = y1+b*t

z = z1+c*t

To find the intersection of a line and a plane, solve the simultaneous equations for x, y, z, and t.

> A*x+B*y+C*z+D=0;x = x1 + a*t; y=y1+b*t;z=z1+c*t;

A*x+B*y+C*z+D = 0

x = x1+a*t

y = y1+b*t

z = z1+c*t

> solve({x = x1 + a*t, y=y1+b*t,z=z1+c*t,A*x+B*y+C*z+D=0},{x,y,z,t});

{t = -(A*x1+B*y1+C*z1+D)/(A*a+B*b+C*c), z = (z1*A*a+z1*B*b-c*A*x1-c*B*y1-c*D)/(A*a+B*b+C*c), y = (y1*A*a+y1*C*c-b*A*x1-b*C*z1-b*D)/(A*a+B*b+C*c), x = -(-x1*B*b-x1*C*c+a*B*y1+a*C*z1+a*D)/(A*a+B*b+C*c)}

For the plane above, and a line through the origin and having direction numbers (1, -1, 2)

> solve({x=0+1*t , y=0-1*t , z=0+2*t , y+2*z+3=0},{x,y,z,t});

>

{t = -1, z = -2, y = 1, x = -1}

> with(plots):

> plot1:=implicitplot3d(y+2*z+3=0,x=-3..3,y=-3..3,z=-3..3):

> plot2 := arrow(<0,0,0>, <-1,1,-2>, difference, color=red):

> display({plot1,plot2});

[Plot]

>