Terminology: We may use the words "group", "set". or "ensemble" to refer to the 2 blocks that join to make a level.
For example, the first ensemble being the first horizontal & first vertical block combined. The 2nd ensemble would be the 2nd horizontal and 2nd vertical block. As we build, we will add the first ensemble to the second, and so on...
In this next section, we will explore the differences for the vertical blocks, as opposed to the horizontal block calculations that were shown in the previous section.
Looking at the vertical block, notice that the dimensions are the opposite of the horizontal dimensions. Now the length is 3cm and a height is 15cm.
When calculating Block 2's center of mass, we might be tempted to say the center of mass (com) is (1.5, 7.5), however RECALL that when we are building our cantilever structure, we are placing the vertical block on top of the horizontal block as shown here. Therefore, there will be an offset in the y-direction by 3cm.
Notice the shift in "height" needed to account for the blue vertical block being placed on top of the yellow horizontal block.
(Two Blocks - Center of Mass Calculations using Python)
As we add multiple blocks, we will need to determine the new combined center of mass.
To do so, we average all the x values to find the combined x-coordinate; and likewise, we average all the y values to find the combined y-coordinate.
Let's try this out in the trinket window below.
Answers should like like the cell below.
Step 1.
Add the necessary code to calculate the center of mass of block 2.
(Hint: be sure to adjust it for the 3cm height increase to account for it sitting on top of the horizontal block).
Step 2.
Calculate & print the combined center of mass. (Consider using the average or mean values).
Step 3.
Check for stability of the combined center of mass & print if the stack is stable or unstable.
Let's try adding blocks 3 and 4, as well.
Answers should like like the cell below.
Step 1.
Add the necessary code to calculate & print the center of mass of blocks 3 & 4.
Step 2.
Calculate & print the combined center of mass. (Consider using the average or mean values).
Step 3.
Check for stability of the combined center of mass & print if the stack is stable or unstable.