What is the easiest way to have TikZ or tikz-euclide generate a picture with successive incircles to a triangle without needing to calculate the points for each smaller triangle?

I have the following code that has two incircles to a triangle. What if I want to continue or automate this drawing for different triangles?


\draw ({-sqrt(3)},-1) -- ({(1-sqrt(3))/2}, {(1+sqrt(3))/2}) -- ({2+sqrt(3)},-1) -- ({-sqrt(3)},-1) ;
\draw (0,0) circle [radius=1];

\tkzDrawSegments(A,B B,C C,A)

\tkzDrawCircle[R](I,\rIN pt)




I interpreted your question so that the new triangles are similar to the old one. Your example was different in that point.

With a little work, you can create an image that has that recursive done at every side and also in the circle itself.


%    \pgfpointdiff{\tikz@scan@one@point\pgfutil@firstofone(#1)}
%                 {\tikz@scan@one@point\pgfutil@firstofone(#2)}%
\path (0,0) coordinate (A) + (0:3) coordinate (B) +(60:1) coordinate (C);
\draw (A) -- (B) -- (C) -- cycle;
\foreach \cnt in {1,...,10}{
  \path (barycentric cs:A=\triA,B=\triB,C=\triC) coordinate (M)
       node [draw, circle through=($(A)!(M)!(C)$)] (M) {};
 % or: circle[radius=\triRadius]
  \draw ($(C)-(A)$) coordinate (vecB)
      (M.60-90) coordinate (@) % or: ([shift=(60-90:\triRadius)] M) coordinate (@)
      (intersection of @--[shift=(vecB)]@ and B--C) coordinate (C) -- 
      (intersection of @--[shift=(vecB)]@ and B--A) coordinate (A);


enter image description here

  • This is fantastic! Thank you! What if I wanted to have all the triangles similar except for the largest one? Is there an easy way to do that? Nov 27 '13 at 21:05
  • 1
    @DavidCaliri Well, then just do the first, non-regular step separately and enter the pseudo-recursive algorithm/the foreach loop after that. Nov 28 '13 at 1:00
  • That worked great! Thank you! I also worked it to get the circles going down each corner of the triangle, but I'm not sure if I did this in the most efficient way. I apologize I am new to this site and not sure how I should post the new code. In a new question, or an answer to this question? Dec 1 '13 at 22:39

With math library (cvs-version) it's easy:


\foreach \i [remember=\r (initially 3)] in {1,2,...,5}{
   \draw (0,0) circle (\r);
   \draw (90:\r) -- (-30:\r)--(210:\r)--cycle;

enter image description here


And this is a valid solution for TiKZ 2.10. It uses through library.

   \draw (0,0) circle (3cm);
   \coordinate (a) at (90:3);
   \coordinate (b) at (-30:3);
   \coordinate (c) at (210:3);
   \foreach \in in {1,2,...,5}
     \node[circle through=(a),draw] {};
     \draw (a)--(b)--(c)--cycle;
     \coordinate(aux) at (a);
     \path (a)--(b) coordinate[pos=.5] (a);
     \path (b)--(c) coordinate[pos=.5] (b);
     \path (c)--(aux) coordinate[pos=.5] (c);


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.