Crane Balancing: Difference between revisions

From programming_contest
Jump to navigation Jump to search
imported>Kmk21
Created page with "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..."
 
imported>Kmk21
No edit summary
 
(One intermediate revision by the same user not shown)
Line 5: Line 5:
[[Category:Geometry]]
[[Category:Geometry]]
[[Category:Math]]
[[Category:Math]]
[[Category:Algorithm 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.