With the sample MWE below, TikZ generates the following diagram:
1. Drawing an arc
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate[label=below:$a$] (a) at (0,0);
\draw (a) arc(0:180:2);
\end{tikzpicture}
\end{document}
2. Drawing a circle
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\coordinate[label=below:$a$] (a) at (0,0);
\coordinate[label=below:$b$] (b) at (5,5);
\draw (a) arc(0:180:2);
\draw (b) circle [radius=2cm];
\end{tikzpicture}
\end{document}
With \draw <coordinate> circle
command, TikZ draws a circle, with the <coordinate>
at its center.
With \draw <coordinate> arc
command, TikZ draws an arc, with the <coordinate>
as one of its endpoints.
I wish to understand, why this difference of behavior and how is TikZ drawing the arc with \draw (a) arc(0:180:2);
.
Why does TikZ does not use (a)
as its center point while drawing an arc similar to drawing a circle.
How does TikZ actually draw the arc with point a
.
What is the reference and center point, when TikZ draws an arc.
(a)
as its center point while drawing an arc similar to drawing a circle?" is not really answerable, and there are more than enough answers that show you how you can get whatever behavior you want.\draw (x,y) arc(alpha:beta:r);
Now draw a circle of radiusr
such that(x,y)
is at the position specified by the anglealpha
, Now TikZ draws an arc from that point to the point with anglebeta
along that circle.