Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line of intersection between two planes

How can I find the line of intersection between two planes?

I know the mathematics idea, and I did the cross product between the the planes normal vectors

but how to get the line from the resulted vector programmatically

like image 379
AMH Avatar asked Jun 20 '11 08:06

AMH


People also ask

What do you call the intersection of 2 planes?

The intersection of two planes is called a line. Planes are two-dimensional flat surfaces.


1 Answers

The equation of the plane is ax + by + cz + d = 0, where (a,b,c) is the plane's normal, and d is the distance to the origin. This means that every point (x,y,z) that satisfies that equation is a member of the plane.

Given two planes:

P1: a1x + b1y + c1z + d1 = 0
P2: a2x + b2y + c2z + d2 = 0

The intersection between the two is the set of points that verifies both equations. To find points along this line, you can simply pick a value for x, any value, and then solve the equations for y and z.

y = (-c1z -a1x -d1) / b1
z = ((b2/b1)*(a1x+d1) -a2x -d2)/(c2 - c1*b2/b1)

If you make x=0, this gets simpler:

y = (-c1z -d1) / b1
z = ((b2/b1)*d1 -d2)/(c2 - c1*b2/b1)
like image 83
R. Martinho Fernandes Avatar answered Sep 29 '22 06:09

R. Martinho Fernandes