How can I calculate individual masses of points?

I am working on the C # 2d solid-state physics engine, and I need to assign the given vertices of the objects to the masses: a list of vertices (x, y positions), the total mass of the object and the center of mass.

The center of mass is defined as:

alt text

Where

R = center of mass
M = total mass
mj = mass of vertex j
rj = position of vertex j

I need an algorithm that can approximate every mj given by R, M and rj.

edit: I just want to clarify that I know that there is an infinite set of solutions. I am looking for a quick algorithm that finds a set of mj (such that they are all close enough to mj = M / [number of vertices] and where "enough" is defined as some floating point threshold).

In addition, each object will contain from 5 to 35 points.

+3
4

CM : N 0..N-1 , N 0:

total_area = sum[i=0..N-1]( X(p[i],p[i+1])/2 )
CM = sum[i=0..N-1]( (p[i]+p[i+1])*X(p[i],p[i+1])/6 ) / total_area

   where X(p,q)= p.x*q.y - q.x*p.y  [basically, a 2D cross product]

, CM , , , , CM . , CM, CM . , 3/2 "" .

area[i] = X( (p[i]-CM), (p[i+1]-CM) ) / 2
   (this is the area of the triangle between the CM and vertices i and i+1)

mass[i] = (total_mass/total_area) * (area[i-1] + area[i])/2

, "" - , , - . , (, - ), CM, .

, :

  • CM, .
  • ; .
+2

: D D+1 [+] n n . n>D+1 ( , : , ..).

edit: , m_i r_i s. , r_i m_i s.

[+] , ( D ) M = \sum m_j


:

, . , , , , ( ...). (, ). , .

- . - .

, . . DoF , r_i ( , ) , 1/3 , . . , , , .

+1

R . , 10 , 10 "" - 10 10 ( , ).

+1

. , (, , , , , . ), ( ) (d_j) (v_j), m_j = v_j * d_j. , , .

, , , (Mass = sum (m_j) = sum (v_j * d_j)), .

0

Source: https://habr.com/ru/post/1729810/


All Articles