Page 1 of 1


\documentclass{standalone}
\standaloneconfig{border=2mm 2mm 2mm 2mm}
\usepackage{pgfplots}
\pgfplotsset{compat=newest}

\begin{document}
\begin{tikzpicture}

% Define the circles
\def\firstcircle{(0,0) circle (2cm)}
\def\secondcircle{(60:2cm) circle (2cm)}
\def\thirdcircle{(0:2cm) circle (2cm)}

% Draw the rectangle
\draw[dashed] (-3,-2.5) rectangle (4.5,4.5) node at (-2.5,4) {$E$};

% Draw the circles
\draw \firstcircle;
\draw \secondcircle;
\draw \thirdcircle;

% Fill the intersections
\begin{scope}
  \clip \firstcircle;
  \fill[red,opacity=0.5] \secondcircle;
\end{scope}

\begin{scope}
  \clip \firstcircle;
  \fill[green,opacity=0.5] \thirdcircle;
\end{scope}

\begin{scope}
  \clip \secondcircle;
  \fill[blue,opacity=0.5] \thirdcircle;
\end{scope}


% Add the labels
\draw (-2.5,0) node at (-1,-1) {$A$};
\draw (1,2.5) node[above] {$B$};
\draw (1,-2.5) node at (2.5,-1) {$C$};
\draw (-0.1,1.4) node[rotate=20] {$A \cap B \setminus C$};
\draw (1.3,1.5) node[rotate=20] {$B \cap C$};
\draw (0.6,-0.3) node[rotate=45] {$A \cap C$};
\draw (1,0.5) node {$A \cap B \cap C$};

\end{tikzpicture}

\end{document}


Leave a comment if you like this content أترك تعليقا إن أعجبك المحتوى

Class: Figures
Views:  128




0 Comments, Latest

No comments yet. Be the first to Comment

Most viewed courses: