This repository contains two fully-implemented C programs developed for the CE2001 – Engineering Mechanics assignment from NIT Puducherry. The assignment includes analytical computation, geometry-based reasoning, and final plotting/visualization as required in the problem statement.
Question 1 — Centroid of a Composite Shape
A composite planar area is constructed using: Rectangle 1 Rectangle 2 Right-angled Triangle All shapes are connected edge-to-edge and must be solved using analytical formulas only, without library functions.
✔ Program Features Computes geometric parameters from the student roll number Calculates Areas of each shape Individual centroids Orientation-dependent triangle centroid (base up / base down) Overall centroid using the weighted average formula 100% compliant with assignment rules No symbolic/math libraries used
Question 2 — Moment of Inertia of a Composite I-Section
The I-section consists of: Top flange (rectangle) Web (rectangle) Bottom flange (rectangle) Dimensions are again generated from the student roll number.
✔ Program Features Computes areas of all components Determins the centroidal depth of the I-section Computes Iₓₓ about the centroidal axis using: Individual centroidal MOIs Parallel Axis Theorem Supports vertical flipping of the section
Outputs: Total area Centroid position Final moment of inertia