Summary Files Commits Branches @commit @diff @stats
path: root / src / teaching / upp-2025 / week06 / tex / two_circles.tex
blob: 41a822c5050826eda7c1e158b2deaf5e8997ad14 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
% https://alfurka.github.io/quick-tikz/
\def \circleA {(0.5,0) circle [radius=1.5]}
\def \circleB {(0,-0.5) circle [radius=1.5]}

\begin{tikzpicture}[scale=2,background rectangle/.style={fill=white}, show background rectangle]
  % Axis
  \draw (-2.5,0) -- (2.5,0);
  \draw (0,-2.5) -- (0,2.5);
  \draw[step=0.5,gray,very thin] (-2.4,-2.4) grid (2.4,2.4);

  % Main shapes
  \draw[blue] \circleA;
  \draw[red] \circleB;

  % Intersection
  \begin{scope}
    \clip \circleA;
    \draw[pattern=crosshatch, even odd rule] \circleA \circleB;
  \end{scope}
\end{tikzpicture}