Given two three dimensional points. find the z coordinate of a third point that has two known coordinates. I'm not entirely sure how to solve this system. I'll be implementing this into an algorithm so any additional pointers in that direction would be appreciated.
Example 1:
Point 1 = (1,1,5);
Point 2 = (2,2,10);
------------------
Point 3 = (3,3,?);
Example 2:
Point 1 = (2,6,5);
Point 2 = (4,40,10);
------------------
Point 3 = (3,23,?);
Example 3:
Point 1 = (0,6,5);
Point 2 = (0,40,10);
------------------
Point 3 = (0,20,?);
Ah, forgot to mention that these two points (and the subsequent third point) are on a line. I can also extend the sample size from 2 to N before runtime (where, in the above example, the 3rd point, is calculated).
The line through two points $r_1=(x_1,y_1,z_1)$ and $r_2=(x_2,y_2,z_2)$ is parametrised as
$$r(t) = r_1 + t\cdot (r_2 - r_1)$$
That means, for the first example you provided, it's
$$(x(t),y(t),z(t)) = (1,1,5) + t\cdot ((2,2,10) - (1,1,5)) = (1,1,5) + t\cdot (1,1,5)$$
Now, knowing that at $t=t_3$, you will have $(x(t_3),y(t_3), z(t_3)) = (3,3,0)$, you can use the equation $1 + 1\cdot t_3 = 3$ to determine that $t_3=2$, meaning that $r(t_3) = (3,3,15)$