7

If I type in the two codes resulting two circles fit together, coinciding with each other. Then what's the difference between them?

enter image description here

\documentclass{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle[x radius=2,y radius=2]; %this code means center point is (0, 0) with radius 2 
\draw(0, 0) circle (2); %this code means center point is (0, 0) with radius 2
\end{tikzpicture}
\end{document} 
9

From the documentation (14.6 The Circle and Ellipse Operations):

Note: There also exists an older syntax for circles, where the radius of the circle is given in parentheses right after the circle command as in circle (1pt). Although this syntax is a bit more succinct, it is harder to understand for readers of the code and the use of parentheses for something other than a coordinate is ill-chosen.

Thus, circle (2) is the older syntax and short for circle[radius=2], which is an abbreviation for circle[x radius=2, y radius=2].

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.