You'll need to consider three cases: Plane is parallel to line, and line does not lie in plane (no intersection) Plane is not parallel to line (one point of intersection) Plane contains the line (line intersects at every point on it) You can express the line in paramaterized form, like here: answers.yahoo.com/question/index?qid=200... The first few pages of this lecture do the same for the plane: math.mit.edu/classes/18.02/notes/lecture... If the normal to the plane is perpendicular to the direction along the line, then you have an edge case and need to see whether it intersects at all, or lies within the plane Otherwise, you have one point of intersection, and can solve for it I know this isn't code but to get a robust solution you'll probably want to put this in the context of your application EDIT: Here's an example for which there's exactly one point of intersection. Say you start with the parameterized equations in the first link: x = 5 - 13t y = 5 - 11t z = 5 - 8t The parameter t can be anything. The (infinite) set of all (x, y, z) that satisfy these equations comprise the line.
Then, if you have the equation for a plane, say: x + 2y + 2z = 5 (taken from here ) you can substitute the equations for x y and z above into the equation for the plane, which is now in only the parameter t Solve for t This is the particular value of t for that line that lies in the plane. Then you can solve for x y and z by going back up to the line equations and substituting t back in.
You'll need to consider three cases: Plane is parallel to line, and line does not lie in plane (no intersection) Plane is not parallel to line (one point of intersection) Plane contains the line (line intersects at every point on it) You can express the line in paramaterized form, like here: answers.yahoo.com/question/index?qid=200... The first few pages of this lecture do the same for the plane: math.mit.edu/classes/18.02/notes/lecture... If the normal to the plane is perpendicular to the direction along the line, then you have an edge case and need to see whether it intersects at all, or lies within the plane. Otherwise, you have one point of intersection, and can solve for it. I know this isn't code but to get a robust solution you'll probably want to put this in the context of your application.
EDIT: Here's an example for which there's exactly one point of intersection. Say you start with the parameterized equations in the first link: x = 5 - 13t y = 5 - 11t z = 5 - 8t The parameter t can be anything. The (infinite) set of all (x, y, z) that satisfy these equations comprise the line.
Then, if you have the equation for a plane, say: x + 2y + 2z = 5 (taken from here) you can substitute the equations for x, y, and z above into the equation for the plane, which is now in only the parameter t. Solve for t. This is the particular value of t for that line that lies in the plane.
Then you can solve for x, y, and z by going back up to the line equations and substituting t back in.
Thanks, that's very helpful, but I'm still a little baffled. I understand how to get the equation for the line, that's pretty simple. But from there on I'm stuck.In lamen's terms, what exactly does the 'equation' of a plane mean?
And what do I do to work out the point of intersection once both equations are solved? – jt78 Apr 14 at 17:25 What information do you know about your plane? Points in the plane, for example?
– John Apr 14 at 17:36 Pretty much anything, I think. I know at least 4 points on the plane, and it's defined independently so I should be able to find out almost anything. – jt78 Apr 14 at 17:53 See my edits, jt78.
– John Apr 14 at 18:24.