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.Update:
To avoid the problems that Tobi mention in his comment, for this particular case is easy to write:
Now the semicircle can be filled without problems and exist connections between base and arc as can be seen in following detail.