P1.X = 0: P1.Y = 0: P1.Z = 0 'base triangle
P2.X = 0: P2.Y = 4: P2.Z = 0 'base triangle
P3.X = 3: P3.Y = 0: P3.Z = 0 'base triangle
P4.X = 1: P4.Y = 1: P4.Z = 0 'point to test
DISTANCE P1, P2, d1 'side lengths of base triangle
DISTANCE P1, P3, d2 'side lengths of base triangle
DISTANCE P2, P3, d3 'side lengths of base triangle
DISTANCE P1, P4, d4 'other side lengths of tetrahedron
DISTANCE P2, P4, d5 'other side lengths of tetrahedron
DISTANCE P3, P4, d6 'other side lengths of tetrahedron
AREA d1, d2, d3, a1 'base triangle
AREA d1, d4, d5, a2 'other
AREA d2, d4, d6, a3 'other
AREA d3, d5, d6, a4 'other
'Heron's formula for area of a triangle
ta = (var1 + var2 + var3) / 2
var4 = (ta * (ta - var1) * (ta - var2) * (ta - var3)) ^ .5
var3 = ((Var1.X - var2.X) ^ 2 + (Var1.Y - var2.Y) ^ 2 + (Var1.Z - var2.Z) ^ 2) ^ .5