The point is either above or under the triangle i.e. if you project the point and the triangle on the ground, the point lies in the triangle.
I want the distance DD' (in dark red) on the Z axis of the point to the triangle given the carthesian coordinates of A, B, C and D. See diagram. Z is used as the altitude, it's placed correctly on the diagram.

Compute $$\frac{(D-A)\cdot n}{e_3\cdot n}$$ where $n=(B-A)\times (C-A)$.