Let $P_1,\ldots,P_6$ denote the vertices of the octahedron,
with $P_i$ being opposite $P_j$ if and only if $i+j=7$.
In here, indices $i,j,\ldots$ are always from $\{1,2,\ldots,6\}$.
Let $D_{ij} = D_{ji}$ be the squared euclidean distance between $P_i$ and $P_j$.
We know $D_{ij}$ unless $i+j=7$. Thus exactly three $D_{ij}$ with $i<j$ are unknown.
Suppose for a moment that we had the vertices given in cartesian coordinates:
$P_i = (x_i, y_i, z_i)$. Then a formula for the oriented octahedron's volume $V$
would be
$$ 6V = \begin{vmatrix}
1 & 0 & 0 & x_1 & y_1 & z_1 \\
0 & 1 & 0 & x_2 & y_2 & z_2 \\
0 & 0 & 1 & x_3 & y_3 & z_3 \\
0 & 0 & 1 & x_4 & y_4 & z_4 \\
0 & 1 & 0 & x_5 & y_5 & z_5 \\
1 & 0 & 0 & x_6 & y_6 & z_6
\end{vmatrix}
= \begin{vmatrix}
(x_4 - x_3) && (y_4 - y_3) && (z_4 - z_3) \\
(x_5 - x_2) && (y_5 - y_2) && (z_5 - z_2) \\
(x_6 - x_1) && (y_6 - y_1) && (z_6 - z_1)
\end{vmatrix}$$
In other words, the octahedron's volume is $1/6$ of the volume of the parallelepiped
spanned by its diagonal vectors.
Squaring the above equation and using multiplicativity of determinants, we get
$$\begin{align}
288\,V^2 &= \det\left(\left(2\langle P_{7-i}-P_i,
P_{7-j}-P_j\rangle\right)\right)_{i,j=1,\ldots,3}
\\ &= \det\left(\left(D_{i,7-j}-D_{i,j}+D_{7-i,j}-D_{7-i,7-j}\right)\right)_{i,j=1,\ldots,3}
\\ &= \begin{vmatrix}
2\color{red}{D_{16}} & (D_{15}-D_{12}+D_{62}-D_{65}) & (D_{14}-D_{13}+D_{63}-D_{64})
\\ (D_{26}-D_{21}+D_{51}-D_{56}) & 2\color{red}{D_{25}} & (D_{24}-D_{23}+D_{53}-D_{54})
\\ (D_{36}-D_{31}+D_{41}-D_{46}) & (D_{35}-D_{32}+D_{42}-D_{45}) & 2\color{red}{D_{34}}
\end{vmatrix}
\end{align}$$
with unknowns displayed in red.
A Cayley-Menger-like version of the above formula is
$$288\,V^2 = \begin{vmatrix}
0 &0 &0 &1 &0 &0 &0 &0 &1
\\ 0 &0 &0 &0 &1 &0 &0 &1 &0
\\ 0 &0 &0 &\color{blue}1 &\color{blue}1 &1 &1 &\color{blue}1 &\color{blue}1
\\ 1 &0 &\color{blue}1 &0 &D_{12} &D_{13} &D_{14} &D_{15} &\color{red}{D_{16}}
\\ 0 &1 &\color{blue}1 &D_{21} &0 &D_{23} &D_{24} &\color{red}{D_{25}} &D_{26}
\\ 0 &0 &1 &D_{31} &D_{32} &0 &\color{red}{D_{34}} &D_{35} &D_{36}
\\ 0 &0 &1 &D_{41} &D_{42} &\color{red}{D_{43}} &0 &D_{45} &D_{46}
\\ 0 &1 &\color{blue}1 &D_{51} &\color{red}{D_{52}} &D_{53} &D_{54} &0 &D_{56}
\\ 1 &0 &\color{blue}1 &\color{red}{D_{61}} &D_{62} &D_{63} &D_{64} &D_{65} &0
\end{vmatrix}$$
Note that the blue ones have replaced zeros without changing the determinant.
Now the lower right $7\times 7$ symmetric submatrix $M$ is a
Cayley-Menger matrix
which must have rank strictly less than $6$ and therefore a nullity of at least $2$.
More verbosely, there exists a $k=2$-dimensional subspace of $\mathbb{R}^7$ upon which
$M$ operates like a zero.
This essentially removes $k(k+1)/2=3$ degrees of freedom from $M$.
We will use that fact to eliminate the unknowns $D_{16},D_{25},D_{34}$.
However, we won't try to find eigenspaces; instead we will employ the
equivalent but more practical condition that
the adjugate matrix of $M$
must be zero. That gives a lot of equations, though not all of those are independent.
If you had abundant time or computing power, you could try the following
Sage script:
R.<W,D12,D13,D14,D15,D16,D23,D24,D25,D26,D34,D35,D36,D45,D46,D56> = QQ[]
KM = matrix(R, [
[0, 0, 0, 1, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 1, 0, 0, 1, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1],
[1, 0, 1, 0, D12, D13, D14, D15, D16],
[0, 1, 1, D12, 0, D23, D24, D25, D26],
[0, 0, 1, D13, D23, 0, D34, D35, D36],
[0, 0, 1, D14, D24, D34, 0, D45, D46],
[0, 1, 1, D15, D25, D35, D45, 0, D56],
[1, 0, 1, D16, D26, D36, D46, D56, 0]
])
pv = KM.det() - 2*W # Octahedron's volume formula; W = (12*V)^2
CM = KM[2:,2:] # Cayley-Menger matrix, 7*7, rank less than 6
AM = CM.adjoint() # all entries constrained to be zero
# Many of the AM[i,j]==0 are redundant, but it does not hurt to give as many
# low-degree equations as we can; this helps finding a good ideal basis.
constraints = [AM[h,k] for h in range(7) for k in range(h+1)]
I = R.ideal([pv] + constraints)
J = I.elimination_ideal([D16,D25,D34]) # massive effort here
# Exactly one equation left: len(J.gens()) == 1
wpoly = J.gen(0)
That would get you a polynomial wpoly
that, when set equal to zero, states the
algebraic relation between $W$ and the (non-diagonal) edge length squares.
Then you would just need to plug in the edge lengths, solve for $W$,
discard non-real or negative solutions, and finally compute $V=(\sqrt{W})/12$
for the remaining $W$.
Several solutions are possible because giving distances cannot recover orientation information;
conceptually you might flip vertices beyond their neighbors and thus find other valid
configurations with different shapes.
Unfortunately, carrying all those free edge length parameters around was
so much of a burden for my version of Sage (and Maxima, and Singular) that I had
to abort the above computation. It took too long, or it ran out of memory.
Let us simplify the case to what you have indicated in your drawing:
Let $P_1$ be the leftmost vertex, $P_2$ foremost, $P_3$ downmost.
Then set
$$\begin{align}
A &= D_{12} = D_{13} = D_{23}
& B & = D_{14} = D_{15} = D_{45}
\\ C &= D_{24} = D_{26} = D_{46}
& D &= D_{35} = D_{36} = D_{56}
\end{align}$$
That's only four free parameters.
Alas, my old platform (or my patience) still cannot handle that.
Let's use a little trick. Replace $W$ with $F^3$. Then $F$ has the physical
dimension of a squared length, as all the other parameters.
Thus, the polynomial equation we seek between $A,B,C,D,F$ will be homogeneous.
Equivalently, we can now fix $D = 1$, compute an inhomogeneous solution polynomial,
and homogenize that again, thus recovering the correct power of $D$ in every monomial.
This actually works:
R.<D16,D25,D34,F,W,A,B,C,D> = QQ[]
# W = F^3 = (12*Vol)^2
# Dij = squared distance between vertices i and j; diagonal iff i+j == 7
# A = D12 = D13 = D23
# B = D14 = D15 = D45
# C = D24 = D26 = D46
# D = D35 = D36 = D56
KM_full = matrix(R, [
[0, 0, 0, 1, 0, 0, 0, 0, 1],
[0, 0, 0, 0, 1, 0, 0, 1, 0],
[0, 0, 0, 1, 1, 1, 1, 1, 1],
[1, 0, 1, 0, A, A, B, B, D16],
[0, 1, 1, A, 0, A, C, D25, C],
[0, 0, 1, A, A, 0, D34, D, D],
[0, 0, 1, B, C, D34, 0, B, C],
[0, 1, 1, B, D25, D, B, 0, D],
[1, 0, 1, D16, C, D, C, D, 0]
])
# To reduce computation effort, set D=1 and recover the powers of D by
# re-homogenizing the result polynomial.
KM = KM_full(D=1)
# All parameters represent lengths squared, therefore represent Vol^2 as F^3
# (do not use W here), so that re-homogenization makes sense.
pv = KM.det() - 2*F^3 # Octahedron's volume formula; F^3 = 144 Vol^2
CM = KM[2:,2:] # Cayley-Menger matrix, 7*7, rank less than 6
AM = CM.adjoint() # All entries constrained to be zero
constraints = [AM[h,k] for h in range(7) for k in range(h+1)]
# Many of the AM[i,j]==0 are redundant, but it does not hurt to give as many
# low-degree equations as we can; this helps finding a good ideal basis.
I = R.ideal([pv] + constraints)
J = I.elimination_ideal([D16,D25,D34]) # now done within minutes
# Exactly one equation left: len(J.gens()) == 1
# Reconstruct powers of D
fpoly = J.gen(0).homogenize(var=D)
# Note: fpoly.degree(F) == 24
# Exponents of F in fpoly are always divisible by 3, i.e.
# uniq(t[3] % 3 for t in fpoly.exponents()) == [0]
# Rewrite in terms of W, up to W^8
wcoeffs = [fpoly.coefficient({F:3*i}) for i in xrange(fpoly.degree(F)/3 + 1)]
wpoly = sum(c*W^i for i,c in enumerate(wcoeffs))
# Checking the result without homogenization tricks:
KM = KM_full
pv = KM.det() - 2*W # Octahedron's volume formula; W = 144 Vol^2
CM = KM[2:,2:] # Cayley-Menger matrix, 7*7, rank less than 6
AM = CM.adjoint() # all entries constrained to be zero
constraints = [AM[h,k] for h in range(7) for k in range(h+1)]
I = R.ideal([pv] + constraints)
wpoly in I # True
save(wpoly, "octa-wpoly.sobj") # save for later re-use
Example and sanity test: Regular octahedron with edge length $3\sqrt{2}$:
wpoly = load("octa-wpoly.sobj")
R = wpoly.parent()
D16,D25,D34,F,W,A,B,C,D = R.gens()
weq = wpoly(A=18,B=18,C=18,D=18).univariate_polynomial()
weq.roots(ring=RR, multiplicities=False) # [0., 186624.]
sqrt(max(weq.roots(ring=RR, multiplicities=False)))/12 # 36.
P.S.: I have chosen the constant factor in $W$ such that the coefficients of wpoly
have small constant factors.
Resultant
. Easy-peasy! – Blue Dec 24 '18 at 16:23