How do I calculate the fourth vertex of a tetrahedron given the other three?

216 views Asked by At

I want to calculate the fourth vertex of a regular tetrahedron. I have the coordinates

{0, 0, Sqrt[2/3] - 1/(2 Sqrt[6])}, {-(1/(2 Sqrt[3])), -(1/2), -(1/(2 Sqrt[6]))} and {-(1/(2 Sqrt[3])), 1/2, -(1/(2 Sqrt[6]))}

Can anybody please help?

1

There are 1 answers

0
MBo On BEST ANSWER

Find the center of face

cx = (x1 + x2 + x3)/3 and similar for y,z

Get two edge vectors

e2x = x2 - x1
e2y = y2 - y1
e2z = z2 - z1
e3x = x3 - x1
e3y = y3 - y1
e3z = z3 - z1

Calculate edge len

elen = sqrt(e2x*e2x+e2y*e2y+e2z*e2z)

Calculate vector product to get normal to this face

nx = e2y*e3z - e2z*e3y 
ny = e2z*e3x - e2x*e3z 
nz = e2x*e3y - e2y*e3x

Make unit normal

nlen = sqrt(nx*nx+ny*ny+nz*nz)
nx = nx / nlen
...

Make normal of needed length (tetrahedron height)

lnx = nx * sqrt(2/3) * elen
...

Add this normal to the face center

x4 = cx +/- lnx
y4 = cy +/- lny
z4 = cz +/- lnz

+/- signs correspond to two possible positions of the fourth vertex