The barycentric coordinate system of a simplex satisfies the following equation:
$$\Lambda \cdot V = \begin{bmatrix} \lambda_1 & \lambda_2 & \lambda_3 \end{bmatrix} \cdot \begin{bmatrix} u_1 & v_1 \\u_2 & v_2 \\ u_3 & v_3\end{bmatrix} = \begin{bmatrix} x & y \end{bmatrix} = X$$
where $\Lambda$ is the barycentric coordaintes, such that $\lambda_1 + \lambda_2 + \lambda_3 = 1$, and $V$ are the vertices of the simplex (in the 2D case, a equilateral triangle), and $X$ is the 2D Cartesian coordinate.
I am trying to extend this to a regular polygon case (still in 2D). I understand that mapping from the Cartesian coordinate system to an arbitrary polygon results in the Generalized Barycentric Coordinate. However, I am not sure how the inverse can be done properly, i.e. converting Barycentric coordinates back to Cartesian coordinates.
I have attempted to extend the above formula naively, as
$$\begin{bmatrix} \lambda_1 & \lambda_2 & \lambda_3 & \lambda_4 & ...\end{bmatrix} \cdot \begin{bmatrix} u_1 & v_1 \\u_2 & v_2 \\ u_3 & v_3 \\ u_4 & v_4 \\ \vdots & \vdots \end{bmatrix} = \begin{bmatrix} x & y \end{bmatrix} = X$$
I simulated the Barycentric coordinates by sampling from Dirichlet(1, 1, 1, ...), and plotted the points. The following is an example with a pentagon (i.e. sampling from Dirichlet(1, 1, 1, 1, 1))
https://i.stack.imgur.com/gysr6.png
It can be seen that most of the points are concentrated in the center. This is not consistent with the pdf of the Dirichlet(1, 1, 1, 1, 1), which should be uniform within the polygon.
I have also attempted to measure the distance of these sampled distributions with Jensen-Shanon Divergence, and compared with the geometric distance on the resulted graph on pairs of points
https://i.stack.imgur.com/uQqox.png
From the above two examples, it can be seen that, with almost the same geometric distances, the pair of points close to the center of the polygon has smaller JS Divergence (distance in terms of probabilities) than the pair that are closer to the edge fo the polygon (0.25 vs. 2.6).
My question is, how to properly transform the Barycentric coordinates to the Cartesian coordinate within the polygon? This can also be extended to the question: how to represent a pdf of categorical distribution of N categories in 2D using a regular polygon with N sides?