Method CenterOfMass
CenterOfMass(ReadOnlySpan<float2>)
Returns corresponding center of mass (COM) for positions.
Assumes equal weights for all positions.
Declaration
public static float2 CenterOfMass(ReadOnlySpan<float2> positions)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<float2> | positions | A collection of positions. Must contain at least one point. |
Returns
| Type | Description |
|---|---|
| float2 | COM value position. |
CenterOfMass(ReadOnlySpan<double2>)
Returns corresponding center of mass (COM) for positions.
Assumes equal weights for all positions.
Declaration
public static double2 CenterOfMass(ReadOnlySpan<double2> positions)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<double2> | positions | A collection of positions. Must contain at least one point. |
Returns
| Type | Description |
|---|---|
| double2 | COM value position. |
CenterOfMass(ReadOnlySpan<int2>)
Returns corresponding center of mass (COM) for positions.
Assumes equal weights for all positions.
Declaration
public static int2 CenterOfMass(ReadOnlySpan<int2> positions)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<int2> | positions | A collection of positions. Must contain at least one point. |
Returns
| Type | Description |
|---|---|
| int2 | COM value position. |
CenterOfMass(ReadOnlySpan<fp2>)
Returns corresponding center of mass (COM) for positions.
Assumes equal weights for all positions.
Declaration
public static fp2 CenterOfMass(ReadOnlySpan<fp2> positions)
Parameters
| Type | Name | Description |
|---|---|---|
| ReadOnlySpan<fp2> | positions | A collection of positions. Must contain at least one point. |
Returns
| Type | Description |
|---|---|
| fp2 | COM value position. |