Sombrea un área específica

Sombrea un área específica

Tengo la siguiente figura usando este código proveniente de GeoGebra. Para la tercera figura, quiero sombrear el área entre el semicírculo y los segmentos, pero no sé cómo hacerlo.
ingrese la descripción de la imagen aquí

\documentclass[french,12pt,a4paper,titlepage]{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usepackage{marginnote}
\usetikzlibrary{arrows}
\definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
\definecolor{zzttqq}{rgb}{0.6,0.2,0}
\definecolor{cqcqcq}{rgb}{0.7529411764705882,0.7529411764705882,0.7529411764705882}
\definecolor{dyrbwq}{rgb}{0.8470588235294118,0.10588235294117647,0.3764705882352941}
\definecolor{xdxdff}{rgb}{0.49019607843137253,0.49019607843137253,1}
\definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}


\begin{document}
        \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
            % Grid
            \draw [color=cqcqcq,, xstep=1cm,ystep=1cm] (-6,-2) grid (9,4); (11.566219733339873,8.525002520591164);
            
            % Whole circle
            \draw [line width=.8pt,color=zzttqq,fill=zzttqq,fill opacity=0.12] (-3,1) circle (2cm);
            
            % Quarter circle
            \draw [shift={(3,0)},line width=.8pt,color=zzttqq,fill=zzttqq,fill opacity=0.12]  (0,0) --  plot[domain=1.5707963267948966:3.141592653589793,variable=\t]({1*3*cos(\t r)+0*3*sin(\t r)},{0*3*cos(\t r)+1*3*sin(\t r)}) -- cycle ;
            
            % 3e figure
            \draw [line width=.8pt,color=zzttqq] (4,1)-- (4,3);
            \draw [line width=.8pt,color=zzttqq] (4,3)-- (8,3);
            \draw [line width=.8pt,color=zzttqq] (8,3)-- (8,1);
            \draw [shift={(6,1)},line width=.8pt,color=zzttqq]  plot[domain=0:3.141592653589793,variable=\t]({1*2*cos(\t r)+0*2*sin(\t r)},{0*2*cos(\t r)+1*2*sin(\t r)});
            \draw [line width=.8pt,color=zzttqq] (4,1)-- (4,3);
            \draw [line width=.8pt,color=zzttqq] (4,3)-- (8,3);
            \draw [line width=.8pt,color=zzttqq] (8,3)-- (8,1);
            
            % Vector
            \draw [line width=.8pt, latex-latex] (-1,3)-- (0,3);
            \draw (-1.,3.8) node[anchor=north west] {$\mathbf{15 \ mm}$};
            
            % Centers
            \draw [fill=black] (-3,1) circle (1pt);
            \draw[color=black] (-2.8359128474830912,1.271089406461309) node {$C_{1}$};
            \draw [fill=black] (3,0) circle (1pt);
            \draw[color=black] (3.1,-0.3) node {$C_{2}$};
            \draw [fill=black] (6,1) circle (1pt);
            \draw[color=black] (5.774154770848989,0.850353117956426) node {$C_{3}$};
        \end{tikzpicture}
    
\end{document}

Respuesta1

En lugar de trazar cada segmento y arco uno por uno, puedes simplemente definir un camino que defina el contorno de cada figura.

% 3e figure
            \draw [line width=.8pt,remplissage] (4,1)-- (4,3)-- (8,3)-- (8,1) arc[start angle=0,end angle=180,radius=2];

Agregué un estilo para evitar la repetición de código.

\tikzset{remplissage/.style={color=zzttqq,fill=zzttqq,fill opacity=0.12}} 

Código completo:

\documentclass[french,12pt,a4paper,titlepage]{article}

\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\usepackage{mathrsfs}
\usepackage{marginnote}
\usetikzlibrary{arrows}
\definecolor{qqwuqq}{rgb}{0,0.39215686274509803,0}
\definecolor{zzttqq}{rgb}{0.6,0.2,0}
\definecolor{cqcqcq}{rgb}{0.7529411764705882,0.7529411764705882,0.7529411764705882}
\definecolor{dyrbwq}{rgb}{0.8470588235294118,0.10588235294117647,0.3764705882352941}
\definecolor{xdxdff}{rgb}{0.49019607843137253,0.49019607843137253,1}
\definecolor{ududff}{rgb}{0.30196078431372547,0.30196078431372547,1}

\tikzset{remplissage/.style={color=zzttqq,fill=zzttqq,fill opacity=0.12}}
\begin{document}
        \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
            % Grid
            \draw [color=cqcqcq,, xstep=1cm,ystep=1cm] (-6,-2) grid (9,4); (11.566219733339873,8.525002520591164);
            
            % Whole circle
            \draw [line width=.8pt,remplissage] (-3,1) circle (2cm);
            
            % Quarter circle
            \draw [line width=.8pt,remplissage]  (3,0) --++(0,3)arc[start angle=90,end angle=180,radius=3]   -- cycle ;
            
            % 3e figure
            \draw [line width=.8pt,remplissage] (4,1)-- (4,3)-- (8,3)-- (8,1) arc[start angle=0,end angle=180,radius=2];

            
            % Vector
            \draw [line width=.8pt, latex-latex] (-1,3)-- (0,3);
            \draw (-1.,3.8) node[anchor=north west] {$\mathbf{15 \ mm}$};
            
            % Centers
            \draw [fill=black] (-3,1) circle (1pt);
            \draw[color=black] (-2.8359128474830912,1.271089406461309) node {$C_{1}$};
            \draw [fill=black] (3,0) circle (1pt);
            \draw[color=black] (3.1,-0.3) node {$C_{2}$};
            \draw [fill=black] (6,1) circle (1pt);
            \draw[color=black] (5.774154770848989,0.850353117956426) node {$C_{3}$};
        \end{tikzpicture}
\end{document}

ingrese la descripción de la imagen aquí

Respuesta2

Las figuras de Geogebra se pueden exportar a códigos TikZ o Asíntota. Sin embargo, es mucho mejor codificar directamente con TikZ o Asymptote.

TikZ ingrese la descripción de la imagen aquí

\documentclass[tikz,border=5mm]{standalone}
\begin{document}
\begin{tikzpicture}[mydot/.style={circle,fill=black,inner sep=1pt}]
\draw[gray!30] (-3,-3) grid (12,3);
\draw[<->,thick] (2,2)--(3,2) node[scale=.8,above=2mm,midway]{$15$ mm};
\draw[red,fill=yellow,fill opacity=.5]
(0,0) node[mydot]{} node[above,black]{$C_1$} circle(2)
(6,-1) node[mydot]{} node[below right,black]{$C_2$}--+(0,3) arc(90:180:3)--cycle
(11,0) arc(0:180:2)--+(0,2)-|cycle
(9,0) node[mydot]{} node[below,black,fill=white]{$C_3$}
;
\end{tikzpicture}
\end{document}

Asíntota

ingrese la descripción de la imagen aquí

// http://asymptote.ualberta.ca/
import math;
unitsize(1cm);

// grid and a label
add(shift(-3,-3)*grid(15,6,lightgray));
draw(scale(.8)*"$15$ mm",align=2N,(2,2)--(3,2),Arrows);

// starting points and pens
pair C1=(0,0),C2=(6,-1),C3=(9,0);
pen p=brown;
pen q=p+opacity(.1);

// 3 pics with dots
filldraw(circle(C1,2),q,p);
filldraw(C2--arc(C2,3,90,180)--cycle,q,p);
filldraw(arc(C3,2,0,180)--C3+(-2,2)--C3+(2,2)--cycle,q,p);

dot("$C_1$",C1,N);
dot("$C_2$",C2,SE);
dot(Label("$C_3$",Fill(white)),C3,N);

shipout(bbox(5mm,invisible));

Respuesta3

Propongo el código de AndréC (¡y sus resultados!) sin la pesadez del código de colores (de GeoGebra). Más lo uso tikzen lugar de pgfplots.

\documentclass[french,12pt,a4paper]{article}

\usepackage{tikz}

\usetikzlibrary{arrows}

\tikzset{remplissage/.style={orange!90,fill=orange!80,fill opacity=0.12}}
\begin{document}
        \begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1cm,y=1cm]
            % Grid
            \draw [gray!20, xstep=1cm,ystep=1cm] (-6,-2) grid (9,4);
            
            % Whole circle
            \draw [line width=.8pt,remplissage] (-3,1) circle (2cm);
            
            % Quarter circle
            \draw [line width=.8pt,remplissage]  (3,0) --++(0,3)arc[start angle=90,end angle=180,radius=3]   -- cycle ;
            
            % 3e figure
            \draw [line width=.8pt,remplissage] (4,1)-- (4,3)-- (8,3)-- (8,1) arc[start angle=0,end angle=180,radius=2];

            % Vector
            \draw [line width=.8pt, latex-latex] (-1,3)-- (0,3);
            \draw (-1.,3.8) node[anchor=north west] {$\mathbf{15 \ mm}$};
            
            % Centers
            \draw [fill=black] (-3,1) circle (1pt) node[above] {$C_{1}$};
            \draw [fill=black] (3,0) circle (1pt) node[below] {$C_{2}$};
            \draw [fill=black] (6,1) circle (1pt) node[below] {$C_{3}$};
        \end{tikzpicture}
\end{document}

información relacionada