Referring to the \clip answer in Drawing a semicircle in TikZ, I wanted to draw a semicircle. But the approach doesn't work here.
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (8,0);
\coordinate[label=above:C] (C) at ($(A)!.5!(B)$);
\coordinate[label=above:D] (D) at ($(A)!.5!(C)$);
\coordinate[label=above:E] (E) at ($(B)!.5!(C)$);
\draw[dashed] (A) -- (B);
\draw (D) let \p1 = ($(C) - (D)$) in circle ({veclen(\x1,\y1)});
\clip (A) rectangle (8,8);
\end{tikzpicture}
\end{document}
Also, when using relative points like C, D and E, how to determine the end point of the rectangle while clipping in \clip (A) rectangle (8,8);.

