The Pappus Chain

With the coordinates provided in the links:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\newcommand\RadiiBig{4}
\newcommand\RadiiSmall{3}
\begin{document}

\begin{tikzpicture}
  \coordinate[label=below:A](A) at (0,0);
  \coordinate[label=below:B](B) at (\RadiiBig*2,0);
  \coordinate[label=below:C](C) at (\RadiiSmall*2,0);
  \pgfmathsetmacro{\r}{\RadiiSmall/\RadiiBig}
  \draw[gray!50]($(A)+(-1,0)$)--($(B)+(1,0)$);
  \draw(\RadiiBig,0) circle (\RadiiBig);
  \draw(\RadiiSmall,0) circle (\RadiiSmall);
  % 
  \draw ($(C)+(\RadiiBig-\RadiiSmall,0)$) circle (\RadiiBig-\RadiiSmall);
  \foreach \n in {1,...,15}{%
    \pgfmathsetmacro{\denom}{\n*\n*(1-\r)*(1-\r)+\r}
    \pgfmathsetmacro{\x}{2*\RadiiBig*\r*(1+\r)/(2*\denom)}
    \pgfmathsetmacro{\y}{2*\RadiiBig*\n*\r*(1-\r)/\denom}
    \pgfmathsetmacro{\Radn}{2*\RadiiBig*\r*(1-\r)/(2*\denom)}
    \draw(\x,\y) circle (\Radn);
    \draw(\x,-\y) circle (\Radn);
  }
\end{tikzpicture}
\end{document}

enter image description here

EDIT

Following Thruston's idea with circle inversion applied to Tikz. With use of the definition that a a point P is inverted to P' by AP*AP'=r^2 where r is the mirroring circle, I get the following. I did only a function for the inversion of a point, so the center of the mirror image of a circle has to be derived from that.

\begin{tikzpicture}[
  declare function={CircInv(\APp,\r)=\r*\r/\APp;}
  ]
  \coordinate[label=below:A](A) at (0,0);
  \coordinate[label=below:B](B) at (\RadiiBig*2,0);
  \coordinate[label=below:C](C) at (\RadiiSmall*2,0);
  \pgfmathsetmacro{\Rp}{\RadiiBig-\RadiiSmall}%% R'
  \pgfmathsetmacro{\r}{2*\RadiiBig}%% r: mirror circle
  \pgfmathsetmacro{\R}{(CircInv(2*\RadiiSmall,\r)-\r)/2}%% R: Mirror image of first circle
  \coordinate[label=below:$P'$](Pp) at ($(C)+(\Rp,0)$);%% Center first circle
  \coordinate[label=below:$P$](P) at ($(B)+(\R,0)$);%% Center of mirror circle of first circle
  %%
  \draw[gray!50]($(A)+(-1,0)$)--($(B)+(3,0)$);
  \draw(\RadiiBig,0) circle (\RadiiBig);
  \draw(\RadiiSmall,0) circle (\RadiiSmall);
  \draw[red](A) (-20:\r) arc (-20:50:\r);\draw[red](A) -- +(-15:\r) node[pos=0.5,anchor=south]{$r$};
  \draw[blue](Pp) circle (\Rp);\draw[blue] (Pp) -- +(45:\Rp) node[pos=0.5,anchor=south east]{$R'$};
  \draw[gray](P) circle (\R);\draw[gray] (P) -- +(45:\R) node[pos=0.5,anchor=south east]{$R$};
  %%
  \foreach \n in {1,2}{%% First loop showing the column circles
    \pgfmathsetmacro{\alpha}{atan(2*\n*\R/(\r+\R))}
    \pgfmathsetmacro{\X}{2*\n*\R/sin(\alpha)}%% Length from (A) to center of circle
    \pgfmathsetmacro{\Rpn}{(CircInv(\X-\R,\r)-CircInv(\X+\R,\r))/2}%% Size of mirror circle
    \pgfmathsetmacro{\Y}{CircInv(\X+\R,\r)+\Rpn}%% Length (A to center mirror circle
    \draw[gray](A) -- (\alpha: \X);
    \draw[gray](P |- {(0,2*\n*\R)}) circle (\R);
    \draw[blue](A) -- (\alpha: \Y) circle (\Rpn);
  }
  \foreach \n in {3,4,...,30}{%% Same as previous loop but without gray stuff
    \pgfmathsetmacro{\alpha}{atan(2*\n*\R/(\r+\R))}
    \pgfmathsetmacro{\X}{2*\n*\R/sin(\alpha)}
    \pgfmathsetmacro{\Rpn}{(CircInv(\X-\R,\r)-CircInv(\X+\R,\r))/2}
    \pgfmathsetmacro{\Y}{CircInv(\X+\R,\r)+\Rpn}
    \draw[blue](A) (\alpha: \Y) circle (\Rpn);    
  }
\end{tikzpicture}

enter image description here


You can draw this with circle inversion as well.

enter image description here

I'm not sure how to do inversion with TikZ but here is a Metapost version, wrapped up in luamplib. Compile with lualatex.

\RequirePackage{luatex85}
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
% invert path or pair P in circle C
vardef invert(expr P, C) = 
  save I, r; pair I; numeric r;
  I = center C;
  r = abs(point 0 of C shifted -I); 
  if pair P: if abs(P-I) > 0: unitvector(P-I) scaled (r/abs(P-I)*r) shifted fi I
  elseif path P:
     save T; numeric T;
     T = length P;
     for t=0 upto T-1: invert(point t of P, C) .. endfor if cycle P: cycle else: invert(point T of P, C) fi
  fi
enddef;  
beginfig(1);

    pair A,B,C;
    numeric r; 

    A = origin;
    C = (10cm,0);

    r = 3/4;
    B = r[A,C];

    path c[];
    c1 = fullcircle scaled 2 abs(A-C); % large circle for the inversions
    c2 = fullcircle scaled abs(A-C) shifted 1/2[A,C];
    c3 = fullcircle scaled abs(A-B) shifted 1/2[A,B];
    c4 = fullcircle scaled abs(B-C) shifted 1/2[B,C];
    c5 = invert(c4,c1);

    numeric d; d = abs(point 0 of c5-point 4 of c5);

    for i=1 upto 42:
        draw invert(c5 shifted (0,i*d), c1);
    endfor

    draw subpath(0,4) of c2 withcolor 2/3 blue;
    draw subpath(0,4) of c3 withcolor 2/3 blue;
    draw subpath(0,4) of c4 withcolor 2/3 blue;

    draw A--C;
    dotlabel.bot("$A$", A);
    dotlabel.bot("$B$", B);
    dotlabel.bot("$C$", C);

endfig;
\end{mplibcode}
\end{document}

The method is a bit easier to understand if I draw in a few more parts of the construction: the grey circles are c5 in my code; the pink arc is part of c1, which is the circle in which the c5s in the column are inverted.

enter image description here


Here a simple solution with tkz-elements the new version of tkz-euclide to make only euclidean geometry. tkz-elements

\documentclass{standalone}
\usepackage{tkz-elements}
\begin{document}
  \pgfmathsetmacro{\xB}{6} %nbre of circles
  \pgfmathsetmacro{\xC}{9}
  \pgfmathsetmacro{\xD}{(\xC*\xC)/\xB}
  \pgfmathsetmacro{\xJ}{(\xC+\xD)/2}
  \pgfmathsetmacro{\r}{\xD-\xJ}
  \pgfmathsetmacro{\nc}{16} %nbre of circles
\begin{tikzpicture}[scale=1,ultra thin]
  \tkzDefPoints{0/0/A,\xB/0/B,\xC/0/C,\xD/0/D}
  \tkzDrawCircle[diameter,red](A,C)
  \tkzDrawCircle[diameter,red](A,B)
  \pgfinterruptboundingbox
  \foreach \i in {-\nc,...,0,...,\nc}
  {\tkzDefPoint(\xJ,2*\r*\i){J} \tkzDefPoint(\xJ,2*\r*\i-\r){H}
   \tkzDefCircle[inversion = center A through C](J,H)
   \tkzDrawCircle[diameter,gray](tkzFirstPointResult,tkzSecondPointResult)  }
   \endpgfinterruptboundingbox
\end{tikzpicture}
\end{document}

enter image description here

Tags:

Tikz Pgf