Here is Canvas object wihch demonstrate the problem.

The first section property that must be calculated is the location of the centroid.

The centroid will always lie on an axis of symmetry. The tee shape has one axis of symmetry – the vertical axis y.

The centroid must be located somewhere along this axis.