Crane Balancing: Difference between revisions

From programming_contest
Jump to navigation Jump to search
imported>Kmk21
No edit summary
imported>Kmk21
No edit summary
 
Line 7: Line 7:
[[Category:Algorithm Easy]]
[[Category:Algorithm Easy]]
[[Category:implementation Easy]]
[[Category:implementation Easy]]
[[Category:Center of Mass]]

Latest revision as of 04:34, 27 August 2016

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.