Mehdi
Mehdi

Reputation: 13

How to find the intersection points of two plane

I didn't find any answer to my question by searching. So it could either be so simple or too difficult. So, please bear with me.

I have two plane intersected with each other as you can see in the picture.

The inclined plane is plotted using X,Y and Z matrices (surf(X,Y,Z)). The second plane has the same X and Y matrices with simply Z a zero matrix. Now I am interested in finding the X and Y values where both plane intersect.

Upvotes: 1

Views: 1791

Answers (1)

G Fetterman
G Fetterman

Reputation: 456

The solution is equally simple whether you start with the plane equations or only the matrices of values.

With the plane equations, you have two equations in three unknowns. Resolve that to one equation in two unknowns (X and Y), and you have your intersection line, from which you can generate any desired set of intersection points.

With the matrices, you know the relevant z-value - it's zero. Choose your favorite search method to find the indices in the original Z matrix at which the value is zero. You obtain the intersection point set by using these to index into the X and Y matrices. (And if the values in Z don't ever exactly hit zero, all you need to do is interpolate.)

The reasons for the simplicity are that (a) your objects are planes, and (b) one of them is parallel to a basis vector for the space.

Relaxing the (b) constraint adds only the complexity of having to subtract the two planes from one another to allow (b) to hold again. (This is only helpful if you don't have the plane equations; if you do, you can apply the solution given for any two planes, regardless of orientation.)

If (a) is relaxed, however, the problem becomes nontrivial - it can be quite computationally intensive to determine the intersection space of arbitrary manifolds, as the vast literature on collision detection in games and robotics will attest.

Addendum: This link appears to cover the idea more explicitly, but it does not assume that the surfaces are planes, and so contains added complexity that you don't need here.

Upvotes: 1

Related Questions