How can I compute the barycentric coordinates of the center of mass of a triangle if its $3$ vertices are defined by $P_1, P_2$ and $P_3.$
This is what I tried: $$ \left\{ \begin{array}{cc} (m_1 + m_2 + m_3) p &= m_1p_1 + m_2p_2 + m_3p_3 \\ (m_1 + m_2 + m_3) p &= (m_1 + m_2)Q + m_3p_3 \end{array} \right. $$ where $Q = (m_2p_2 + m_1p_1)/(m_1+m_2)$
How should I proceed? I couldn't find any suitable examples on the internet.
This type of problems are usually handled in a discipline called triangle geometry and the triangle geometers prefer barycentric and trilinear coordinate systems to Cartesian system of coordinates.
We are unable to comprehend what you have tried. Therefore, we refrain from commenting on that. The text given below describes only our answer to the question.
The sketch shows an arbitrary triangle $ABC$, the sidelengths of which are $a$, $b$, and $c$. The center of mass of a triangle, which is also known as centroid, is the point of concurrence of its three medians, in our case the lines $AD$, $BE$, and $CF$. Therefore, the center of mass of $ABC$ is $G$. It is known that the three triangles $BGC$, $CGA$, and $AGB$ have the same area. In other words, the lines joining the center of mass of a triangle to its vertices divide it into three equal parts. By definition, the three barycentric coordinates of $G$ are given by the ratios of the areas of the triangles $BGC$, $CGA$, and $AGB$. Therefore, the homogeneous barycentric coordinates of $G$ can be written as, $$G=\left(1,1,1\right).$$ For your reference, we have drawn the exact trilinear coordinates of $G$ as well and they are $t_a$, $t_b$, and $t_c$. They are given by, $$t_a=\frac{\Delta}{3a},\space\space\space t_b=\frac{\Delta}{3b},\space\space\space \mathrm{and} \space\space\space\space t_c=\frac{\Delta}{3c},$$ where $\Delta$ is the area of $ABC$.
Therefore, the trilinear coordinates of $G$ is usually written as, $$G=\left(\frac{1}{a},\frac{1}{b},\frac{1}{c}\right).$$ To complete this essay on the coordinates of the center of mass of a triangle, we include the Cartesian coordinates of $G$ as well. Assume that the coordinates of vertices $A$, $B$, and $C$ are given as $\left(x_A,y_A\right)$, $\left(x_B,y_B\right)$, $\left(x_C,y_C\right)$ respectively. Then, the Cartesian coordinates of $G$ can be written as, $$G=\left(\frac{x_A+x_B+x_C}{3}, \frac{y_A+y_B+y_C}{3}\right).$$ If you are interested in learning more about barycentric coordinate system, you can visit ETC. The centroid is known as center $\rm{X\left(2\right)}$ and can be found on its page $\rm{PART-1}$.