The altitude of one triangle is the median of the other.

squares and triangles
Let the squares have sides a and b and consider the altitude to triangle ABC in the diagram. Then by the sine rule
a sinA = b sinB .

The altitude to triangle ABC cuts the angle at the common vertex in the other triangle into two angles equal to angles A and B and the opposite side into lengths p and q where
p= bsinA sinz = asinB sinz = asinB sin(π-z) =q

showing that this is the median of the triangle.