4. In triangle $\triangle A B C$, the base $A B$ of which lies on the x-axis, altitudes $A M, B N$ and $C K$ are drawn. Find the length of the base $A B$, if the coordinates of points $M(2,2)$ and $N(4,4)$ are known.
Answer: $A B=4 \sqrt{5}$. Solution. The circle that has $A B$ as its diameter contains points $M$ and $N$. Its center $D$ is equidistant from $M$ and $N$.

Since the line $M N$ is given by $y=x$, the perpendicular line to it, passing through the midpoint of $M N$ - the point $(3,3)$ - has the form $y=6-x$. Therefore, the midpoint of $A B$ - point $D$ - has coordinates $(6,0)$. Point $D$ is equidistant from points $A, B, M$, and $N$. Here, $D M^{2}=D N^{2}=4^{2}+2^{2}=$ 20. Thus, $B D=A D=2 \sqrt{5}$, and the length of the base is $A B=4 \sqrt{5}$.

![](https://cdn.mathpix.com/cropped/2024_05_06_14545f6017acd944dc1bg-2.jpg?height=444&width=897&top_left_y=510&top_left_x=343)