[Tex/LaTex] Drawing an equilateral triangle inside a circle, an incircle, and two shaded regions

tikz-pgf

enter image description here

A circle is inscribed in an equilateral triangle. Another circle going through the three vertices of the triangle is drawn. One region outside the triangle and within the larger circle is shaded. The region outside the smaller circle and inside the triangle is shaded.

Shading is too hard for me.

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\begin{tikzpicture}
\draw (8.,0.) -- (14.,0.) -- (11.,5.196152422706633) -- cycle;
\draw(11.,1.7320508075688779) circle (1.7320508075688772cm);
\draw(11.,1.7320508075688787) circle (3.4641016151377544cm);
\begin{scriptsize}
\draw  (8.,0.) circle (1.5pt);
\draw  (14.,0.) circle (1.5pt);
\draw  (11.,5.196152422706633) circle (1.5pt);
\draw (9.5,2.5980762113533165) circle (1.5pt);
\draw  (12.5,2.5980762113533165) circle (1.5pt);
\draw (11.,0.) circle (1.5pt);
\end{scriptsize}
\end{tikzpicture}
\end{document}

I also want a similar figure with the triangle is replacced by a square.

Best Answer

One option:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\definecolor{mypurple}{RGB}{236,145,191}

\newlength\Radius
\setlength\Radius{2cm}

\begin{document}

\begin{tikzpicture}[line join=round]
\filldraw[fill=mypurple,even odd rule]
  (0,0) -- node[above] {$R$} (210:\Radius) arc [start angle=210,end angle=90,radius=\Radius] -- (0,0)
  (210:\Radius) -- (90:\Radius) -- (0,0)
  (0,0) -- (30:0.5\Radius) arc [start angle=30,end angle=-90,radius=0.5\Radius] --(0,0)
  (30:0.5\Radius) -- (-30:\Radius) -- (-90:0.5\Radius) -- (0,0);
\draw 
  (0,0) circle [radius=\Radius]
  (0,0) circle [radius=0.5\Radius]
  (90:\Radius) -- (210:\Radius) -- (-30:\Radius) -- cycle
  (0,0) -- (-30:0.5\Radius) node[midway,above] {$r$};
\fill (0,0) circle [radius=1.5pt];
\end{tikzpicture}

\end{document}

enter image description here

The square case:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\definecolor{mypurple}{RGB}{236,145,191}

\newlength\Radius
\setlength\Radius{2cm}

\begin{document}

\begin{tikzpicture}[line join=round]
\fill[fill=mypurple,even odd rule,draw=white]
  (0,0) -- (0:{\Radius/sqrt(2)}) arc[start angle=0,end angle=-90,radius=\Radius/sqrt(2)] -- (0,0) rectangle (-45:\Radius)
  (0,0) -- (45:\Radius) arc[start angle=45,end angle=135,radius=\Radius] -- (0,0) -- (45:\Radius) -- (135:\Radius) -- cycle ;
\draw
  (0,0) circle [radius=\Radius]
  (225:\Radius) rectangle (45:\Radius)
  (0,0) circle [radius=\Radius/sqrt(2)];
\fill (0,0) circle [radius=1.5pt];
\draw 
  (225:\Radius) -- node[above left=-1pt] {$R$} (0,0) -- node[above right=-1pt] {$r$} (-45:{\Radius/sqrt(2)}); 
\end{tikzpicture}

\end{document}

enter image description here

Update:

Without even odd rule:

\documentclass[border=5pt]{standalone}
\usepackage{tikz}
\definecolor{mypurple}{RGB}{236,145,191}

\newlength\Radius
\setlength\Radius{2cm}

\begin{document}

\begin{tikzpicture}[line join=round]
\fill[fill=mypurple]
  (210:\Radius) arc [start angle=210,end angle=90,radius=\Radius] -- cycle
  (30:0.5\Radius) arc [start angle=30,end angle=-90,radius=0.5\Radius] -- (-30:\Radius) -- cycle;
\draw 
  (0,0) circle [radius=\Radius]
  (0,0) circle [radius=0.5\Radius]
  (90:\Radius) -- (210:\Radius) -- (-30:\Radius) -- cycle
  (0,0) -- (210:\Radius) node[midway,above] {$R$}
  (0,0) -- (-30:0.5\Radius) node[midway,above] {$r$}
  (90:\Radius) -- (90:-0.5\Radius);
\fill (0,0) circle [radius=1.5pt];
\end{tikzpicture}

\begin{tikzpicture}[line join=round]
\fill[fill=mypurple]
  (0:{\Radius/sqrt(2)}) arc[start angle=0,end angle=-90,radius=\Radius/sqrt(2)] -- (-45:\Radius) -- cycle
  (45:\Radius) arc[start angle=45,end angle=135,radius=\Radius] -- cycle ;
\draw
  (0,0) circle [radius=\Radius]
  (225:\Radius) rectangle (45:\Radius)
  (0,0) circle [radius=\Radius/sqrt(2)];
\fill (0,0) circle [radius=1.5pt];
\draw 
  (225:\Radius) -- node[above left=-1pt] {$R$} (0,0) -- node[above right=-1pt] {$r$} (-45:{\Radius/sqrt(2)}); 
\end{tikzpicture}

\end{document}