# Calculate coordinate of any point on triangle in 3D plane

I am really stuck and can’t find right way to write a formula(s) that will calculate Z coordinate of point on triangle plane in 3D plane.

I know all coordinates of triangle points ( Ax, Ay, Az, Bx, By, Bz, Cx, Cy, Cz ), and I know x and y of point, but I need z where it’s touching triangle plane.

I am pretty sure I am going wrong way, but I want to tell you what I have done so far…
I figured out that if point is closer to triangle angle it’s more effected by it, so I calculated how far is it from each angle, and by that it’s clear, each triangle point is “pulling” point to his Z coordinate, and the closer the point the more strength it has.

I went over and over, and couldn’t find a way to put this in formula.

I used 3D program as simulation and I know right missing Z coordinate, but I can’t find formula that can calculate it…

Here is the info:

    x    y   z
A ( 0,   0,  0 )
B ( 80, 50, 20 )
C ( 10, 60, 10 )

X ( 50, 45, 14.418* )

• Missing coordinate that needs to be calculated approximately from 3D program…

Here is the image from the program, if needed, just coordinates are switched here, but you can get the clue how it looks like and what needs to be calculated…

If anyone know formula for this that will be a life saving!

Thanks!

Found answer here: Finding the missing coordinate of a point within a 3D triangle

#### Solutions Collecting From Web of "Calculate coordinate of any point on triangle in 3D plane"

The equation of the plane is given by

$$\left|\begin{matrix}x-A_x & y -A_y & z-A_ z \\ B_x-A_x & B_y -A_y & B_z-A_ z\\ C_x-A_x & C_y -A_y & C_z-A_ z\end{matrix}\right|=0.$$

Thus:

$$z=A_z+\frac{(B_x-A_x)(C_z-A_z)-(C_x-A_x)(B_z-A_z)}{(B_x-A_x)(C_y-A_y)-(C_x-A_x)(B_y-A_y)}(y-A_y)\\-\frac{(B_y-A_y)(C_z-A_z)-(C_y-A_y)(B_z-A_z)}{(B_x-A_x)(C_y-A_y)-(C_x-A_x)(B_y-A_y)}(x-A_x)$$

The determinant formed by the rows B,C,X of your notation should be zero if the points all are on a plane. That should give the value of the missing coordinate.

In your case that determinant is $100(43z-620)$ so $z=620/43=14.4186.$