Question: In python please In civil engineering, a team is designing a steel beam for a bridge. They need to determine the centroid of various cross

In python please
In civil engineering, a team is designing a steel beam for a bridge. They need to determine the centroid of various cross-sectional shapes along the beam to ensure it can support the load effectively. The team has collected data representing the dimensions of each cross-section, and they need to calculate the centroid to accurately position the beam's neutral axis.
Your task:
Write a function to calculate the centroid of a cross-sectional shape. Pseudocode below.
Input: a list of points defining the shape
Output: (area, x_bar, y_bar)
Write a main function to take in a list of points, prints your centroid calcuations, and plots your centroid on a plot.
Input: List of points as a numpy array
Main Output Format:
Centroid coordinates:
X-coordinate: {x_bar}
Y-coordinate: {y_bar}
CALCULATE CENTROID PSEUDOCODE
initialize area and x/y coordinates
for i in points:
calculate area
calculate partial area
add to current x_sum, y_sum
calculate the centroid coordinates
return area, x_bar, y_bar

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!