| 1 |
%% |
| 2 |
%% This is file `venndiagram.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% venndiagram.dtx (with options: `venndiagram.sty,package') |
| 8 |
%% |
| 9 |
%% venndiagram.dtx |
| 10 |
%% Copyright 2018 Nicola Talbot |
| 11 |
%% |
| 12 |
%% This work may be distributed and/or modified under the |
| 13 |
%% conditions of the LaTeX Project Public License, either version 1.3 |
| 14 |
%% of this license or (at your option) any later version. |
| 15 |
%% The latest version of this license is in |
| 16 |
%% http://www.latex-project.org/lppl.txt |
| 17 |
%% and version 1.3 or later is part of all distributions of LaTeX |
| 18 |
%% version 2005/12/01 or later. |
| 19 |
%% |
| 20 |
%% This work has the LPPL maintenance status `maintained'. |
| 21 |
%% |
| 22 |
%% The Current Maintainer of this work is Nicola Talbot. |
| 23 |
%% |
| 24 |
%% This work consists of the files venndiagram.dtx and venndiagram.ins and the derived file venndiagram.sty. |
| 25 |
%% |
| 26 |
%% \CharacterTable |
| 27 |
%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z |
| 28 |
%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z |
| 29 |
%% Digits \0\1\2\3\4\5\6\7\8\9 |
| 30 |
%% Exclamation \! Double quote \" Hash (number) \# |
| 31 |
%% Dollar \$ Percent \% Ampersand \& |
| 32 |
%% Acute accent \' Left paren \( Right paren \) |
| 33 |
%% Asterisk \* Plus \+ Comma \, |
| 34 |
%% Minus \- Point \. Solidus \/ |
| 35 |
%% Colon \: Semicolon \; Less than \< |
| 36 |
%% Equals \= Greater than \> Question mark \? |
| 37 |
%% Commercial at \@ Left bracket \[ Backslash \\ |
| 38 |
%% Right bracket \] Circumflex \^ Underscore \_ |
| 39 |
%% Grave accent \` Left brace \{ Vertical bar \| |
| 40 |
%% Right brace \} Tilde \~} |
| 41 |
\NeedsTeXFormat{LaTeX2e} |
| 42 |
\ProvidesPackage{venndiagram}[2018/06/07 v1.2 (NLCT) Venn diagrams] |
| 43 |
\RequirePackage{xkeyval} |
| 44 |
\RequirePackage{tikz} |
| 45 |
\RequirePackage{etoolbox} |
| 46 |
\newif\ifvennoldpgf |
| 47 |
\ifdef\pgfversion |
| 48 |
{ |
| 49 |
\def\@venn@checkversion#1.#2\@venn@end@checkversion{% |
| 50 |
\ifnum#1<3 \vennoldpgftrue \else \vennoldpgffalse\fi} |
| 51 |
\expandafter\@venn@checkversion\pgfversion.0\@venn@end@checkversion |
| 52 |
} |
| 53 |
{ |
| 54 |
\vennoldpgftrue |
| 55 |
} |
| 56 |
\newcommand*{\@venn@label@A}{$A$} |
| 57 |
\newcommand*{\@venn@label@B}{$B$} |
| 58 |
\newcommand*{\@venn@label@C}{$C$} |
| 59 |
\newcommand*{\@venn@shade}{lightgray} |
| 60 |
\newcommand*{\@venn@label@OnlyA}{} |
| 61 |
\newcommand*{\@venn@label@OnlyB}{} |
| 62 |
\newcommand*{\@venn@label@OnlyC}{} |
| 63 |
\newcommand*{\@venn@label@OnlyAB}{} |
| 64 |
\newcommand*{\@venn@label@OnlyAC}{} |
| 65 |
\newcommand*{\@venn@label@OnlyBC}{} |
| 66 |
\newcommand*{\@venn@label@ABC}{} |
| 67 |
\newcommand*{\@venn@label@NotABC}{} |
| 68 |
\newcommand*{\@venn@label@NotAB}{} |
| 69 |
\newcommand*{\@venn@label@AB}{} |
| 70 |
\newcommand*{\@venn@radius}{1.2cm} |
| 71 |
\newcommand*{\@venn@hgap}{0.5cm} |
| 72 |
\newcommand*{\@venn@vgap}{0.5cm} |
| 73 |
\newcommand*{\@venn@overlap}{0.75cm} |
| 74 |
\newcommand*{\@venn@tikzoptions}{} |
| 75 |
\newlength\@venn@Ax |
| 76 |
\newlength\@venn@Ay |
| 77 |
\newlength\@venn@Bx |
| 78 |
\newlength\@venn@By |
| 79 |
\newlength\@venn@Cx |
| 80 |
\newlength\@venn@Cy |
| 81 |
\newlength\@venn@w |
| 82 |
\newlength\@venn@h |
| 83 |
\define@key{venn}{shade}{\def\@venn@shade{#1}} |
| 84 |
\define@key{venn}{labelA}{\def\@venn@label@A{#1}} |
| 85 |
\define@key{venn}{labelB}{\def\@venn@label@B{#1}} |
| 86 |
\define@key{venn}{labelC}{\def\@venn@label@C{#1}} |
| 87 |
\define@key{venn}{labelOnlyA}{\def\@venn@label@OnlyA{#1}} |
| 88 |
\define@key{venn}{labelOnlyB}{\def\@venn@label@OnlyB{#1}} |
| 89 |
\define@key{venn}{labelOnlyC}{\def\@venn@label@OnlyC{#1}} |
| 90 |
\define@key{venn}{labelOnlyAB}{\def\@venn@label@OnlyAB{#1}} |
| 91 |
\define@key{venn}{labelOnlyAC}{\def\@venn@label@OnlyAC{#1}} |
| 92 |
\define@key{venn}{labelOnlyBC}{\def\@venn@label@OnlyBC{#1}} |
| 93 |
\define@key{venn}{labelABC}{\def\@venn@label@ABC{#1}} |
| 94 |
\define@key{venn}{labelNotABC}{\def\@venn@label@NotABC{#1}} |
| 95 |
\define@key{venn}{labelAB}{\def\@venn@label@AB{#1}} |
| 96 |
\define@key{venn}{labelNotAB}{\def\@venn@label@NotAB{#1}} |
| 97 |
\define@key{venn}{radius}{\def\@venn@radius{#1}} |
| 98 |
\define@key{venn}{hgap}{\def\@venn@hgap{#1}} |
| 99 |
\define@key{venn}{vgap}{\def\@venn@vgap{#1}} |
| 100 |
\define@key{venn}{overlap}{\def\@venn@overlap{#1}} |
| 101 |
\define@boolkey{venn}[venn]{showframe}[true]{} |
| 102 |
\vennshowframetrue |
| 103 |
\define@key{venn}{tikzoptions}{\def\@venn@tikzoptions{#1}} |
| 104 |
\newcommand*{\@venn@computecircleintersects}[4]{% |
| 105 |
\ifdim#1=#3\relax |
| 106 |
\pgfmathsetlength{\@venn@intersect@i@y}{0.5*(#4+#2)}% |
| 107 |
\setlength{\@venn@intersect@ii@y}{\@venn@intersect@i@y}% |
| 108 |
\pgfmathsetlength{\dimen@i}{#4-#2}% |
| 109 |
\pgfmathsetlength{\dimen@}{\@venn@radius*\@[email protected]*\dimen@i*\dimen@i}% |
| 110 |
\setlength{\@venn@intersect@i@x}{#1}% |
| 111 |
\setlength{\@venn@intersect@ii@x}{#1}% |
| 112 |
\ifdim\dimen@=0pt\relax |
| 113 |
\def\@venn@intersect@n{1}% |
| 114 |
\else |
| 115 |
\ifdim\dimen@>0pt\relax |
| 116 |
\def\@venn@intersect@n{2}% |
| 117 |
\pgfmathsetlength{\dimen@i}{sqrt(\dimen@)}% |
| 118 |
\addtolength{\@venn@intersect@i@x}{\dimen@i}% |
| 119 |
\addtolength{\@venn@intersect@ii@x}{-\dimen@i}% |
| 120 |
\else |
| 121 |
\def\@venn@intersect@n{0}% |
| 122 |
\fi |
| 123 |
\fi |
| 124 |
\else |
| 125 |
\ifdim#2=#4\relax |
| 126 |
\pgfmathsetlength{\@venn@intersect@i@x}{0.5*(#3+#1)}% |
| 127 |
\setlength{\@venn@intersect@ii@x}{\@venn@intersect@i@x}% |
| 128 |
\setlength{\dimen@i}{#3}% |
| 129 |
\addtolength{\dimen@i}{-#1}% |
| 130 |
\pgfmathsetlength{\dimen@}{\@venn@radius*\@venn@radius |
| 131 |
-0.25*\dimen@i*\dimen@i}% |
| 132 |
\setlength{\@venn@intersect@i@y}{#2}% |
| 133 |
\setlength{\@venn@intersect@ii@y}{#2}% |
| 134 |
\ifdim\dimen@=0pt\relax |
| 135 |
\def\@venn@intersect@n{1}% |
| 136 |
\else |
| 137 |
\ifdim\dimen@>0pt\relax |
| 138 |
\def\@venn@intersect@n{2}% |
| 139 |
\pgfmathsetlength{\dimen@i}{sqrt(\dimen@)}% |
| 140 |
\addtolength{\@venn@intersect@i@y}{\dimen@i}% |
| 141 |
\addtolength{\@venn@intersect@ii@y}{-\dimen@i}% |
| 142 |
\else |
| 143 |
\def\@venn@intersect@n{0}% |
| 144 |
\fi |
| 145 |
\fi |
| 146 |
\else |
| 147 |
\pgfmathparse{#1/72.27}\let\@vnn@ax\pgfmathresult |
| 148 |
\pgfmathparse{#2/72.27}\let\@vnn@ay\pgfmathresult |
| 149 |
\pgfmathparse{#3/72.27}\let\@vnn@bx\pgfmathresult |
| 150 |
\pgfmathparse{#4/72.27}\let\@vnn@by\pgfmathresult |
| 151 |
\pgfmathparse{\@venn@radius/72.27}\let\@vnn@r\pgfmathresult |
| 152 |
\pgfmathparse{\@vnn@ax*\@vnn@ax}\let\@vnn@ax@sq\pgfmathresult |
| 153 |
\pgfmathparse{\@vnn@ay*\@vnn@ay}\let\@vnn@ay@sq\pgfmathresult |
| 154 |
\pgfmathparse{\@vnn@bx*\@vnn@bx}\let\@vnn@bx@sq\pgfmathresult |
| 155 |
\pgfmathparse{\@vnn@by*\@vnn@by}\let\@vnn@by@sq\pgfmathresult |
| 156 |
\pgfmathparse{\@vnn@r*\@vnn@r}\let\@vnn@r@sq\pgfmathresult |
| 157 |
\pgfmathparse{0.5*(\@vnn@bx@sq-\@vnn@ax@sq+\@vnn@by@sq-\@vnn@ay@sq) |
| 158 |
/(\@vnn@by-\@vnn@ay)}% |
| 159 |
\let\@vnn@c\pgfmathresult |
| 160 |
\pgfmathparse{(\@vnn@ax-\@vnn@bx)/(\@vnn@by-\@vnn@ay)}% |
| 161 |
\let\@vnn@m\pgfmathresult |
| 162 |
\pgfmathparse{1+\@vnn@m*\@vnn@m}% |
| 163 |
\let\@vnn@one@plus@m@sq\pgfmathresult |
| 164 |
\pgfmathparse{\@vnn@m*(\@vnn@c-\@vnn@ay)-\@vnn@ax}% |
| 165 |
\let\@vnn@b\pgfmathresult |
| 166 |
\pgfmathparse{\@vnn@b*\@vnn@b |
| 167 |
- \@vnn@one@plus@m@sq |
| 168 |
*(\@vnn@ax@sq+\@vnn@ay@sq+\@vnn@c*\@vnn@c |
| 169 |
-2*\@vnn@ay*\@vnn@c-\@vnn@r@sq)}% |
| 170 |
\let\@vnn@root\pgfmathresult |
| 171 |
\setlength\dimen@{\pgfmathresult in}% |
| 172 |
\ifdim\dimen@=0pt\relax |
| 173 |
\def\@venn@intersect@n{1}% |
| 174 |
\pgfmathparse{-\@vnn@b/\@vnn@one@plus@m@sq}% |
| 175 |
\setlength{\@venn@intersect@i@x}{\pgfmathresult in}% |
| 176 |
\setlength{\@venn@intersect@ii@x}{\@venn@intersect@i@x}% |
| 177 |
\pgfmathparse{\pgfmathresult*\@vnn@m+c}% |
| 178 |
\setlength{\@venn@intersect@i@y}{\pgfmathresult in}% |
| 179 |
\setlength{\@venn@intersect@ii@y}{\@venn@intesect@i@y}% |
| 180 |
\else |
| 181 |
\ifdim\dimen@>0pt\relax |
| 182 |
\def\@venn@intersect@n{2}% |
| 183 |
\pgfmathsqrt{\@vnn@root}% |
| 184 |
\let\@vnn@root\pgfmathresult |
| 185 |
\pgfmathparse{(-\@vnn@b+\@vnn@root)/\@vnn@one@plus@m@sq}% |
| 186 |
\setlength{\@venn@intersect@i@x}{\pgfmathresult in}% |
| 187 |
\pgfmathparse{\pgfmathresult*\@vnn@m+\@vnn@c}% |
| 188 |
\setlength{\@venn@intersect@i@y}{\pgfmathresult in}% |
| 189 |
\pgfmathparse{(-\@vnn@b-\@vnn@root)/\@vnn@one@plus@m@sq}% |
| 190 |
\setlength{\@venn@intersect@ii@x}{\pgfmathresult in}% |
| 191 |
\pgfmathparse{\pgfmathresult*\@vnn@m+\@vnn@c}% |
| 192 |
\setlength{\@venn@intersect@ii@y}{\pgfmathresult in}% |
| 193 |
\else |
| 194 |
\def\@venn@intersect@n{0}% |
| 195 |
\fi |
| 196 |
\fi |
| 197 |
\fi |
| 198 |
\fi |
| 199 |
} |
| 200 |
\newlength\@venn@intersect@i@x |
| 201 |
\newlength\@venn@intersect@i@y |
| 202 |
\newlength\@venn@intersect@ii@x |
| 203 |
\newlength\@venn@intersect@ii@y |
| 204 |
\newenvironment{venndiagram3sets}[1][]% |
| 205 |
{% |
| 206 |
\disable@keys{venn}{labelAB,labelNotAB}% |
| 207 |
\setkeys{venn}{#1}% |
| 208 |
\pgfmathsetlength{\@venn@Cx}{\@venn@hgap + 2*\@venn@radius |
| 209 |
-0.5*\@venn@overlap}% |
| 210 |
\pgfmathsetlength{\@venn@Cy}{\@venn@vgap+\@venn@radius}% |
| 211 |
\pgfmathsetlength{\@venn@Ax}{\@venn@hgap+\@venn@radius}% |
| 212 |
\pgfmathsetlength{\@venn@Ay}{\@venn@Cy |
| 213 |
+ (\@venn@radius - 0.5*\@venn@overlap)*1.73205}% |
| 214 |
\pgfmathsetlength{\@venn@Bx}{\@venn@hgap+3*\@venn@radius |
| 215 |
-\@venn@overlap}% |
| 216 |
\setlength{\@venn@By}{\@venn@Ay}% |
| 217 |
\pgfmathsetlength{\@venn@w}{2*\@venn@hgap+4*\@venn@radius |
| 218 |
-\@venn@overlap}% |
| 219 |
\pgfmathsetlength{\@venn@h}{2*\@venn@vgap+4*\@venn@radius |
| 220 |
-\@venn@overlap}% |
| 221 |
\def\fillA{\path[fill=\@venn@shade] (\@venn@Ax,\@venn@Ay) |
| 222 |
circle (\@venn@radius);}% |
| 223 |
\def\fillB{\path[fill=\@venn@shade] (\@venn@Bx,\@venn@By) |
| 224 |
circle (\@venn@radius);}% |
| 225 |
\def\fillC{\path[fill=\@venn@shade] (\@venn@Cx,\@venn@Cy) |
| 226 |
circle (\@venn@radius);}% |
| 227 |
\def\fillAll{\path[fill=\@venn@shade] (0,0) |
| 228 |
rectangle (\@venn@w,\@venn@h);}% |
| 229 |
\def\fillNotA{\path[fill=\@venn@shade,even odd rule] |
| 230 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 231 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius);}% |
| 232 |
\def\fillNotB{\path[fill=\@venn@shade,even odd rule] |
| 233 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 234 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius);}% |
| 235 |
\def\fillNotC{\path[fill=\@venn@shade,even odd rule] |
| 236 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 237 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius);}% |
| 238 |
\let\fillOnlyA\@venn@fillOnlyA@threesets |
| 239 |
\let\fillOnlyB\@venn@fillOnlyB@threesets |
| 240 |
\let\fillOnlyC\@venn@fillOnlyC@threesets |
| 241 |
\let\fillNotABC\@venn@fillNotABC@threesets |
| 242 |
\def\fillANotB{% |
| 243 |
\begin{scope} |
| 244 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 245 |
\path[fill=\@venn@shade,even odd rule] |
| 246 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius) |
| 247 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 248 |
\end{scope} |
| 249 |
}% |
| 250 |
\def\fillBNotA{% |
| 251 |
\begin{scope} |
| 252 |
\clip (\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 253 |
\path[fill=\@venn@shade,even odd rule] |
| 254 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius) |
| 255 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 256 |
\end{scope} |
| 257 |
}% |
| 258 |
\def\fillANotC{% |
| 259 |
\begin{scope} |
| 260 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 261 |
\path[fill=\@venn@shade,even odd rule] |
| 262 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius) |
| 263 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 264 |
\end{scope} |
| 265 |
}% |
| 266 |
\def\fillCNotA{% |
| 267 |
\begin{scope} |
| 268 |
\clip (\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 269 |
\path[fill=\@venn@shade,even odd rule] |
| 270 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius) |
| 271 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 272 |
\end{scope} |
| 273 |
}% |
| 274 |
\def\fillBNotC{% |
| 275 |
\begin{scope} |
| 276 |
\clip (\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 277 |
\path[fill=\@venn@shade,even odd rule] |
| 278 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius) |
| 279 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 280 |
\end{scope} |
| 281 |
}% |
| 282 |
\def\fillCNotB{% |
| 283 |
\begin{scope} |
| 284 |
\clip (\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 285 |
\path[fill=\@venn@shade,even odd rule] |
| 286 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius) |
| 287 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 288 |
\end{scope} |
| 289 |
}% |
| 290 |
\def\fillACapB{% |
| 291 |
\begin{scope} |
| 292 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 293 |
\path[fill=\@venn@shade] |
| 294 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 295 |
\end{scope} |
| 296 |
}% |
| 297 |
\let\fillBCapA\fillACapB |
| 298 |
\def\fillACapC{% |
| 299 |
\begin{scope} |
| 300 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 301 |
\path[fill=\@venn@shade] |
| 302 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 303 |
\end{scope} |
| 304 |
}% |
| 305 |
\let\fillCCapA\fillACapC |
| 306 |
\def\fillBCapC{% |
| 307 |
\begin{scope} |
| 308 |
\clip (\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 309 |
\path[fill=\@venn@shade] |
| 310 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 311 |
\end{scope} |
| 312 |
}% |
| 313 |
\let\fillCCapB\fillBCapC |
| 314 |
\def\fillACapBNotC{% |
| 315 |
\begin{scope} |
| 316 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 317 |
\clip (\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 318 |
\path[fill=\@venn@shade,even odd rule] |
| 319 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius) |
| 320 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 321 |
\end{scope} |
| 322 |
}% |
| 323 |
\let\fillBCapANotC\fillACapBNotC |
| 324 |
\def\fillACapCNotB{% |
| 325 |
\begin{scope} |
| 326 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 327 |
\clip (\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 328 |
\path[fill=\@venn@shade,even odd rule] |
| 329 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius) |
| 330 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 331 |
\end{scope} |
| 332 |
}% |
| 333 |
\let\fillCCapANotB\fillACapCNotB |
| 334 |
\def\fillBCapCNotA{% |
| 335 |
\begin{scope} |
| 336 |
\clip (\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 337 |
\clip (\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 338 |
\path[fill=\@venn@shade,even odd rule] |
| 339 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius) |
| 340 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 341 |
\end{scope} |
| 342 |
}% |
| 343 |
\let\fillCCapBNotA\fillBCapCNotA |
| 344 |
\def\fillACapBCapC{% |
| 345 |
\begin{scope} |
| 346 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 347 |
\clip (\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 348 |
\path[fill=\@venn@shade] |
| 349 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 350 |
\end{scope} |
| 351 |
}% |
| 352 |
\let\fillACapCCapB\fillACapBCapC |
| 353 |
\let\fillBCapACapC\fillACapBCapC |
| 354 |
\let\fillBCapCCapA\fillACapBCapC |
| 355 |
\let\fillCCapACapB\fillACapBCapC |
| 356 |
\let\fillCCapBCapA\fillACapBCapC |
| 357 |
\ifdefempty{\@venn@tikzoptions}% |
| 358 |
{% |
| 359 |
\def\@venn@dobegin{\begin{tikzpicture}}% |
| 360 |
}% |
| 361 |
{% |
| 362 |
\edef\@venn@dobegin{\noexpand\begin{tikzpicture}% |
| 363 |
[\expandonce\@venn@tikzoptions]}% |
| 364 |
}% |
| 365 |
\@venn@dobegin |
| 366 |
\path (0,0) coordinate (venn bottom left) |
| 367 |
(0,\@venn@h) coordinate (venn top left) |
| 368 |
(\@venn@w,\@venn@h) coordinate (venn top right) |
| 369 |
(\@venn@w,0) coordinate (venn bottom right); |
| 370 |
}% |
| 371 |
{% |
| 372 |
\ifvennshowframe |
| 373 |
\draw (0,0) rectangle (\@venn@w,\@venn@h); |
| 374 |
\else |
| 375 |
\path (0,0) rectangle (\@venn@w,\@venn@h); |
| 376 |
\fi |
| 377 |
\draw (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 378 |
\draw (\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 379 |
\draw (\@venn@Cx,\@venn@Cy) circle (\@venn@radius); |
| 380 |
\draw (\@venn@Ax,\@venn@Ay) node[above,left] (labelOnlyA) {\@venn@label@OnlyA}; |
| 381 |
\draw (\@venn@Bx,\@venn@By) node[above,right] (labelOnlyB) {\@venn@label@OnlyB}; |
| 382 |
\draw (\@venn@Cx,\@venn@Cy) node[below] (labelOnlyC) {\@venn@label@OnlyC}; |
| 383 |
\draw (\@venn@vgap,\@venn@hgap) node (labelNotABC) {\@venn@label@NotABC}; |
| 384 |
\draw (\@venn@Ax,\@venn@Ay+\@venn@radius) |
| 385 |
node[below] (labelA) {\@venn@label@A}; |
| 386 |
\draw (\@venn@Bx,\@venn@By+\@venn@radius) |
| 387 |
node[below] (labelB) {\@venn@label@B}; |
| 388 |
\draw (\@venn@Cx,\@venn@vgap) node[above] (labelC) {\@venn@label@C}; |
| 389 |
\draw (\@venn@Cx,0.5*\@venn@h) node (labelABC) {\@venn@label@ABC}; |
| 390 |
\draw (\@venn@Cx,\@venn@Ay) node[above] (labelOnlyAB) {\@venn@label@OnlyAB}; |
| 391 |
\draw (\@venn@Ax,\@venn@Ay) ++(-60:\@[email protected]*\@venn@overlap) |
| 392 |
node[below left] (labelOnlyAC) {\@venn@label@OnlyAC}; |
| 393 |
\draw (\@venn@Bx,\@venn@By) ++(-120:\@[email protected]*\@venn@overlap) |
| 394 |
node[below right] (labelOnlyBC) {\@venn@label@OnlyBC}; |
| 395 |
\@postvennhook |
| 396 |
\end{tikzpicture} |
| 397 |
} |
| 398 |
\newcommand*{\@postvennhook}{} |
| 399 |
\newcommand*{\setpostvennhook}[1]{\def\@postvennhook{#1}} |
| 400 |
\newcommand*\@venn@fillOnlyA@threesets{% |
| 401 |
\@venn@computecircleintersects{\@venn@Ax}{\@venn@Ay}{\@venn@Bx}{\@venn@By}% |
| 402 |
\ifnum\@venn@intersect@n=2\relax |
| 403 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@i@x}% |
| 404 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@i@y}% |
| 405 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 406 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@ii@x}% |
| 407 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@ii@y}% |
| 408 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 409 |
\ifdim\dimen@>\dimen@i |
| 410 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Ax}% |
| 411 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Ay}% |
| 412 |
\edef\@venn@start@pt@x{\the\@venn@intersect@i@x}% |
| 413 |
\edef\@venn@start@pt@y{\the\@venn@intersect@i@y}% |
| 414 |
\else |
| 415 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Ax}% |
| 416 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Ay}% |
| 417 |
\edef\@venn@start@pt@x{\the\@venn@intersect@ii@x}% |
| 418 |
\edef\@venn@start@pt@y{\the\@venn@intersect@ii@y}% |
| 419 |
\fi |
| 420 |
\ifvennoldpgf |
| 421 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 422 |
\else |
| 423 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 424 |
\fi |
| 425 |
\let\@venn@start@i@angle\pgfmathresult |
| 426 |
\@venn@computecircleintersects{\@venn@Ax}{\@venn@Ay}{\@venn@Cx}{\@venn@Cy}% |
| 427 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@i@x}% |
| 428 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@i@y}% |
| 429 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 430 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@ii@x}% |
| 431 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@ii@y}% |
| 432 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 433 |
\ifdim\dimen@>\dimen@i |
| 434 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Ax}% |
| 435 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Ay}% |
| 436 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@i@x}% |
| 437 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@i@y}% |
| 438 |
\else |
| 439 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Ax}% |
| 440 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Ay}% |
| 441 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@ii@x}% |
| 442 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@ii@y}% |
| 443 |
\fi |
| 444 |
\ifvennoldpgf |
| 445 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 446 |
\else |
| 447 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 448 |
\fi |
| 449 |
\let\@venn@end@i@angle\pgfmathresult |
| 450 |
\pgfmathadd{\@venn@end@i@angle}{360}% |
| 451 |
\let\@venn@end@i@angle\pgfmathresult |
| 452 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@i@x-\@venn@Cx}% |
| 453 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@i@y-\@venn@Cy}% |
| 454 |
\ifvennoldpgf |
| 455 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 456 |
\else |
| 457 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 458 |
\fi |
| 459 |
\let\@venn@start@ii@angle\pgfmathresult |
| 460 |
\@venn@computecircleintersects{\@venn@Bx}{\@venn@By}{\@venn@Cx}{\@venn@Cy}% |
| 461 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@i@x}% |
| 462 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@i@y}% |
| 463 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 464 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@ii@x}% |
| 465 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@ii@y}% |
| 466 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 467 |
\ifdim\dimen@<\dimen@i |
| 468 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Cx}% |
| 469 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Cy}% |
| 470 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@i@x}% |
| 471 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@i@y}% |
| 472 |
\else |
| 473 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Cx}% |
| 474 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Cy}% |
| 475 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@ii@x}% |
| 476 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@ii@y}% |
| 477 |
\fi |
| 478 |
\ifvennoldpgf |
| 479 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 480 |
\else |
| 481 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 482 |
\fi |
| 483 |
\let\@venn@end@ii@angle\pgfmathresult |
| 484 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@ii@x-\@venn@Bx}% |
| 485 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@ii@y-\@venn@By}% |
| 486 |
\ifvennoldpgf |
| 487 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 488 |
\else |
| 489 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 490 |
\fi |
| 491 |
\let\@venn@start@iii@angle\pgfmathresult |
| 492 |
\pgfmathsetlength{\dimen@i}{\@venn@start@pt@x-\@venn@Bx}% |
| 493 |
\pgfmathsetlength{\dimen@ii}{\@venn@start@pt@y-\@venn@By}% |
| 494 |
\ifvennoldpgf |
| 495 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 496 |
\else |
| 497 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 498 |
\fi |
| 499 |
\let\@venn@end@iii@angle\pgfmathresult |
| 500 |
\pgfmathsubtract{\@venn@end@iii@angle}{360}% |
| 501 |
\let\@venn@end@iii@angle\pgfmathresult |
| 502 |
\path[fill=\@venn@shade] (\@venn@start@pt@x,\@venn@start@pt@y) |
| 503 |
arc[radius=\@venn@radius,start angle=\@venn@start@i@angle, |
| 504 |
end angle=\@venn@end@i@angle] |
| 505 |
arc[radius=\@venn@radius,start angle=\@venn@start@ii@angle, |
| 506 |
end angle=\@venn@end@ii@angle] |
| 507 |
arc[radius=\@venn@radius,start angle=\@venn@start@iii@angle, |
| 508 |
end angle=\@venn@end@iii@angle] -- cycle; |
| 509 |
\else |
| 510 |
\fillOnlyA |
| 511 |
\fi |
| 512 |
}% |
| 513 |
\newcommand*\@venn@fillOnlyB@threesets{% |
| 514 |
\@venn@computecircleintersects{\@venn@Bx}{\@venn@By}{\@venn@Ax}{\@venn@Ay}% |
| 515 |
\ifnum\@venn@intersect@n=2\relax |
| 516 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@i@x}% |
| 517 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@i@y}% |
| 518 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 519 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@ii@x}% |
| 520 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@ii@y}% |
| 521 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 522 |
\ifdim\dimen@>\dimen@i |
| 523 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Bx}% |
| 524 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@By}% |
| 525 |
\edef\@venn@start@pt@x{\the\@venn@intersect@i@x}% |
| 526 |
\edef\@venn@start@pt@y{\the\@venn@intersect@i@y}% |
| 527 |
\else |
| 528 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Bx}% |
| 529 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@By}% |
| 530 |
\edef\@venn@start@pt@x{\the\@venn@intersect@ii@x}% |
| 531 |
\edef\@venn@start@pt@y{\the\@venn@intersect@ii@y}% |
| 532 |
\fi |
| 533 |
\ifvennoldpgf |
| 534 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 535 |
\else |
| 536 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 537 |
\fi |
| 538 |
\let\@venn@start@i@angle\pgfmathresult |
| 539 |
\@venn@computecircleintersects{\@venn@Bx}{\@venn@By}{\@venn@Cx}{\@venn@Cy}% |
| 540 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@i@x}% |
| 541 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@i@y}% |
| 542 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 543 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@ii@x}% |
| 544 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@ii@y}% |
| 545 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 546 |
\ifdim\dimen@>\dimen@i |
| 547 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Bx}% |
| 548 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@By}% |
| 549 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@i@x}% |
| 550 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@i@y}% |
| 551 |
\else |
| 552 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Bx}% |
| 553 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@By}% |
| 554 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@ii@x}% |
| 555 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@ii@y}% |
| 556 |
\fi |
| 557 |
\ifvennoldpgf |
| 558 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 559 |
\else |
| 560 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 561 |
\fi |
| 562 |
\let\@venn@end@i@angle\pgfmathresult |
| 563 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@i@x-\@venn@Cx}% |
| 564 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@i@y-\@venn@Cy}% |
| 565 |
\ifvennoldpgf |
| 566 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 567 |
\else |
| 568 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 569 |
\fi |
| 570 |
\let\@venn@start@ii@angle\pgfmathresult |
| 571 |
\@venn@computecircleintersects{\@venn@Ax}{\@venn@Ay}{\@venn@Cx}{\@venn@Cy}% |
| 572 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@i@x}% |
| 573 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@i@y}% |
| 574 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 575 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@ii@x}% |
| 576 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@ii@y}% |
| 577 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 578 |
\ifdim\dimen@<\dimen@i |
| 579 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Cx}% |
| 580 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Cy}% |
| 581 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@i@x}% |
| 582 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@i@y}% |
| 583 |
\else |
| 584 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Cx}% |
| 585 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Cy}% |
| 586 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@ii@x}% |
| 587 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@ii@y}% |
| 588 |
\fi |
| 589 |
\ifvennoldpgf |
| 590 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 591 |
\else |
| 592 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 593 |
\fi |
| 594 |
\let\@venn@end@ii@angle\pgfmathresult |
| 595 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@ii@x-\@venn@Ax}% |
| 596 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@ii@y-\@venn@Ay}% |
| 597 |
\ifvennoldpgf |
| 598 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 599 |
\else |
| 600 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 601 |
\fi |
| 602 |
\let\@venn@start@iii@angle\pgfmathresult |
| 603 |
\pgfmathsetlength{\dimen@i}{\@venn@start@pt@x-\@venn@Ax}% |
| 604 |
\pgfmathsetlength{\dimen@ii}{\@venn@start@pt@y-\@venn@Ay}% |
| 605 |
\ifvennoldpgf |
| 606 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 607 |
\else |
| 608 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 609 |
\fi |
| 610 |
\let\@venn@end@iii@angle\pgfmathresult |
| 611 |
\path[fill=\@venn@shade] |
| 612 |
(\@venn@start@pt@x,\@venn@start@pt@y) |
| 613 |
arc[radius=\@venn@radius,start angle=\@venn@start@i@angle, |
| 614 |
end angle=\@venn@end@i@angle] |
| 615 |
arc[radius=\@venn@radius,start angle=\@venn@start@ii@angle, |
| 616 |
end angle=\@venn@end@ii@angle] |
| 617 |
arc[radius=\@venn@radius,start angle=\@venn@start@iii@angle, |
| 618 |
end angle=\@venn@end@iii@angle] -- cycle; |
| 619 |
\else |
| 620 |
\fillOnlyB |
| 621 |
\fi |
| 622 |
}% |
| 623 |
\newcommand*\@venn@fillOnlyC@threesets{% |
| 624 |
\@venn@computecircleintersects{\@venn@Cx}{\@venn@Cy}{\@venn@Bx}{\@venn@By}% |
| 625 |
\ifnum\@venn@intersect@n=2\relax |
| 626 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@i@x}% |
| 627 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@i@y}% |
| 628 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 629 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@ii@x}% |
| 630 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@ii@y}% |
| 631 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 632 |
\ifdim\dimen@>\dimen@i |
| 633 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Cx}% |
| 634 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Cy}% |
| 635 |
\edef\@venn@start@pt@x{\the\@venn@intersect@i@x}% |
| 636 |
\edef\@venn@start@pt@y{\the\@venn@intersect@i@y}% |
| 637 |
\else |
| 638 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Cx}% |
| 639 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Cy}% |
| 640 |
\edef\@venn@start@pt@x{\the\@venn@intersect@ii@x}% |
| 641 |
\edef\@venn@start@pt@y{\the\@venn@intersect@ii@y}% |
| 642 |
\fi |
| 643 |
\ifvennoldpgf |
| 644 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 645 |
\else |
| 646 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 647 |
\fi |
| 648 |
\let\@venn@start@i@angle\pgfmathresult |
| 649 |
\@venn@computecircleintersects{\@venn@Cx}{\@venn@Cy}{\@venn@Ax}{\@venn@Ay}% |
| 650 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@i@x}% |
| 651 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@i@y}% |
| 652 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 653 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@ii@x}% |
| 654 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@ii@y}% |
| 655 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 656 |
\ifdim\dimen@>\dimen@i |
| 657 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Cx}% |
| 658 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Cy}% |
| 659 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@i@x}% |
| 660 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@i@y}% |
| 661 |
\else |
| 662 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Cx}% |
| 663 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Cy}% |
| 664 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@ii@x}% |
| 665 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@ii@y}% |
| 666 |
\fi |
| 667 |
\ifvennoldpgf |
| 668 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 669 |
\else |
| 670 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 671 |
\fi |
| 672 |
\let\@venn@end@i@angle\pgfmathresult |
| 673 |
\pgfmathsubtract{\@venn@end@i@angle}{360}% |
| 674 |
\let\@venn@end@i@angle\pgfmathresult |
| 675 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@i@x-\@venn@Ax}% |
| 676 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@i@y-\@venn@Ay}% |
| 677 |
\ifvennoldpgf |
| 678 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 679 |
\else |
| 680 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 681 |
\fi |
| 682 |
\let\@venn@start@ii@angle\pgfmathresult |
| 683 |
\@venn@computecircleintersects{\@venn@Bx}{\@venn@By}{\@venn@Ax}{\@venn@Ay}% |
| 684 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@i@x}% |
| 685 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@i@y}% |
| 686 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 687 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@ii@x}% |
| 688 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@ii@y}% |
| 689 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 690 |
\ifdim\dimen@<\dimen@i |
| 691 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Ax}% |
| 692 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Ay}% |
| 693 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@i@x}% |
| 694 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@i@y}% |
| 695 |
\else |
| 696 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Ax}% |
| 697 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Ay}% |
| 698 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@ii@x}% |
| 699 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@ii@y}% |
| 700 |
\fi |
| 701 |
\ifvennoldpgf |
| 702 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 703 |
\else |
| 704 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 705 |
\fi |
| 706 |
\let\@venn@end@ii@angle\pgfmathresult |
| 707 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@ii@x-\@venn@Bx}% |
| 708 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@ii@y-\@venn@By}% |
| 709 |
\ifvennoldpgf |
| 710 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 711 |
\else |
| 712 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 713 |
\fi |
| 714 |
\let\@venn@start@iii@angle\pgfmathresult |
| 715 |
\pgfmathsetlength{\dimen@i}{\@venn@start@pt@x-\@venn@Bx}% |
| 716 |
\pgfmathsetlength{\dimen@ii}{\@venn@start@pt@y-\@venn@By}% |
| 717 |
\ifvennoldpgf |
| 718 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 719 |
\else |
| 720 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 721 |
\fi |
| 722 |
\let\@venn@end@iii@angle\pgfmathresult |
| 723 |
\path[fill=\@venn@shade] (\@venn@start@pt@x,\@venn@start@pt@y) |
| 724 |
arc[radius=\@venn@radius,start angle=\@venn@start@i@angle, |
| 725 |
end angle=\@venn@end@i@angle] |
| 726 |
arc[radius=\@venn@radius,start angle=\@venn@start@ii@angle, |
| 727 |
end angle=\@venn@end@ii@angle] |
| 728 |
arc[radius=\@venn@radius,start angle=\@venn@start@iii@angle, |
| 729 |
end angle=\@venn@end@iii@angle] -- cycle; |
| 730 |
\else |
| 731 |
\fillOnlyC |
| 732 |
\fi |
| 733 |
}% |
| 734 |
\newcommand*\@venn@fillNotABC@threesets{% |
| 735 |
\@venn@computecircleintersects{\@venn@Ax}{\@venn@Ay}{\@venn@Bx}{\@venn@By}% |
| 736 |
\ifnum\@venn@intersect@n=2\relax |
| 737 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@i@x}% |
| 738 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@i@y}% |
| 739 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 740 |
\pgfmathsetlength{\dimen@i}{\@venn@Cx-\@venn@intersect@ii@x}% |
| 741 |
\pgfmathsetlength{\dimen@ii}{\@venn@Cy-\@venn@intersect@ii@y}% |
| 742 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 743 |
\ifdim\dimen@>\dimen@i |
| 744 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Ax}% |
| 745 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Ay}% |
| 746 |
\edef\@venn@start@pt@x{\the\@venn@intersect@i@x}% |
| 747 |
\edef\@venn@start@pt@y{\the\@venn@intersect@i@y}% |
| 748 |
\else |
| 749 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Ax}% |
| 750 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Ay}% |
| 751 |
\edef\@venn@start@pt@x{\the\@venn@intersect@ii@x}% |
| 752 |
\edef\@venn@start@pt@y{\the\@venn@intersect@ii@y}% |
| 753 |
\fi |
| 754 |
\ifvennoldpgf |
| 755 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 756 |
\else |
| 757 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 758 |
\fi |
| 759 |
\let\@venn@start@i@angle\pgfmathresult |
| 760 |
\@venn@computecircleintersects{\@venn@Ax}{\@venn@Ay}{\@venn@Cx}{\@venn@Cy}% |
| 761 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@i@x}% |
| 762 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@i@y}% |
| 763 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 764 |
\pgfmathsetlength{\dimen@i}{\@venn@Bx-\@venn@intersect@ii@x}% |
| 765 |
\pgfmathsetlength{\dimen@ii}{\@venn@By-\@venn@intersect@ii@y}% |
| 766 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 767 |
\ifdim\dimen@>\dimen@i |
| 768 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Ax}% |
| 769 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Ay}% |
| 770 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@i@x}% |
| 771 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@i@y}% |
| 772 |
\else |
| 773 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Ax}% |
| 774 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Ay}% |
| 775 |
\edef\@venn@end@pt@i@x{\the\@venn@intersect@ii@x}% |
| 776 |
\edef\@venn@end@pt@i@y{\the\@venn@intersect@ii@y}% |
| 777 |
\fi |
| 778 |
\ifvennoldpgf |
| 779 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 780 |
\else |
| 781 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 782 |
\fi |
| 783 |
\let\@venn@end@i@angle\pgfmathresult |
| 784 |
\pgfmathadd{\@venn@end@i@angle}{360}% |
| 785 |
\let\@venn@end@i@angle\pgfmathresult |
| 786 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@i@x-\@venn@Cx}% |
| 787 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@i@y-\@venn@Cy}% |
| 788 |
\ifvennoldpgf |
| 789 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 790 |
\else |
| 791 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 792 |
\fi |
| 793 |
\let\@venn@start@ii@angle\pgfmathresult |
| 794 |
\@venn@computecircleintersects{\@venn@Cx}{\@venn@Cy}{\@venn@Bx}{\@venn@By}% |
| 795 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@i@x}% |
| 796 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@i@y}% |
| 797 |
\pgfmathsetlength{\dimen@}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 798 |
\pgfmathsetlength{\dimen@i}{\@venn@Ax-\@venn@intersect@ii@x}% |
| 799 |
\pgfmathsetlength{\dimen@ii}{\@venn@Ay-\@venn@intersect@ii@y}% |
| 800 |
\pgfmathsetlength{\dimen@i}{\dimen@i*\dimen@i+\dimen@ii*\dimen@ii}% |
| 801 |
\ifdim\dimen@>\dimen@i |
| 802 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Cx}% |
| 803 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Cy}% |
| 804 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@i@x}% |
| 805 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@i@y}% |
| 806 |
\else |
| 807 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Cx}% |
| 808 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Cy}% |
| 809 |
\edef\@venn@end@pt@ii@x{\the\@venn@intersect@ii@x}% |
| 810 |
\edef\@venn@end@pt@ii@y{\the\@venn@intersect@ii@y}% |
| 811 |
\fi |
| 812 |
\ifvennoldpgf |
| 813 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 814 |
\else |
| 815 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 816 |
\fi |
| 817 |
\let\@venn@end@ii@angle\pgfmathresult |
| 818 |
\pgfmathadd{\@venn@end@ii@angle}{360}% |
| 819 |
\let\@venn@end@ii@angle\pgfmathresult |
| 820 |
\pgfmathsetlength{\dimen@i}{\@venn@end@pt@ii@x-\@venn@Bx}% |
| 821 |
\pgfmathsetlength{\dimen@ii}{\@venn@end@pt@ii@y-\@venn@By}% |
| 822 |
\ifvennoldpgf |
| 823 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 824 |
\else |
| 825 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 826 |
\fi |
| 827 |
\let\@venn@start@iii@angle\pgfmathresult |
| 828 |
\pgfmathsetlength{\dimen@i}{\@venn@start@pt@x-\@venn@Bx}% |
| 829 |
\pgfmathsetlength{\dimen@ii}{\@venn@start@pt@y-\@venn@By}% |
| 830 |
\ifvennoldpgf |
| 831 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 832 |
\else |
| 833 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 834 |
\fi |
| 835 |
\let\@venn@end@iii@angle\pgfmathresult |
| 836 |
\path[fill=\@venn@shade,even odd rule] |
| 837 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 838 |
(\@venn@start@pt@x,\@venn@start@pt@y) |
| 839 |
arc[radius=\@venn@radius,start angle=\@venn@start@i@angle, |
| 840 |
end angle=\@venn@end@i@angle] |
| 841 |
arc[radius=\@venn@radius,start angle=\@venn@start@ii@angle, |
| 842 |
end angle=\@venn@end@ii@angle] |
| 843 |
arc[radius=\@venn@radius,start angle=\@venn@start@iii@angle, |
| 844 |
end angle=\@venn@end@iii@angle] |
| 845 |
-- cycle; |
| 846 |
\else |
| 847 |
\path[fill=\@venn@shade,even odd rule] |
| 848 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 849 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius) |
| 850 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius) |
| 851 |
(\@venn@Cx,\@venn@Cy) circle (\@venn@radius);% |
| 852 |
\fi |
| 853 |
}% |
| 854 |
\newenvironment{venndiagram2sets}[1][]% |
| 855 |
{% |
| 856 |
\disable@keys{venn}{labelABC,labelOnlyC,labelOnlyAC,labelOnlyBC,% |
| 857 |
labelNotABC,labelC,labelOnlyAB}% |
| 858 |
\setkeys{venn}{#1}% |
| 859 |
% Calculate centre of A |
| 860 |
\pgfmathsetlength{\@venn@Ax}{\@venn@hgap+\@venn@radius}% |
| 861 |
\pgfmathsetlength{\@venn@Ay}{\@venn@vgap+\@venn@radius}% |
| 862 |
\pgfmathsetlength{\@venn@Bx}{\@venn@hgap+3*\@venn@radius |
| 863 |
-\@venn@overlap}% |
| 864 |
\setlength{\@venn@By}{\@venn@Ay}% |
| 865 |
\pgfmathsetlength{\@venn@w}{2*\@venn@hgap+4*\@venn@radius |
| 866 |
-\@venn@overlap}% |
| 867 |
\pgfmathsetlength{\@venn@h}{2*\@venn@vgap+2*\@venn@radius}% |
| 868 |
\def\fillA{\path[fill=\@venn@shade] (\@venn@Ax,\@venn@Ay) |
| 869 |
circle (\@venn@radius);}% |
| 870 |
\def\fillB{\path[fill=\@venn@shade] (\@venn@Bx,\@venn@By) |
| 871 |
circle (\@venn@radius);}% |
| 872 |
\def\fillAll{\path[fill=\@venn@shade] (0,0) |
| 873 |
rectangle (\@venn@w,\@venn@h);}% |
| 874 |
\let\fillOnlyA\@venn@fillOnlyA@twosets |
| 875 |
\let\fillOnlyB\@venn@fillOnlyB@twosets |
| 876 |
\def\fillNotA{\path[fill=\@venn@shade,even odd rule] |
| 877 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 878 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius);}% |
| 879 |
\def\fillNotB{\path[fill=\@venn@shade,even odd rule] |
| 880 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 881 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius);}% |
| 882 |
\def\fillNotAorB{% |
| 883 |
\begin{scope} |
| 884 |
\path[clip] |
| 885 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 886 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius) |
| 887 |
; |
| 888 |
\path[fill=\@venn@shade,even odd rule] |
| 889 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 890 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius) |
| 891 |
; |
| 892 |
\end{scope} |
| 893 |
}% |
| 894 |
\def\fillNotAorNotB{% |
| 895 |
\path[fill=\@venn@shade,nonzero rule] |
| 896 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 897 |
(\@venn@Ax,\@venn@Ay) circle (\@venn@radius) |
| 898 |
(0,0) rectangle (\@venn@w,\@venn@h) |
| 899 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius) |
| 900 |
; |
| 901 |
}% |
| 902 |
\let\fillANotB\fillOnlyA |
| 903 |
\let\fillBNotA\fillOnlyB |
| 904 |
\def\fillACapB{% |
| 905 |
\begin{scope} |
| 906 |
\clip (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 907 |
\path[fill=\@venn@shade] |
| 908 |
(\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 909 |
\end{scope} |
| 910 |
}% |
| 911 |
\let\fillBCapA\fillACapB |
| 912 |
\ifdefempty{\@venn@tikzoptions}% |
| 913 |
{% |
| 914 |
\def\@venn@dobegin{\begin{tikzpicture}}% |
| 915 |
}% |
| 916 |
{% |
| 917 |
\edef\@venn@dobegin{\noexpand\begin{tikzpicture}% |
| 918 |
[\expandonce\@venn@tikzoptions]}% |
| 919 |
}% |
| 920 |
\@venn@dobegin |
| 921 |
\path (0,0) coordinate (venn bottom left) |
| 922 |
(0,\@venn@h) coordinate (venn top left) |
| 923 |
(\@venn@w,\@venn@h) coordinate (venn top right) |
| 924 |
(\@venn@w,0) coordinate (venn bottom right); |
| 925 |
}% |
| 926 |
{% |
| 927 |
\ifvennshowframe |
| 928 |
\draw (venn bottom left) rectangle (\@venn@w,\@venn@h); |
| 929 |
\else |
| 930 |
\path (venn bottom left) rectangle (\@venn@w,\@venn@h); |
| 931 |
\fi |
| 932 |
\draw (\@venn@Ax,\@venn@Ay) circle (\@venn@radius); |
| 933 |
\draw (\@venn@Bx,\@venn@By) circle (\@venn@radius); |
| 934 |
\draw (\@venn@Ax,\@venn@Ay) node[above,left] (labelOnlyA) |
| 935 |
{\@venn@label@OnlyA}; |
| 936 |
\draw (\@venn@Bx,\@venn@By) node[above,right] (labelOnlyB) |
| 937 |
{\@venn@label@OnlyB}; |
| 938 |
\draw (\@venn@vgap,\@venn@hgap) node (labelNotAB) {\@venn@label@NotAB}; |
| 939 |
\draw (\@venn@Ax,\@venn@Ay+\@venn@radius) |
| 940 |
node[below] (labelA) {\@venn@label@A}; |
| 941 |
\draw (\@venn@Bx,\@venn@By+\@venn@radius) |
| 942 |
node[below] (labelB) {\@venn@label@B}; |
| 943 |
\draw (0.5*\@venn@w,0.5*\@venn@h) node (labelAB) {\@venn@label@AB}; |
| 944 |
\@postvennhook |
| 945 |
\end{tikzpicture} |
| 946 |
} |
| 947 |
\newcommand*\@venn@fillOnlyA@twosets{% |
| 948 |
\@venn@computecircleintersects{\@venn@Ax}{\@venn@Ay}{\@venn@Bx}{\@venn@By}% |
| 949 |
\ifnum\@venn@intersect@n=2\relax |
| 950 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Ax}% |
| 951 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Ay}% |
| 952 |
\ifvennoldpgf |
| 953 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 954 |
\else |
| 955 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 956 |
\fi |
| 957 |
\let\@venn@start@i@angle\pgfmathresult |
| 958 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Ax}% |
| 959 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Ay}% |
| 960 |
\ifvennoldpgf |
| 961 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 962 |
\else |
| 963 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 964 |
\fi |
| 965 |
\let\@venn@end@i@angle\pgfmathresult |
| 966 |
\pgfmathadd{\@venn@end@i@angle}{360}% |
| 967 |
\let\@venn@end@i@angle\pgfmathresult |
| 968 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Bx}% |
| 969 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@By}% |
| 970 |
\ifvennoldpgf |
| 971 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 972 |
\else |
| 973 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 974 |
\fi |
| 975 |
\let\@venn@start@ii@angle\pgfmathresult |
| 976 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Bx}% |
| 977 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@By}% |
| 978 |
\ifvennoldpgf |
| 979 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 980 |
\else |
| 981 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 982 |
\fi |
| 983 |
\let\@venn@end@ii@angle\pgfmathresult |
| 984 |
\pgfmathadd{\@venn@start@ii@angle}{360}% |
| 985 |
\let\@venn@start@ii@angle\pgfmathresult |
| 986 |
\path[fill=\@venn@shade] |
| 987 |
(\@venn@intersect@i@x,\@venn@intersect@i@y) |
| 988 |
arc[radius=\@venn@radius,start angle=\@venn@start@i@angle, |
| 989 |
end angle=\@venn@end@i@angle] |
| 990 |
arc[radius=\@venn@radius,start angle=\@venn@start@ii@angle, |
| 991 |
end angle=\@venn@end@ii@angle] |
| 992 |
-- cycle; |
| 993 |
\else |
| 994 |
\fillOnlyA |
| 995 |
\fi |
| 996 |
}% |
| 997 |
\newcommand*\@venn@fillOnlyB@twosets{% |
| 998 |
\@venn@computecircleintersects{\@venn@Ax}{\@venn@Ay}{\@venn@Bx}{\@venn@By}% |
| 999 |
\ifnum\@venn@intersect@n=2\relax |
| 1000 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Bx}% |
| 1001 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@By}% |
| 1002 |
\ifvennoldpgf |
| 1003 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 1004 |
\else |
| 1005 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 1006 |
\fi |
| 1007 |
\let\@venn@start@i@angle\pgfmathresult |
| 1008 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Bx}% |
| 1009 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@By}% |
| 1010 |
\ifvennoldpgf |
| 1011 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 1012 |
\else |
| 1013 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 1014 |
\fi |
| 1015 |
\let\@venn@end@i@angle\pgfmathresult |
| 1016 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@ii@x-\@venn@Ax}% |
| 1017 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@ii@y-\@venn@Ay}% |
| 1018 |
\ifvennoldpgf |
| 1019 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 1020 |
\else |
| 1021 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 1022 |
\fi |
| 1023 |
\let\@venn@start@ii@angle\pgfmathresult |
| 1024 |
\pgfmathsetlength{\dimen@i}{\@venn@intersect@i@x-\@venn@Ax}% |
| 1025 |
\pgfmathsetlength{\dimen@ii}{\@venn@intersect@i@y-\@venn@Ay}% |
| 1026 |
\ifvennoldpgf |
| 1027 |
\pgfmathatantwo{\dimen@i}{\dimen@ii}% |
| 1028 |
\else |
| 1029 |
\pgfmathatantwo{\dimen@ii}{\dimen@i}% |
| 1030 |
\fi |
| 1031 |
\let\@venn@end@ii@angle\pgfmathresult |
| 1032 |
\path[fill=\@venn@shade] |
| 1033 |
(\@venn@intersect@i@x,\@venn@intersect@i@y) |
| 1034 |
arc[radius=\@venn@radius,start angle=\@venn@start@i@angle, |
| 1035 |
end angle=\@venn@end@i@angle] |
| 1036 |
arc[radius=\@venn@radius,start angle=\@venn@start@ii@angle, |
| 1037 |
end angle=\@venn@end@ii@angle] |
| 1038 |
-- cycle; |
| 1039 |
\else |
| 1040 |
\fillOnlyB |
| 1041 |
\fi |
| 1042 |
}% |
| 1043 |
\endinput |
| 1044 |
%% |
| 1045 |
%% End of file `venndiagram.sty'. |