List the coordinates of the vertices of a unit tesseract in 4D. So I am working on a graphing program, and have a function that takes plane slices of a list of coordinates. I'm wanting to take slices of 4d shapes to get the coordinates of vertices in the plane specified. Example:
(plane-slice 0 2 '(3 1 2 6)) -> (3 2) or (3, 1, 2, 6) -> (3, 2))
(it is slicing for the points of the coordinates that are in the x,z plane)
For example, the coordinates of the vertices of a cube with side length 1 would be ((.5, .5, .5), (.5, .5, -.5), (.5 -.5 .5)... (-.5 -.5 -.5)). I would like a list of the vertices of a tessaract in similar form like ((.5, .5, .5, .5) .... (-.5, -.5, -.5, -.5)).
 A: Recursion gives a systematic way to list hypercube vertices: If you have a list of the $2^{n-1}$ vertices of the $(n-1)$-fold Cartesian product $C^{n-1} = [0, 1]^{n-1}$, you obtain the $2^{n}$ vertices of $C^{n} = [0, 1]^{n}$ by appending a $0$, and appending a $1$, to each vertex of $C^{n-1}$. Thus:


*

*$C^{1} = [0, 1]$ has vertices $0$ and $1$;

*$C^{2} = [0, 1]^{2}$ has vertices
\begin{align*}
&(0, 0), &&(1, 0), \\
&(0, 1), &&(1, 1);
\end{align*}

*$C^{3} = [0, 1]^{3}$ has vertices
\begin{align*}
&(0, 0, 0), &&(1, 0, 0), &&(0, 1, 0), &&(1, 1, 0), \\
&(0, 0, 1), &&(1, 0, 1), &&(0, 1, 1), &&(1, 1, 1);
\end{align*}

*$C^{4} = [0, 1]^{4}$ has vertices
\begin{align*}
&(0, 0, 0, 0), &&(1, 0, 0, 0), &&(0, 1, 0, 0), &&(1, 1, 0, 0), \\
&(0, 0, 1, 0), &&(1, 0, 1, 0), &&(0, 1, 1, 0), &&(1, 1, 1, 0), \\
&(0, 0, 0, 1), &&(1, 0, 0, 1), &&(0, 1, 0, 1), &&(1, 1, 0, 1), \\
&(0, 0, 1, 1), &&(1, 0, 1, 1), &&(0, 1, 1, 1), &&(1, 1, 1, 1);
\end{align*}
and so forth. (The geometric reason this scheme works is pleasant, elementary, and worth pondering.)
Replace $0$'s by $-\frac{1}{2}$ and $1$'s by $\frac{1}{2}$ to get a unit cube centered at the origin.
