## height of point on a triangle

I am trying to get the Z value of a point on this image:

I have the z,x,y of the corners as well as the x,y of a point.

Also all the angles on the x, y axis are either 45 or 90 degrees.

I was told that
the equation of the plane is . To determine the coefficients let be the value of for one of the four known points . For example, is the value for the point

Then set , and For the fifth point ,

Since 3 points determine a plane, the fourth known point should satisfy

The equation of a plane is . To determine the coefficients let be the value of for one of the four known points . For example, is the value for the point

Now let denote the fifth point. Take the first triangle to be (0,0), (64,0) and (0,64). The fifth point is in this triangle if Then set , and For the fifth point,

The second triangle is (64,64), (64,0) and (0,64). The fifth point is in this triangle if Then set , and For the fifth point,
I understand the part about "if X+Y <+ 64 Then..." and the breaking it up into a triangle however in regards to the actual using of the formula I understand it about halfway . I need to write it into a program and as such I was wondering if someone would help me simplify it or explain it in simple terms (no subscripts ect or explain the sbscripts ect) so I can understand it well enough to use it.