In[]:=
ClusterMoments[cluster_,l_]:=Module[{cent=MapApply[Complex][N[cluster-Threaded[Mean[cluster]]]]},Abs[Total[Norm[cent]Exp[IlArg[cent]]]/Total[Norm[cent]]]^2]
In[]:=
CirclePoints[5]
Out[]=
-,(-1-+,(-1++,(-1+-,(-1-
5
8
5
8
1
4
5
),5
8
5
8
1
4
5
),{0,1},-5
8
5
8
1
4
5
),-5
8
5
8
1
4
5
)In[]:=
ClusterMoments[CirclePoints[3],3]
Out[]=
9.
In[]:=
cellpos[seed_]:=First[Keys[#["On"][[{-1}]]]]&/@(SeedRandom[seed];RandomTotalisticAggregation[{{3},DeleteCases[Tuples[{1,0,-1},2],{0,0}]},{{0,-1},{0,0},{0,1},{1,0}},5000])
In[]:=
Table[cellpos[435647+i],{i,10}]
Out[]=
In[]:=
Table[ClusterMoments[First[%75],l],{l,10}]
Out[]=
{275196.,5.5367×,3.69879×,1.45419×,3.23266×,2.00531×,2.64916×,2.96663×,2.47115×,2.23964×}
6
10
6
10
6
10
6
10
6
10
6
10
6
10
6
10
6
10
In[]:=
Table[ClusterMoments[%75[[2]],l],{l,10}]
Out[]=
{9.03446×,2.03961×,1.03944×,1.89704×,1.19474×,1.7107×,1.3021×,1.60386×,1.4179×,1.51688×}
6
10
7
10
7
10
7
10
7
10
7
10
7
10
7
10
7
10
7
10