1

I am trying to recreate this image in LaTeX:

enter image description here

So far, I have the following:

\documentclass[a4paper,12pt]{article} 
\usepackage{tikz}
\begin{document}

\begin{center}
    \begin{tikzpicture}

    \draw (2,3) circle (1.5cm); 
    \draw (4.5,3) circle (1.5cm); 

    \draw[red] (2,3)--(4.5,3)--(3.25,3.85)--cycle; 
    \filldraw[red] (2, 3) circle (1pt) node[left] {$c_{1}$};    
    \filldraw[red] (4.5, 3) circle (1pt)node[right] {$c_{2}$};  

    \end{tikzpicture}
\end{center}

\end{document}
3
  • 1
    Should the \theta angle be between two sides of the red triangle? This would sound reasonable, but it not clear from your drawing.
    – frougon
    Apr 6, 2020 at 9:51
  • it is supposed to be the angle between the two circles. I forgot to include a separate angle that will be between the two sides of the triangle.
    – user152384
    Apr 6, 2020 at 10:38
  • I think the angle should be the one between the tangents at the intersection point.
    – Sigur
    Apr 6, 2020 at 15:33

5 Answers 5

6

I thought (but could be wrong) the angle between two circles was defined as the angle between the tangents to the circles from that run through the intersection of the tangents to one circle that runs through the center of the other circle. The intersections library is not needed to construct this.

\documentclass[tikz,border=3mm]{standalone}
\usetikzlibrary{angles,calc,quotes}
\begin{document}
\begin{tikzpicture}[declare function={R1=2;R2=2;d=3.6;},
    shorten both/.style={shorten >=#1,shorten <=#1}]
 \path[nodes={circle,draw,inner sep=0pt}] 
   (0,0) node[minimum size=2*R1*1cm] (c1){}
   (d,0) node[minimum size=2*R2*1cm] (c2){}; 
 \draw[blue,shorten both=-1cm] 
   (tangent cs:node=c2, point={(c1.center)}, solution=2)
  coordinate (t2) -- (c1.center) -- (c2.center)
   -- (tangent cs:node=c1, point={(c2.center)}, solution=1)
  coordinate (t1);
 \path (intersection cs:first line={(c1)--(t2)},second line={(c2)--(t1)}) coordinate (i); 
 \draw[red,shorten both=-1cm] (i)  -- (tangent cs:node=c1, point={(i)}, solution=2) 
    coordinate (t1');
 \draw[red,shorten both=-1cm] (i)  -- (tangent cs:node=c2, point={(i)}, solution=1)
    coordinate (t2');
 \path  pic ["$\theta$", draw=red,angle eccentricity=1.5,angle radius=0.6cm]  {angle = t2'--i--t1'};    
\end{tikzpicture}
\end{document}

enter image description here

ADDENDUM: @sigur and @frougon proposed another well-defined prescription: the angle between the tangents to the circles at the point at which the circles intersect. This is just to say that this angle can be computed analytically very easily, so one does not need to use any libraries. (I am not saying that using libraries is a disadvantage.)

\documentclass[tikz,border=3mm]{standalone}
\begin{document}
\begin{tikzpicture}[declare function={R1=3;R2=2;d=3.5;},
    dot/.style={circle,inner sep=0.6pt,fill}]
 \path[nodes={circle,draw,inner sep=0pt}] 
   (0,0) node[dot,label=below:$c_1$]{} node[minimum size=2*R1*1cm] (c1){}
   (d,0) node[dot,label=below:$c_2$]{} node[minimum size=2*R2*1cm] (c2){};
 \pgfmathsetmacro{\myx}{(R1/d*R1-R2/d*R2+d)/2}
 \pgfmathsetmacro{\myy}{sqrt(R1*R1-\myx*\myx)}
 \path (\myx,\myy) node[dot](i){};
 \pgfmathsetmacro{\myalpha}{asin(\myy/R1)}  
 \pgfmathsetmacro{\mybeta}{180-asin(\myy/R2)}  
 \draw[red] (c1.center) edge[black] (i) (c2.center) edge[black] (i)
 (i)  ++ (-90+\myalpha:1)  edge[blue] ++(90+\myalpha:2)
 (i)  ++ (90+\mybeta:1) edge[blue] ++(-90+\mybeta:2)
 arc[start angle=-270+\mybeta,end angle=-90+\myalpha,radius=1]
 node[midway,below]{$\theta\pgfmathparse{\myalpha+180-\mybeta}
 =\pgfmathprintnumber\pgfmathresult^\circ$};
\end{tikzpicture}
\end{document}

enter image description here

18
  • Honestly, I don't know if there is an official definition of “angle between two circles.” One can certainly define the angle between the curves where they intersect. This is one thing. One can draw an arc “at some point” between the curves, which I did as it seemed to be what the OP wanted. Your idea is also a meaningful possibility! If there was a clear definition, it would have been quite desirable to state it in the question, as this is not a math forum. I did ask for precisions there, but got minimal input in return. :-/
    – frougon
    Apr 6, 2020 at 15:13
  • One sure thing: this question has a high (collective effort)/(OP's effort) ratio!
    – frougon
    Apr 6, 2020 at 15:19
  • @frougon I agree, of course. If you do a Google image search for "angle between two circles" then the interpretation of this post shows up quite a few times. From the hand drawn figure one cannot say much, the results look very similar. I also agree with your second comment but this is generally the case here, i.e. in many posts the question leaves a lot of work for the ones who answer them.
    – user194703
    Apr 6, 2020 at 15:21
  • Too lazy to do the search (and busy with something else), I trust you on this!
    – frougon
    Apr 6, 2020 at 15:25
  • 1
    @frougon Since this question has gotten so little attention I added an analytic variant of one of your variants... ;-)
    – user194703
    Apr 7, 2020 at 0:38
2

What is angle between circles is not clear, so below is solution for angle at top of triangle determined by intersection of tangents on circles from opposite circles origins:

\documentclass[tikz,margin=4mm]{standalone}
\usetikzlibrary{angles,
                calc,
                intersections,
                quotes}

\begin{document}
    \begin{tikzpicture}[
dot/.style = {circle, fill, inner sep=0.5pt, outer sep=0pt},
  C/.style = {circle, draw, minimum size=3cm}
                        ]
\coordinate[dot,label=left :$c_1$] (c1) at (0.0,0)  {};
\coordinate[dot,label=right:$c_2$] (c2) at (2.5,0) {};
\node (C1) [C] at (c1) {};
\node (C2) [C] at (c2) {};
\node[dot] at (c1) {};
\node[dot] at (c2) {};

\draw[name path=A, shorten > = -10mm] 
    (C2) -- (tangent cs:node=C1, point={(C2)}, solution=1) coordinate (t1);
\draw[name path=B, shorten > = -10mm]
    (C1) -- (tangent cs:node=C2, point={(C1)}, solution=2) coordinate (t2);
\draw[name intersections ={of=A and B, by=C}] 
     pic ["$\theta$", draw=red!30]  {angle = c1--C--c2};
    \end{tikzpicture}
\draw[densely dashed, very thin]    
    (c1) -- (t1) node[dot,label=$t_1$] {}
    (c2) -- (t2) node[dot,label=$t_2$] {};
\end{document}

enter image description here

Edit: MWE doesn't generate showed image. This is now corrected. Beside this are add marks tangents points.

2

1 Angle mark drawn between two circles

In this section, I'm only trying here to faithfully reproduce what was asked in the question. This is a drawing; it is quite accurate, but the figure is not necessarily interesting from a mathematical point of view. The arc angle, i.e. the (arc length)/(arc radius) ratio corresponding to the red angle mark depends on the chosen radius (i.e., on where on the circles one decides to place points A1 and A2—see below). Therefore, it is probably not a great idea to call this an “angle between two circles.” (question title). See sections 2 and 3 below, and other answers like Schrödinger's cat's one for different interpretations of the question, where the chosen angle only depends on the circles.

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{backgrounds, calc, intersections, positioning}

\begin{document}

\begin{tikzpicture}[font=\small, my circle radius/.initial=2.5cm]
\coordinate (O1) at (2,3);
\coordinate (O2) at (6,3);

\begin{scope}[nodes={circle, draw, inner sep=0,
              minimum width=2*\pgfkeysvalueof{/tikz/my circle radius}}]
  \node (C1) at (O1) {};
  \node (C2) at (O2) {};
\end{scope}
\path[name path=C1border] (O1)
  circle[radius=\pgfkeysvalueof{/tikz/my circle radius}];
\path[name path=C2border] (O2)
  circle[radius=\pgfkeysvalueof{/tikz/my circle radius}];

\coordinate (M1) at (tangent cs:node=C1, point={(O2)}, solution=1);
\coordinate (M2) at (tangent cs:node=C2, point={(O1)}, solution=2);

\path[name path=p1] (M1) -- (O2);
\path[name path=p2] (M2) -- (O1);
\path[name intersections={of=p1 and p2}] (intersection-1) coordinate (M);

\draw (M) edge ($(M1)!-2.5!(M)$) edge ($(M2)!-2.5!(M)$);
\draw[red] (O1) -- (O2) -- (M) -- cycle;

\begin{scope}[fill=black, every circle/.style={radius=1pt}]
  \fill (O1) circle node[below left] {$\mathcal{C}_{1}$};
  \fill (O2) circle node[below right] {$\mathcal{C}_{2}$};
  \fill (M1) circle node[inner sep=0, xshift=0.3ex, above=0.8ex] {$M_1$};
  \fill (M2) circle node[inner sep=0, xshift=-0.3ex, above=0.8ex] {$M_2$};
\end{scope}

\coordinate (A1) at (C1.30);
\coordinate (A2) at (C2.150);
\path[name intersections={of=C1border and C2border}] (intersection-1)
  coordinate (X);

\begin{scope}[on background layer]
\draw[red] let \p1=($(A1)-(X)$), \p2=($(A2)-(X)$), \n1={atan2(\y1,\x1)},
               \n2={atan2(\y2,\x2)}, \n3={veclen(\p1)} in
  (A2) arc[start angle=\n2, end angle=\n1, radius=\n3]
  node[red, midway, inner sep=0, below=0.3ex] {$\theta$};
\end{scope}
\end{tikzpicture}

\end{document}

enter image description here

If you want a larger angle mark radius, simply move points A1 and A2. For instance, with:

\coordinate (A1) at (C1.15);
\coordinate (A2) at (C2.165);

one obtains:

enter image description here

Note: 15 and 165 are polar angles for points A1 and A2 on each on the respective circles (they are border anchors of circle nodes).

2 Angle between two tangents (a)

The blue angle drawn in this section only depends on the circles.

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{angles, intersections, quotes}

\begin{document}

\begin{tikzpicture}[font=\small, my circle radius/.initial=2.5cm]
\coordinate (O1) at (2,3);
\coordinate (O2) at (6,3);

\begin{scope}[nodes={circle, draw, inner sep=0,
              minimum width=2*\pgfkeysvalueof{/tikz/my circle radius}}]
  \node (C1) at (O1) {};
  \node (C2) at (O2) {};
\end{scope}
\path[name path=C1border] (O1)
  circle[radius=\pgfkeysvalueof{/tikz/my circle radius}];
\path[name path=C2border] (O2)
  circle[radius=\pgfkeysvalueof{/tikz/my circle radius}];

\begin{scope}[fill=black, every circle/.style={radius=1pt}]
  \fill (O1) circle node[below left] {$\mathcal{C}_{1}$};
  \fill (O2) circle node[below right] {$\mathcal{C}_{2}$};
\end{scope}

\path[name intersections={of=C1border and C2border}] (intersection-1)
  coordinate (X);
\draw[dashed] (O1) -- (X) -- (O2);
\path (O1) -- (X) -- ([turn]-90:3cm) coordinate (B2);
\path (O2) -- (X) -- ([turn]90:3cm) coordinate (B1);
\draw[blue] (B1) -- (X) -- (B2);
\pic["$\theta$" color=blue, draw=blue, angle radius=0.25cm,
     angle eccentricity=1.8] {angle=B1--X--B2};
\end{tikzpicture}

\end{document}

enter image description here

The same with angle radius=0.6cm:

enter image description here

3 Angle between two tangents (b)

The red angle drawn in this section only depends on the circles.

\documentclass[tikz, border=2mm]{standalone}
\usetikzlibrary{angles, calc, intersections, positioning, quotes}

\begin{document}

\begin{tikzpicture}[font=\small]
\coordinate (O1) at (2,3);
\coordinate (O2) at (6,3);

\begin{scope}[nodes={circle, draw, inner sep=0, minimum width=2*2.5cm}]
  \node (C1) at (O1) {};
  \node (C2) at (O2) {};
\end{scope}

\coordinate (M1) at (tangent cs:node=C1, point={(O2)}, solution=1);
\coordinate (M2) at (tangent cs:node=C2, point={(O1)}, solution=2);

\path[name path=p1] (M1) -- (O2);
\path[name path=p2] (M2) -- (O1);
\path[name intersections={of=p1 and p2}] (intersection-1) coordinate (M);

\draw (M) edge ($(M1)!-2.5!(M)$) edge ($(M2)!-2.5!(M)$);
\draw[red] (O1) -- (O2) -- (M) -- cycle;

\begin{scope}[fill=black, every circle/.style={radius=1pt}]
  \fill (O1) circle node[below left] {$\mathcal{C}_{1}$};
  \fill (O2) circle node[below right] {$\mathcal{C}_{2}$};
  \fill (M1) circle node[inner sep=0, xshift=0.3ex, above=0.8ex] {$M_1$};
  \fill (M2) circle node[inner sep=0, xshift=-0.3ex, above=0.8ex] {$M_2$};
\end{scope}

\pic["$\theta$" color=red, draw=red, angle radius=0.25cm,
     angle eccentricity=1.8] {angle=O1--M--O2};
\end{tikzpicture}

\end{document}

enter image description here

7
  • off-topic: first solution is meaning leas (it is not clear, what OP means with "angle between circles"). There \theta present angle between two secants, so it is determined by points of crossing secants of circles. With other words, those points are infinity many.
    – Zarko
    Apr 6, 2020 at 12:10
  • @Zarko The radius of the arc drawn in red is arbitrary, but the angle between two regular curves at a point where they intersect is very well defined (given proper orientation on the curves, etc.). Just imagine drawing the tangents where the two circles intersect.
    – frougon
    Apr 6, 2020 at 12:15
  • Are you sure? Well, I will left this to OP (since this off-topic here). But, can you draw this angle for bigger angle locus radius?
    – Zarko
    Apr 6, 2020 at 12:21
  • Sure, just look at the latest edit.
    – frougon
    Apr 6, 2020 at 12:40
  • Thank you! Now you just confirm now my claims, but let us left this to OP :-)
    – Zarko
    Apr 6, 2020 at 13:08
1

I have a more generic version to offer.

You only have to set the radius and the center of both circles. All other parameters are derived from these numbers.

In contrast to your solution the intersections library calculates the point where the circles intersect.

s

\documentclass[a4paper,12pt]{article} 

\usepackage{tikz}

\usetikzlibrary{intersections, calc, math}

\begin{document}


\begin{center}
    \begin{tikzpicture}[x=1.5cm, y=1.5cm]

        \tikzmath{
            coordinate \C{1-center}, \C{2-center};
            \C{1-center} = (2,3);
            \C{2-center} = (5,3);
            \r{1} = 2;
            \r{2} = 2;
            \r{angle} = 1;
        }

        \foreach \i in {1,2} {
            \draw[lightgray, name path global=C\i] (\C{\i-center}) coordinate(C\i-center) circle[radius=\r{\i}]; 
        }

        \draw[name intersections={of=C1 and C2, by=X}] 
            foreach \i in {1,2} { (X) -- ($(X)!-0.5!(C\i-center)$) };

        \draw[red] (C1-center) node[left] {$c_{1}$} -- 
            (C2-center) node[right] {$c_2$}  -- 
            (X) node[above, fill=white, fill opacity=0.7, text opacity=1] {$c_3$} -- cycle; 

        \foreach \i in {{C1-center}, {C2-center}, X} {
            \filldraw[red] (\i) circle (1pt);
        }

        \draw[blue] 
            let \p{1} = (C1-center), 
                \p{2} = (C2-center), 
                \p{3} = (X), 
                \n{start} = {-180+atan2(\y{3}-\y{1}, \x{3}-\x{1})}, 
                \n{end} = {-180+atan2(\y{3}-\y{2}, \x{3}-\x{2})} in 
            ($(X)!\r{angle} cm!(C1-center)$) arc[start angle=\n{start}, end angle=\n{end}, radius=\r{angle} cm] coordinate(T1) 
            ($(X)!\r{angle} cm!(C1-center)!0.5!(T1)!0.3!(X)$) node{$\theta$};

    \end{tikzpicture}
\end{center}

\end{document}
1

From wolfram.com :

The angle of intersection of two overlapping circles is defined as the angle between their tangents at either of the intersection points. When the angle is 180°, we say that the circles are tangent. When the angle is 90°, we say that the circles are orthogonal.

Important definition because it allows to study the "conservation of angles" by the transformation called "inversion". Circles and angles are conserved.

The case with orthogonal circles makes the definition interesting.

With this definition, I can propose a solution with a new package elements. This package is the successor of tkz-euclide, a simpler version with only the centimeter as a unit and independent of tkz-base. Of course the code compiles with tkz-euclide.

A)

\documentclass{standalone} 
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{tkz-elements}

\begin{document} 
\begin{tikzpicture}
\tkzDefPoints{0/0/A,6/0/B,4/2/C}
\tkzDrawCircles(A,C B,C)
\tkzDefTangent[at=C](A) \tkzGetPoint{a}
\tkzDefPointsBy[symmetry = center C](a){d}
\tkzDefTangent[at=C](B) \tkzGetPoint{b}
\tkzDrawLines[add=1 and 4](a,C  C,b)
\tkzDrawSegments(A,C B,C)
\tkzFindAngle(b,C,d)
\tkzGetAngle{bcd}
\tkzMarkAngle[size=.5](b,C,d)
\tkzFillAngle[fill=MidnightBlue,opacity=.2,size=1cm](b,C,d)
\tkzLabelAngle[pos=1.25](b,C,d){\small $\bcd^\circ$}
\end{tikzpicture}
\end{document}

enter image description here

B)

It's interesting to verify the result with two orthogonal circles. Now the point C is defined by the macro ` \tkzDefCircleorthogonal from=B

\documentclass{standalone} 
\usepackage[usenames,dvipsnames]{xcolor}
\usepackage{elements}

\begin{document} 
\begin{tikzpicture}
\tkzDefPoints{0/0/A,6/0/B,4/2/D}
\tkzDefCircle[orthogonal from=B](A,D)
\pgfnodealias{C}{tkzFirstPointResult}
\tkzDrawCircles(A,C B,C)
\tkzDefTangent[at=C](A) \tkzGetPoint{a}
\tkzDefPointsBy[symmetry = center C](a){d}
\tkzDefTangent[at=C](B) \tkzGetPoint{b}
\tkzDrawLines[add=1 and 4](a,C  C,b)
\tkzDrawSegments(A,C B,C)
\tkzFindAngle(b,C,d)
\tkzGetAngle{bcd}
\tkzMarkAngle[size=.5](b,C,d)
\tkzFillAngle[fill=MidnightBlue,opacity=.2,size=1cm](b,C,d)
\tkzLabelAngle[pos=1.25](b,C,d){\small $\bcd^\circ$}
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.