Suppose I have a line as follows:
p = p0 + tv = (x0, y0, z0) + t(vx, vy, vz); where vector ‘v’ is normalized.
and a plane: 4x - 2y + 2z = 5
Now I found the point of intersection by determining the value of t as follows:
Suppose xA, yA, zA is the point of intersection.
xA = (x0 + vxtA), yA = (y0+ vytA), zA = (z0 + vz*tA);
Now substituting this value in equation of plane,
4*(x0 + vxtA) - 2(y0+ vytA) + 2 (z0 + vz*tA)= 5, I can find the value of tA.
Now my question is what value of tA will determine whether the line intersects the plane: is it any positive value or any value between 0 and 1. The question may be a bit silly, but I need some clarification.
Thank you all in advance.
The line intersects the plane if you can find a value of tA that solves your equation. If the equation does not have a solution, line and plane do not intersect. If any value of tA solves the equation, the line is in fact in the plane.
In other words, the number of solutions (0, 1, infinitely many) determines whether there is an intersection or not.
The answer comes if you think geometrically.
If the line is parallel to the plane, then it either never intersects or is completely on the plane. Both cases do not have “the point” of intersection.
So you are left with deciding when is a line parallel to a plane.
A plane is given by Ax+By+Cz+D=0, a vector perpendicular to the plane is N=(A,B,C). A line given by p(t)=p0 + t*(vx,vy,vz) is going in direction v=(vx,vy,vz), so the line is parallel to the plane if and only if v and N are perpendicular, i.e. dot( (vx,vy,vz), (A,B,C) )=0… I’d advise doing some normalizing of v and N and deciding on a reasonable tolerance.
Thank you very much for the clarification.