[Tex/LaTex] Drawing a semicircle in TikZ

tikz-pgf

How do I draw a semicircle in TikZ? A and B are the endpoints of its diameter, and I have two other points specified. I have a command that is not able to be compiled. I put a "%" in front of it.

\documentclass{amsart}
\usepackage{mathtools}

\usepackage{tikz}
\usetikzlibrary{calc}




\begin{document}

\begin{tikzpicture}[baseline=(current bounding box.north)]

%A semicircle is drawn.
\path (-1.5,0) coordinate (A) (1.5,0) coordinate (B) (60:1.5) coordinate (C) (120:1.5) coordinate (D);
%\draw (A) -- (B) arc (C) arc (D) arc (A) -- cycle;

%Labels for the vertices are typeset.
\node[anchor=north, inner sep=0] at ($(A) +(0,-0.15)$){$A$};
\node[anchor=north, inner sep=0] at ($(B) +(0,-0.15)$){$B$};
\node[anchor=240, inner sep=0] at ($(C) +(60:0.15)$){$C$};
\node[anchor=300, inner sep=0] at ($(D) +(120:0.15)$){$D$};


\end{tikzpicture}

\end{document}

Best Answer

Since all coordinates are known, it's possible to draw a circle with defined radius into a clipping rectangle. The result is a semicircle. After that, only base and labels should be added.

\documentclass{amsart}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[baseline=(current bounding box.north)]

% A clipped circle is drawn
\begin{scope}
    \clip (-1.5,0) rectangle (1.5,1.5);
    \draw (0,0) circle(1.5);
    \draw (-1.5,0) -- (1.5,0);
\end{scope}
%
%%Labels for the vertices are typeset.
\node[below left= 1mm of {(-1.5,0)}] {$A$};
\node[below right= 1mm of {(1.5,0)}] {$B$};
\node[above right= 1mm of {(60:1.5)}] {$C$};
\node[above left= 1mm of {(120:1.5)}] {$D$};
\end{tikzpicture}

\end{document}

enter image description here

Update:

To avoid the problems that Tobi mention in his comment, for this particular case is easy to write:

\documentclass{amsart}
\usepackage{mathtools}
\usepackage{tikz}
\usetikzlibrary{positioning}

\begin{document}

\begin{tikzpicture}[baseline=(current bounding box.north)]

\draw (-1.5,0) -- (1.5,0) arc(0:180:1.5) --cycle;
%
%%Labels for the vertices are typeset.
\node[below left= 1mm of {(-1.5,0)}] {$A$};
\node[below right= 1mm of {(1.5,0)}] {$B$};
\node[above right= 1mm of {(60:1.5)}] {$C$};
\node[above left= 1mm of {(120:1.5)}] {$D$};
\end{tikzpicture}

\end{document}

Now the semicircle can be filled without problems and exist connections between base and arc as can be seen in following detail.

enter image description here