In a triangle, G is the centroid of triangle ADC. AE is perpendicular to FC. BD = DC and AC = 12. Find AB. G is the centroid of the triangle ADC. AE is perpendicular to FC. BD = DC
and AC = 12. Find AB.

According to the solution manual, we can let the midpoint of AC be H. D, G, and H are collinear as G is the centroid. Given that AGC is a right triangle, AG is 6, and DG is 12. How come the DG is 6 and DG is 12?


Since medians $AE$ and $CF$
of $\triangle ADC$ intersect at the right angle,
we must have
\begin{align} 
|AD|^2+|CD|^2&=5\,|AC|^2
\tag{1}\label{1}
.
\end{align} 
Also, we know that the length of the median can be found from
the side lengths of the triangle, in particular
\begin{align}
|DH|&=\tfrac12\,\sqrt{2\,(|AD|^2+|CD|^2)-|AC|^2}
\tag{2}\label{2}
.
\end{align} 
Using \eqref{1}, we have
\begin{align}
|DH|&=\tfrac12\,\sqrt{2\,(5\,|AC|^2)-|AC|^2}
=\tfrac32\ |AC|
=18
\tag{3}\label{3}
.
\end{align} 
So, $|AB|=2|DH|=36$.
