07-14-2024, 01:14 PM
(07-14-2024, 06:14 AM)aadityap0901 Wrote: For a given set of points like: [0, 0], [3, 3], [6, 6] ........Ah, ok, so the average is what I am looking for here. Thank you for the information.
The mid point will be: Mid_X = Average(All X Co-ordinates), Mid_Y = Average(All Y Co-ordinates)
if you want a mass center with a non-uniform distribution of mass as particles:
Mid_Mass_X = Sum(X(I) * M(I)) / Sum (M(I)), Mid_Mass_Y = Sum(Y(I) * M(I)) / Sum (M(I))
For example:
[0, 0], [5, 5], [7, 4]
Mid_Point = [ (0 + 5 + 7) / 3, (0 + 5 + 4) / 3 ] = [4, 3]
For non uniform mass distribution: (written as [X, Y, Mass] at point [X, Y])
[0, 0, 1], [5, 2, 3], [4, 5, 3], [7, 9, 2]
Mid_Point = [ (0 * 1 + 5 * 3 + 4 * 3 + 7 * 2) / (1 + 3 + 3 + 2), (0 * 1 + 2 * 3 + 5 * 3 + 9 * 2) / (1 + 3 + 3 + 2) ] = [4.55, 4.33]