I'm intersecting a line in 2D and I calculate the X,Y coordinates of the intersection point. What I need is the Z of the intersection point given the X,Y,Z of the line points, and the X,Y of the intersection. From what I understand of equations it should be a one-liner but I don't know enough math to get there.
Your question is rather vague, but I will try to answer.
So take following equation:

Let's note it as Fx(X) = Fy(Y) = Fz(Z) and take a part of it:
Fx(X) = Fz(Z)Then you said you know x, y and z for two points, put it to x1, x2, z1, z2 accordingly. Then put x of intersection to x. Now you have a linear equation with one variable z. Here it is:
z = (x - x1) / (x2 - x1) * (z2 - z1) + z1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With