[Tex/LaTex] Fill a section between two circles with TikZ

tikz-pgf

I am trying to fill a pattern in a section between two circles with TikZ.

image

In the code below, C0 is a circle with radius=1, center=(0,0).
C1 is a circle through Point z0 with center=z1.

Calculating the coordinates of the two circles' intersections is too complicated task, so I want to specify the arcs between the two intersections' label.

But I found a difficulty in specifying an arc with the start/end points and the center.

Is there any straightforward solution to fill this kind of section?

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{calc,patterns,through,intersections}
\begin{document}
\begin{tikzpicture}
 % x, y axis
 \draw[->] (-1.5,0) -- (3,0) node[right] {$x$};
 \draw[->] (0,-1.5) -- (0,3) node[above] {$y$};
 % Origin
 \coordinate (O) at (0,0);

 % Point z0
 \coordinate (z0) at (1,0);
 \node [below right] at (z0) {$z_0$};
 % Circle C0
 \draw [name path=C0] (O) circle [radius=1];
 \node [above left] at (170:1) {$C_0$};
 % Point z1
 \coordinate (z1) at (30:0.7);
 \fill (z1) circle [radius=1pt];
 \node [below] at (z1) {$z_1$};

 % Circle C1
 \node [draw, circle through=(z0), name path=C1] at (z1) {};
 \node [above right] at ($(30:0.7)+(20:0.5)$) {$C_1$};

 % Intersections
 \path [name intersections={of=C0 and C1}];

\draw [pattern=north west lines, pattern color=gray!60!white] (z0)  arc (?:?:?) --(intersection-2) arc (?:?:1) --(z0);
\end{tikzpicture}
\end{document}

Best Answer

Probably the easiest way is after filling C1 to re-filldraw C0, and finaly to draw the axes. Here is another solution using clipping, that use the "inverse clip" idea from an old Jake's answer and path picture clipping.

\documentclass[tikz,border=7mm]{standalone}
\usetikzlibrary{calc,patterns,through,intersections}
\begin{document}
  \begin{tikzpicture}
    % x, y axis
    \draw[->] (-1.5,0) -- (3,0) node[right] {$x$};
    \draw[->] (0,-1.5) -- (0,3) node[above] {$y$};
    % Origin
    \coordinate (O) at (0,0);
    % Point z0
    \coordinate (z0) at (1,0);
    \node [below right] at (z0) {$z_0$};
    % Circle C0
    \draw [name path=C0] (O) circle [radius=1];
    \node [above left] at (170:1) {$C_0$};
    % Point z1
    \coordinate (z1) at (30:0.7);
    \fill (z1) circle [radius=1pt];
    \node [below] at (z1) {$z_1$};
    % Circle C1
    \node [draw, circle through=(z0), name path=C1,
      path picture={
        \clip (-20,-20) rectangle +(40,40) (O) circle [radius=1 cm +.5\pgflinewidth];
        \fill[pattern=crosshatch, pattern color=green] (-20,-20) rectangle +(40,40);
      }
    ] at (z1) {};
    \node [above right] at ($(30:0.7)+(20:0.5)$) {$C_1$};
  \end{tikzpicture}
\end{document}

enter image description here

Related Question