The altitude of one triangle is the median of the other.
Let the squares have sides
and
and consider the altitude to
triangle ABC in the diagram. Then by the sine rule
The altitude to triangle ABC cuts the angle at the common vertex in
the other triangle into two angles equal to angles
and
and
the opposite side into lengths
and
where