I was trying to draw an illustration for a tangent line at a point on a circle as a limit of secant lines.

enter image description here

Here is my MWE

\clip(-2.0,-1.7179963269168166) rectangle (3.4,3.0543741726287474);
\draw(0.,0.) circle (1.4142135623730951cm);
\draw [color=blue,domain=-1.3:3.0] plot(\x,{(--2.-1.*\x)/1.});
\draw [domain=-1.3:3.0] plot(\x,{(-0.8--0.3*\x)/-0.47});
\draw [domain=-1.3:3.0] plot(\x,{(-1.15--0.4*\x)/-0.76});
\draw [domain=-1.3:3.0] plot(\x,{(-1.47--0.4*\x)/-1.05});
\draw [->] (-2.,0.) -- (3.3,0.);
\draw [->] (0.,-1.6) -- (0.,3.);
\draw [color=blue,fill=blue] (1.,1.) circle (1.5pt);
\draw (1.1,1.43) node[anchor=north west] {$P$};

Anything to make the diagram better is appreciated.


Trying to adjust the most to the image provided

enter image description here



        decoration = {brace,

\tikzset{arrowheads/.style={<->, >=stealth}}
\tikzset{ind arrow/.style={->, blue, bend right=30, opacity=0.4}}
\tikzstyle{secant} = [%
        gray, thin,

\draw [thick, gray, decorate, transform canvas={xshift = -0.3em}]
    (-1.5,1) -- node [left=6pt]
    {\rotatebox[origin=c]{90}{\text{secants}}} (-1.5,3.2);

\draw [->] (-2,0) -- (3.5,0) node [right] {$x$};
\draw [->] (0,-2) -- (0,3.5) node [above] {$y$};
\draw node at (0,0) [below left] {$O$} circle (1.4142135623730951cm);
\draw [%
  domain = -1.5:3.0] plot(\x, {-1*\x+2});

\foreach \i in {1.1,1.26,1.48,1.8}
\draw [secant] plot (\x,{(1-\i)*\x+\i});

\draw [color=blue, fill=blue] (1,1) circle (1pt) node (T){};
\node (P) [blue, above right of=T, align=center] {Point of \\ Tangency $P$};
\node (Tang) at (1,3) [blue] {Tangent};

\draw [ind arrow, out=90, in=180] (P.south) to (T.north east);
\draw [ind arrow] (Tang.west) to (-0.5,2.5);


  • 1
    I'd use \node (P) [blue, above right of=T, align=center] {Point of \\ Tangency $P$}; instead of an array in math mode with \text for everything but the P. (Consider also tex.stackexchange.com/q/9386.) – Torbjørn T. Dec 20 '17 at 9:31
  • @TorbjørnT. Perfect! I tried to break the line with something like that but I could not. Obviously I was doing something wrong. I will put the line of code you wrote :-), it is cleaner. Thank you. And your link is broken. :-( – Cragfelt Dec 20 '17 at 9:41
  • Sorry, remove the ending period from it (the URL). – Torbjørn T. Dec 20 '17 at 9:46
  • @TorbjørnT. I got it. Actually, I viewed early when I was looking for node positioning. I have to recognise that some things scape of my scope. – Cragfelt Dec 20 '17 at 9:52
\draw[-latex] (0,-2.5) -- (0,4);
\draw[-latex] (-2.5,0) -- (4,0);
\coordinate (a) at (-0.5,3);
\node[circle,draw,minimum size=4cm] (c) at (0,0) {};
\draw[blue,thick] (a) -- (tangent cs:node=c,point={(a)},solution=2) coordinate[label={45:$P$}](p) -- ($(a)!2!(p)$);
\foreach \x in {1,...,5}{\draw (-0.5,3-\x*0.2) coordinate(@) -- ($(@)!2!(p)$);}

enter image description here

  • could you please modify your answer with respect to the diagram I added? – Maryà Nov 13 '17 at 5:37

A PSTricks solution for comparison purpose.

    \foreach \i in {65,70,...,90}{\pcline[nodesepB=-3,linecolor=red]([nodesep=3,angle=\i]{A2}A1)(A1)}

enter image description here

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.