Line of intersection between two planes

后端 未结 6 1519
有刺的猬
有刺的猬 2020-12-01 07:12

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

b

6条回答
  •  时光取名叫无心
    2020-12-01 07:33

    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)
    

提交回复
热议问题