mapping a cube into a tetrahedron

305 Views Asked by At

I have a cube with vertex at (0,0,0),(0,0,1),(0,1,0),(1,0,0),(0,1,1),(1,1,0),(1,0,1),(1,1,1), and a tetrahedron with vertex at (0,0,0),(0,0,1),(0,1,0),(1,0,0).

How do I map the cube's coordinates to the tetrahedron bijectively? Are there an elegant function that would do it?

Note: on 2-dimension, to map a square to a triangle I can do f(x,y) = (x-xy/2,y-xy/2); I'm struggling to extend this to 3-dimension

1

There are 1 best solutions below

0
On

A potentially useful observation is that the unit cube and unit simplex in any number of dimensions can be expressed in terms of the maximum norm $||\vec x||_M=\max(|x_i|)$ and the taxicab norm $||\vec x||_T=\sum_i|x_i|$, allowing us to make use of the convenient properties of norms: $$ \text{Unit Cube:}\ \ \ \mathcal C=\{\vec x\in\mathbb R^d:x_i\ge 0, ||\vec x||_M\le 1\} $$ $$ \text{Unit Simplex:}\ \ \ \mathcal S=\{\vec x\in\mathbb R^d:x_i\ge 0, ||\vec x||_T\le 1\} $$ Note that your cube and tetrahedron are the $d=3$ case.

One way to transform between these shapes, then, is to map each vector $\vec x$ in the cube to a vector $\vec y$ in the same direction such that $||\vec x||_M=||\vec y||_T$. This gives us a simple function, which multiplies $\vec x$ by some positive constant $c(\vec x)$, for which we can find an expression. $$\begin{align} ||\vec x||_M & = ||c\vec x||_T \\ ||\vec x||_M & = |c|\ ||\vec x||_T \\ c & = \frac{||\vec x||_M}{||\vec x||_T} \end{align}$$ This allows us to write down a function, taking care of the problematic zero case: $$ f:\mathcal C\to\mathcal S,\ \ \ f(\vec x) = \begin{cases} \frac{||\vec x||_M}{||\vec x||_T}\vec x & \vec x \neq \vec 0 \\ \vec 0 & \vec x = \vec 0 \end{cases} $$ From here, showing that this is a bijection should be straightforward.