0

I am trying to draw a circle centered at A(1,1) and radius 1. I also want to draw 2 dashed lines from center to the points B(1,0) and C(0,1). here is my progress

\begin{tikzpicture}

\tkzInit[xmin=-1, xmax=2.5, ymin=-1, ymax=2.5]

\tkzDrawXY[noticks,label={}]

\tkzDefPoint(1,1){A}

\tkzDefPoint(1,0){1}

\tkzDefPoint(0,1){1}

\tkzLabelPointsbelow

\tkzLabelPointsleft

\draw[fill=gray!20] (1,1) circle (1cm);

\tkzDrawPointsfill=black,size=10

\draw [dashed] (A) -- (1),

\draw [dashed] (A) -- (1),

\end{tikzpicture}

I would like to label B and C as "1", but this way, the only points draw is the origin, which I don't understand why, and C which has two labels 1, one left and other below. Can anyone help me, please?

After the hints that a received here, here is the result: enter image description here

0

Maybe something like this?

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture} 
 \tkzInit[xmin=-1, xmax=2.5, ymin=-1, ymax=2.5]
 \tkzDrawXY[noticks,label={}]
 \tkzDefPoint(1,1){A} 
 \tkzDefPoint(1,0){B}
 \tkzDefPoint(0,1){C} 
 \path (A) node[above right] {$A$} (B) node[below] {1} (C) node[left]{1};
%  \tkzLabelPoints[above right](A)
%  \tkzLabelPoints[below](B)
%  \tkzLabelPoints[left](C) 
 \draw(A) circle[radius=1cm];
 \tkzDrawPoints[fill=black,size=2](A,B,C) 
 \draw [dashed] (A) -- (B) -- (C) -- cycle;
\end{tikzpicture}
\end{document}

enter image description here

BTW, I have no idea how you formatted your code in the question (which is why I did not fix it), but in the future please kindly consider putting it in the cursor and pressing the {} button.

Or

\documentclass[tikz,border=3mm]{standalone}
\usepackage{tkz-euclide}
\begin{document}
\begin{tikzpicture} 
 \tkzInit[xmin=-1, xmax=2.5, ymin=-1, ymax=2.5]
 \tkzDrawXY[noticks,label={}]
 \tkzDefPoint(1,1){A} 
 \tkzDefPoint(1,0){B}
 \tkzDefPoint(0,1){C} 
 \path %(A) node[above right] {$A$} 
 (B) node[below] {1} (C) node[left]{1};
%  \tkzLabelPoints[above right](A)
%  \tkzLabelPoints[below](B)
%  \tkzLabelPoints[left](C) 
 \draw(A) circle[radius=1cm];
 \tkzDrawPoints[fill=black,size=2](A,B,C) 
 \draw [dashed] (C) -- (A) -- (B);
\end{tikzpicture}
\end{document}

enter image description here

| improve this answer | |
  • Almost perfect. I don't need the label of the center and the dashed line between $(0,1)$ and $(1,0)$. Could you edit you answer for me? Thanks for your help – Marcos Paulo Apr 5 at 3:06
  • @MarcosPaulo Sure. (I guess it would make more sense if you tried what these commands do.) – Schrödinger's cat Apr 5 at 3:14
  • Thanks again! One more thing about what I intended to do is to fill the circle wit 20% of grey. Also, I don't understand what you mean with "consider putting it in the cursor and pressing the {} button". Finally, I must confess that I don't how to use \usepackage{tkz-euclide}, \pathand \nodecommands yet. – Marcos Paulo Apr 5 at 3:34
  • @MarcosPaulo Then just use \draw[fill=gray!20] (A) circle[radius=1cm];. I recommend going in small steps. The pgfmanual has a great tutorial. After you have absorbed it, you can look at all these additional packages. Going the other way around is IMHO a bit risky. – Schrödinger's cat Apr 5 at 3:39
  • I was to what you said, because I did \draw(A) circle[fill=gray!20, radius=1cm];... Yes some hints that I used came from the tikz manual (not pgf) and others from YouTube videos. These manuals are so big. I will post here my project. This picture will take part of a beamer presentation that I will convert to videos for my students. Many thanks again! – Marcos Paulo Apr 5 at 3:45

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.