Did you know that Heronian Tetrahedra Are Lattice Tetrahedra? A Heronian tetrahedron is a tetrahedron where
- the length of each edge is an integer,
- the area of each face is an integer, and
- the volume of the tetrahedron is an integer.
It's always possible to place such a tetrahedron in space such that all of the vertices have integer coordinates: \$(x,y,z) \in \mathbb{Z}^3\$.
Example
Consider the tetrahedron oriented so that the base is a triangle \$\triangle ABC\$ and the fourth point is \$D\$ and where \$AB = 200\$, \$AC = 65\$, \$AD = 119\$, \$BC = 225\$, \$BD = 87\$, and \$CD = 156\$.
(You can check that the faces all have areas that are integers, and the volume is an integer too.)
Then we can give explicit integer coordinates: \begin{align*} A &= (0,60,0)\\ B &= (96,180,128)\\ C &= (15,0,20)\\ D &= (63,144,56) \end{align*}
(This is shifted from the tetrahedron illustrated in Susan H. Marshall and Alexander R. Perlis's paper.)
Example Data
From Jan Fricke's paper On Heron Simplices and Integer Embedding
AB | AC | AD | BC | BD | CD | coordinates
-----+-----+-----+-----+-----+-----+------------------------------------------------
117 | 84 | 80 | 51 | 53 | 52 | (0,0,0) (108,36,27) (84,0,0) (64,48,0)
160 | 153 | 120 | 25 | 56 | 39 | (0,0,0) (128,96,0) (108,108,9) (72,96,0)
225 | 200 | 87 | 65 | 156 | 119 | (0,0,0) (180,108,81) (120,128,96) (36,72,33)
Challenge
This is a code-golf challenge. Given a list of lengths of sides of a Heronian tetrahedron [AB, AC, AD, BC, BD, CD]
, return any valid collection of integer coordinates for \$A = (x_A, y_A, z_A)\$, \$B = (x_B, y_B, z_B)\$, \$C = (x_C, y_C, z_C)\$, and \$D = (x_D, y_D, z_D)\$. If one of the coordinates is the origin, you can omit it.
-60
in the diagram. Anyway that's just an example of the math. The challenge is the three lines at the bottom of the question. Most solutions are going to consider the orign as one of the four points - hence att is asking whether we need to output it. \$\endgroup\$