How to find the coordinates of an n-dimensional simplex ? Is there a formula to find the rest of the coordinates by providing some of them? Or by providing the center and the length of each edge? There's some explanation on a 3D case here, but is not general for ndim. Would be great to have a python function as the following:
def n_simplex_coordinates(center,edge_length,dim):
# calculate the coordinates
# note: the number of coordinates are always dim+1
return c[0], c[1], ..., c[dim]
PS: Tetrahedron is a 3-dimensional rectangular simplex
The following reference gives a very simple method and an associated Python code : (https://people.sc.fsu.edu/~jburkardt/py_src/simplex_coordinates/simplex_coordinates1.py).
Let me explain the simple idea expressed in this reference.
We want to get coordinates of $n+1$ points in $\mathbb{R^n}$ that are all at the same distance one to the other.
Take for the first $n$ points the unit points on the $n$ different axes, and a $(n+1)$st one on the orthogonal vector to the plane $x_1 \ + \ x_2 \ + \ \cdots \ + \ x_n=1$, i.e.,
$$e_1=\begin{pmatrix}1\\0\\0\\\vdots\\0\end{pmatrix} \ \ e_2=\begin{pmatrix}0\\1\\0\\\vdots\\0\end{pmatrix} \ \ e_3=\begin{pmatrix}0\\0\\1\\\vdots\\0\end{pmatrix} \ \ \cdots \ \ e_n=\begin{pmatrix}0\\0\\0\\\vdots\\1\end{pmatrix} \ \ \text{and} \ \ f=\begin{pmatrix}a\\a\\a\\\vdots\\a\end{pmatrix}$$
The distance between all the $e_k$s is the same, i.e., equal to $\sqrt{2}$.
Thus it suffices to express that the distance between $f$ and all the other $e_k$s is also equal to $\sqrt{2}$. Let us take for example $k=1$. As
$$f-e_1=\begin{pmatrix}a-1\\a\\a\\\vdots\\a\end{pmatrix},$$
we must have: $\|f-e_1\|^2=2$ giving $(a-1)^2+(n-1)a^2=2$ whence $na^2-2a-1=0$. This quadratic equation has two roots. Let us take the positive one (the other would be convenient too), giving
$$a=\frac{1+\sqrt{n+1}}{n}$$
The center of gravity $G$ of this set of $(n+1)$ points is the point with all its coordinates equal to $\tfrac{a+1}{n+1}$.
It is now easy to bring this set of points by a convenient translation to have any desired center, to shrink or enlarge it to the convenient sidelength, to rotate it, etc.
Remark: The Wikipedia reference on the subject uses the fact that, from the center of gravity, one "sees" a side under an angle of $\cos^{-1}(-\tfrac{1}{n}).$