#include #include #include "prog04header.h" /* prog04_5.c */ XY CalcCentroid( Triangle triangle ){ XY centroid; centroid.x = (triangle.vertex[0].x + triangle.vertex[1].x + triangle.vertex[2].x) / 3.0; centroid.y = (triangle.vertex[0].y + triangle.vertex[1].y + triangle.vertex[2].y) / 3.0; return centroid; }