Crane Balancing

From programming_contest
Revision as of 04:34, 27 August 2016 by imported>Kmk21
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Calculate the area/centroid of the polygon. Treat the crane as a point mass located at the centroid. Note we only care about location in X dimension. Masses can be combined by (x0*w0+x1*w1)/total_weight. Do some algebra to find the masses that put the x value of the COM (center of mass) within the base.