From: Nebula
Find the slope between the middle point and the lower right corner point. Then multiply the slope by the distance between the Random point and lower right corner point.
The random point may not lie between the middle and the lower right corner. Also how you do find the 'slope' of a 3D plane? I get where your idea comes from, solving a linear eqn by finding the gradient then using formula like y=mx+c, y-y1=m(x-x1), practical for 2D but i don't think it works for 3D :p
To find the direction vector of the plane, take any
2 position vector and subtract them. (do this twice for 2 dir vector)
(5,7,10)-(10,2,7) = (-5, 5, 3)
(10,2,7)-(2,2,5) = (8, 0, 2)
Forming the eqn…
1 position vector + (2 direction vector, where their prefix can be any real numbers).
r = (10, 2, 7) + a(-5,5,3) + b(8,0,2), where a and b are any real numbers.
Subbing in the unknown point…
(7,3,z) = (10, 2, 7) + (-5a, 5a, 3a) + (8b, 0, 2b)
Comparing the x-plane: 7 = 10 - 5a + 8b —-(1)
Comparing the y-plane: 3 = 2 -5a —-(2)
Solving the simultaneous eqn through elimination:
from (2): 5a = -1 => a = -1/5
sub 5a into (1): 7 = 10 -(-1) + 8b => b= -0.5
Actually in this case as value of b in eqn 2 is 0 the situation is easier, if not you have to sub back value of b into one of the eqn to find a.
Now that we have values for a and b, compare z-plane…
z = 7 + 3 (-1/5) + 2 (-0.5)
z = 5.4
Therefore the random point is (7, 3, 5.4).
I'm not sure if i made any careless mistake so do check the working :p
If you have doubts over any step i can explain them clearer too.