Testing Whether a Vertical Line Intersects a Plane Okay, so, I'm not the greatest with geometry (I actually need this for game development), but basically, I need to be able to test whether a vertical (the y-axis is my vertical axis for this) line intersects a triangular plane. I know the 3 vertices of the triangle. The vertical line is actually a line segment, and I know the 2 points that define it. I was thinking that maybe I could test, if the top point on the line is above the plane, and the bottom point is below the plane, then there is an intersection. How would you suggest doing this? I also know that the triangle plane will never be parallel to the y-axis (it never makes a vertical wall), so we don't have to worry about that case. I guess if I could determine the y value on the plane at a given x and z, I could use that, but I don't know how to do that given the 3 vertices that I have. Or maybe I'm thinking about this completely wrong.
 A: My first thought is maybe not the best, but it might be computationally feasible.
Since the triangle is not parallel to the y-axis, the plane of the triangle (i.e. if we extend the triangle's sides out... forever) will intersect the line segment's extension. We then do two checks: we check if this point of intersection is actually on the line segment rather than the line (easy check, that's why I mention it first), and then we check if the point is within the triangle itself.
For finding the intersection, I refer you to here. 
Is this sufficient?
A: To determine whether the point is in the triangle: The origin is on or inside the triangle with vertices $(x_1,y_1)$, $(x_2,y_2)$, and $(x_3,y_3)$ if and only if there are $a,b,c \ge 0$ such that $a+b+c=1$, $ax_1+bx_2+cx_3 = 0$, and $ay_1+by_2+cy_3 = 0$. Thus, you need only solve the system $$\left(\begin{array}{ccc}
1 & 1 & 1 \\
x_1 & x_2 & x_3 \\
y_1 & y_2 & y_3 \end{array}\right) \left(\begin{array}{c}
a \\
b \\
c \end{array}\right) = \left(\begin{array}{c}
1 \\
0 \\
0 \end{array}\right)$$ and then check whether $a,b,c \ge 0$.
