Recently, I've been trying to make a program that calculates the intersection of a line and a plane. To do so, I need a universal equation. Here's the question.
Let's say there's a plane in 3d space, with a normal vector n of $<x_1,y_1,z_1>$. The point $(x_2,y_2,z_2)$ lies on the plane as well. There is also a line that passes through points $(x_3,y_3,z_3)$ and $(x_4,y_4,z_4)$. What, in terms of those variables, are the co-ordiantes of the intersection between the line and the plane?
I've tried solving it myself, but I got the following, which doesn't seem to work at all.
$$x= x_3 + \frac{x_1x_2+y_1y_2+z_1z_2}{(x_3-x_1)(y_3-y_1)(z_3-z_1)(z_1)(x_1)(y_1)}(x_3-x_1)$$
$$y= y_3 + \frac{x_1x_2+y_1y_2+z_1z_2}{(x_3-x_1)(y_3-y_1)(z_3-z_1)(z_1)(x_1)(y_1)}(y_3-y_1)$$
$$z= z_3 + \frac{x_1x_2+y_1y_2+z_1z_2}{(x_3-x_1)(y_3-y_1)(z_3-z_1)(z_1)(x_1)(y_1)}(z_3-z_1)$$