Map from a square to a triangle I am writing a Python script to make a ternary parametric plot. The domain of the parameters has to be rectangular so that it can be expressed as a 2D array, but the domain of the plot has to be an equilateral triangle.
Specifically I want to know if there is a (known) function 
$$f: [0,1]^2\to T =\left\{(x, y)\in\mathbb R\Bigg| 1-\frac{y}{\sqrt 3}\geq x\geq\frac{y}{\sqrt 3}, \quad y\geq 0\right\}$$
Where the (unoriginally denoted  "T" for triangle) set $T$ is an equilateral triangle of side one.
Preferably $f$ should be an isometry because that would save me from the effort of adjusting the mesh points to make them evenly spaced in the triangle. The corollary of Gauss's Theorema Egregium (i.e., "There is no isometry between surfaces with different Gaussian curvature") doesn't preclude the existence of such an isometry but does it really exist? If so, it would be great to have a specific formula.
In the event that such a map does not exist I would settle with any map between a rectangle and an equilateral triangle.

The corners of $[0,1]^2$ can be characterized by the metric: They are the only points such that there exists exactly one other point at the maximal distance $\sqrt 2$. Via an isometry, $T$ would also have to have exactly four points with that property. At least one of them would have to be a non-vertex. But then its parter point at distance $\sqrt2$ would certainly have points at distance $>\sqrt 2$.
