10

I have to fill a specific region as given in the following figure.

The code I have written is

\begin{tikzpicture}

\draw (0,0) rectangle (10,10);

\draw (3.5,3.5) circle (5) node {A};

\end{tikzpicture}

Now, how to fill the intersecting area (area of circle overlapping the square)

percusse
  • 157,807
Divya
  • 401
  • 4
  • 10

1 Answers1

19

Use clipping, e.g. like this

\documentclass{article}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
\begin{scope}
  \clip (0,0) rectangle (10,10);
  \fill[red] (3.5,3.5) circle (5);
\end{scope}
\draw (0,0) rectangle (10,10);
\draw (3.5,3.5) circle (5) node {A};
\end{tikzpicture}
\end{document}

enter image description here

egreg
  • 1,121,712
bencarabelli
  • 1,393
  • 7
  • 11