latextikz

How to draw an inner-circle of a circular sector in latex with tkz-euclide?


I already have the following codes:

\documentclass[a4paper]{standalone}
\usepackage{tikz}
\usepackage{tkz-euclide}

\begin{document}
    \begin{tikzpicture}
        \tkzInit[ymin=-1,ymax=6,xmin=-1,xmax=10]
        \tkzClip[space=.5]

        \tkzDefPoint(0,0){A} % A
        \tkzDefPoint(10,0){B} % B
        \tkzDefMidPoint(A,B) \tkzGetPoint{M} % M

        \tkzDefPoint(8,0){I}
        \tkzDefPointWith[orthogonal](I,M) \tkzGetPoint{H}
        \tkzInterLC(I,H)(M,B) \tkzGetSecondPoint{P} %P

        \tkzDrawPoints(A,B,M) % Draw A, B, M
        \tkzDrawSegment[black](A,B) % Draw AB
        \tkzDrawArc[black](M,B)(A) % Draw arc AB
        % Draw semicircle

        \tkzDrawPoints(P) % Draw P
        \tkzDrawSegment[black](M,P) % Draw MP
        % Draw MP

        \tkzLabelPoint[below](M){$M$}
        \tkzLabelPoint[below left](A){$A$}
        \tkzLabelPoint[below right](B){$B$}
        \tkzLabelPoint[above right](P){$P$}
        % Point labels
    \end{tikzpicture}
\end{document}

It draws a semicircle like this:

Now I want to draw two inner-circle of circular sector AMP and MPB. Also I need the contact points these two circles with MA, MB and arc AB. The final drawing should look like:

I would like to know how should I do that?


Solution

  • After some research I found a way. There's no built-in function for drawing such an inner-circle, but we can calculate the coord of the both centres of the circles.

    The centre of an inner-circle of a circular sector is on the angle bisector, and the intersection of the angle bisector & the arc is one of the three contact points. The radius of the inner-circle r can be calculated with the radius of the circular sector R like: r = R * sin(a / 2) / (1 + sin(a / 2)).

    And the followings are simple.

    \documentclass[a4paper]{standalone}
    \usepackage{tikz}
    \usepackage{tkz-euclide}
    
    \begin{document}
        \begin{tikzpicture}
            \tkzInit[ymin=-1,ymax=6,xmin=-1,xmax=11]
            \tkzClip[space=.5]
    
            \tkzDefPoint(0,0){A} % A
            \tkzDefPoint(10,0){B} % B
            \tkzDefMidPoint(A,B) \tkzGetPoint{M} % M
    
            \tkzDefPoint(8,0){X1}
            \tkzDefPointWith[orthogonal](X1,M) \tkzGetPoint{X2}
            \tkzInterLC(X1,X2)(M,B) \tkzGetSecondPoint{P} %P
    
            \tkzDefLine[bisector,normed](A,M,P) \tkzGetPoint{X3}
            \tkzInterLC(M,X3)(M,A) \tkzGetSecondPoint{C} % C
            \tkzDefLine[bisector,normed](B,M,P) \tkzGetPoint{X4}
            \tkzInterLC(M,X4)(M,B) \tkzGetSecondPoint{E} % E
    
            \tkzCalcLength(A,M) \tkzGetLength{lR}
            \tkzFindAngle(A,M,P) \tkzGetAngle{aAMP}
            \pgfmathsetmacro{\lra}{\lR*sin(\aAMP/2)/(1+sin(\aAMP/2))} % radius of circle kA
            \pgfmathsetmacro{\shiftCx}{-cos(\aAMP/2)*\lra}
            \pgfmathsetmacro{\shiftCy}{-sin(\aAMP/2)*\lra}
            \tkzDefShiftPoint[C](\shiftCx,\shiftCy){O1} % O1, centre of circle kA
            \tkzDefPointBy[projection = onto A--M](O1) \tkzGetPoint{D} % D
            \tkzFindAngle(B,M,P) \tkzGetAngle{aBMP}
            \pgfmathsetmacro{\lrb}{\lR*sin(\aBMP/2)/(1+sin(\aBMP/2))} % radius of circle kB
            \pgfmathsetmacro{\shiftEx}{-cos(\aBMP/2)*\lrb}
            \pgfmathsetmacro{\shiftEy}{-sin(\aBMP/2)*\lrb}
            \tkzDefShiftPoint[E](\shiftEx,\shiftEy){O2} % O2, centre of circle kB
    
            \tkzDrawPoints(A,B,M) % Draw A, B, M
            \tkzDrawSegment[black](A,B) % Draw AB
            \tkzDrawArc[black](M,B)(A) % Draw arc AB
            % Draw semicircle
    
            \tkzDrawPoints(P) % Draw P
            \tkzDrawSegment[black](M,P) % Draw MP
            % Draw MP
    
            \tkzDrawPoints(C,D,E,O1,O2) % Draw C, E, O1, O2
            \tkzDrawCircle(O1,C) % Draw circle kA
            \tkzDrawCircle(O2,E) % Draw circle kB
            \tkzDrawSegment[black](A,E) % Draw AE
            \tkzDrawSegment[black](C,D) % Draw CD
            % Draw circles related elements
    
            \tkzLabelPoint[below](M){$M$}
            \tkzLabelPoint[below left](A){$A$}
            \tkzLabelPoint[below right](B){$B$}
            \tkzLabelPoint[above right](P){$P$}
            \tkzLabelPoint[above left](C){$C$}
            \tkzLabelPoint[below](D){$D$}
            \tkzLabelPoint[above right](E){$E$}
            \tkzLabelPoint[above right](O1){$O_1$}
            \tkzLabelPoint[below right](O2){$O_2$}
            % Point labels
        \end{tikzpicture}
    \end{document}
    

    and it looks like: