I would like to know how to parameterize a triangle over $[0,1] \times [0,1]$. I actually only care that the mapping is surjective but a bijection is always nice I suppose.
I found this in which an answer accidentally answers my question but when I check the result it doesn't seem to be correct. As I understand the proposition it states that $(u, v) \mapsto u\cdot A + v\cdot B + (1 - u - v)\cdot C$ where $A, B, C$ are the vertices of the triangle.
For instance take the triangle specified by the vertices $(0,0), (0, 1), (1, 0)$. If we follow though with the computations with $u = 1, v = 1$
$$1.0 \cdot (0,0) + 1.0 \cdot (0, 1) + (1.0 - 1.0 - 1.0)\cdot (1, 0) =$$ $$ (0, 1) - (1, 0) =$$ $$ (-1, 0) $$
which is not a point on the triangle that I mentioned. Did I make a mistake in my calculation? Have I misinterpreted the meaning of vertex here? If I have not made some kind of mistake, be it in calculation or interpretation, then
note: It has been noted that the linked parametrization maps the right triangle to any other triangle not the square requested. So is there a mapping of the unit square to the right unit triangle?
The map $(u,v)\mapsto A+u(B-A)+uv(C-B)$ should work, but it is not bijective (all points of the form $(0,v)$ get mapped to the point $A$.