先需要知道几个公式
一、对于 n 个离散的有质量数据点
假定顶点的坐标为 ( x i , y i ) (x_i, y_i) (xi,yi),质量为 m i m_i mi,则质心为:
X = ∑ i = 1 n ( x i ⋅ m i ) ∑ i = 1 n m i , Y = ∑ i = 1 n ( y i ⋅ m i ) ∑ i = 1 n m i . . . ( 1 ) X = \frac{\sum_{i=1}^n ( x_i \cdot m_i )} {\sum_{i=1}^n m_i}, Y = \frac{\sum_{i=1}^n ( y_i \cdot m_i )} {\sum_{i=1}^n m_i} ...(1) X=∑i=1n