원과 접선(tangent line) (1)

Rendered by QuickLaTeX.com

\begin{tikzpicture}
[+preamble]
\usepackage{pgfplots}
\pgfplotsset{compat=newest}
[/preamble]
\begin{axis}[xlabel=$x$,ylabel=$y$,axis lines=middle,
axis line style={gray!30,latex-latex},xtick={1},ytick={1},
no marks,axis equal,xmin=-1,xmax=2,ymax=1.5,ymin=-1,enlargelimits={upper=0.1}
]
\draw[thin,gray!30] (1,0) |- (0,1);
\addplot[dashed,domain=-0.8:1.5,<->] {x} node[below right]{$\scriptstyle y = x$};
\addplot[blue,domain=-0.5:0.8,<->] {2*x} node[left,pos=0.95]{$\scriptstyle y = 2x$};
\addplot[blue,domain=-1:2.2,<->] {0.5*x} node[below right=1pt,inner sep=0,pos=0.85] 
                                                   {$\scriptstyle y=\frac{1}{2}x$};

\begin{scope}[green]
\draw (1,1) circle ({sqrt(2)*sin(45-atan(0.5))});
\draw (1,1) -- ({atan(0.5)}:{sqrt(2)*cos(45-atan(0.5))}) node[midway,right]{$r$};
\fill (1,1) circle (1.5pt)
({atan(2)}:{sqrt(2)*cos(45-atan(0.5))}) circle (1.5pt)
({atan(0.5)}:{sqrt(2)*cos(45-atan(0.5))}) circle (1.5pt);
\end{scope}
\end{axis}
\end{tikzpicture}

 

0 Shares:
Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.