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 crosssectional shapes along the beam to ensure it can support the load effectively. The team has collected data representing the dimensions of each crosssection, 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 crosssectional shape. Pseudocode below.
Input: a list of points defining the shape
Output: area xbar, ybar
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:
Xcoordinate: xbar
Ycoordinate: ybar
CALCULATE CENTROID PSEUDOCODE
initialize area and xy coordinates
for i in points:
calculate area
calculate partial area
add to current xsum, ysum
calculate the centroid coordinates
return area, xbar, ybar
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
