| 1 |
%% |
| 2 |
%% This is file `curve2e-v161.sty', |
| 3 |
%% generated with the docstrip utility. |
| 4 |
%% |
| 5 |
%% The original source files were: |
| 6 |
%% |
| 7 |
%% curve2e.dtx (with options: `v161') |
| 8 |
%% |
| 9 |
%% Copyright (C) 2005--2024 Claudio Beccari all |
| 10 |
%% rights reserved. |
| 11 |
%% License information appended |
| 12 |
%% |
| 13 |
|
| 14 |
\NeedsTeXFormat{LaTeX2e}[2016/01/01] |
| 15 |
\ProvidesPackage{curve2e-v161}% |
| 16 |
[2019/02/07 v.1.61 Extension package for pict2e] |
| 17 |
|
| 18 |
\RequirePackage{color} |
| 19 |
\RequirePackageWithOptions{pict2e}[2014/01/01] |
| 20 |
\RequirePackage{xparse} |
| 21 |
\def\TRON{\tracingcommands\tw@ \tracingmacros\tw@}% |
| 22 |
\def\TROF{\tracingcommands\z@ \tracingmacros\z@}% |
| 23 |
\ifx\undefined\@tdA \newdimen\@tdA \fi |
| 24 |
\ifx\undefined\@tdB \newdimen\@tdB \fi |
| 25 |
\ifx\undefined\@tdC \newdimen\@tdC \fi |
| 26 |
\ifx\undefined\@tdD \newdimen\@tdD \fi |
| 27 |
\ifx\undefined\@tdE \newdimen\@tdE \fi |
| 28 |
\ifx\undefined\@tdF \newdimen\@tdF \fi |
| 29 |
\ifx\undefined\defaultlinewidth \newdimen\defaultlinewidth \fi |
| 30 |
\gdef\linethickness#1{\@wholewidth#1\@halfwidth.5\@wholewidth\ignorespaces}% |
| 31 |
\newcommand\defaultlinethickness[1]{\defaultlinewidth=#1\relax |
| 32 |
\def\thicklines{\linethickness{\defaultlinewidth}}% |
| 33 |
\def\thinlines{\linethickness{.5\defaultlinewidth}}% |
| 34 |
\thinlines\ignorespaces} |
| 35 |
\def\LIne(#1){{\GetCoord(#1)\@tX\@tY |
| 36 |
\moveto(0,0) |
| 37 |
\pIIe@lineto{\@tX\unitlength}{\@tY\unitlength}\strokepath}\ignorespaces}% |
| 38 |
\def\segment(#1)(#2){\@killglue\polyline(#1)(#2)}% |
| 39 |
\def\line(#1)#2{\begingroup |
| 40 |
\@linelen #2\unitlength |
| 41 |
\ifdim\@linelen<\z@\@badlinearg\else |
| 42 |
\expandafter\DirOfVect#1to\Dir@line |
| 43 |
\GetCoord(\Dir@line)\d@mX\d@mY |
| 44 |
\ifdim\d@mX\p@=\z@\else |
| 45 |
\DividE\ifdim\d@mX\p@<\z@-\fi\p@ by\d@mX\p@ to\sc@lelen |
| 46 |
\@linelen=\sc@lelen\@linelen |
| 47 |
\fi |
| 48 |
\moveto(0,0) |
| 49 |
\pIIe@lineto{\d@mX\@linelen}{\d@mY\@linelen}% |
| 50 |
\strokepath |
| 51 |
\fi |
| 52 |
\endgroup\ignorespaces}% |
| 53 |
\ifx\Dashline\undefined |
| 54 |
\def\Dashline{\@ifstar{\Dashline@@}{\Dashline@}} |
| 55 |
\def\Dashline@(#1)(#2)#3{% |
| 56 |
\bgroup |
| 57 |
\countdef\NumA3254\countdef\NumB3252\relax |
| 58 |
\GetCoord(#1)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttA |
| 59 |
\GetCoord(#2)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttB |
| 60 |
\SubVect\V@ttA from\V@ttB to\V@ttC |
| 61 |
\ModOfVect\V@ttC to\DlineMod |
| 62 |
\DivideFN\DlineMod by#3 to\NumD |
| 63 |
\NumA\expandafter\Integer\NumD.?? |
| 64 |
\ifodd\NumA\else\advance\NumA\@ne\fi |
| 65 |
\NumB=\NumA \divide\NumB\tw@ |
| 66 |
\DividE\DlineMod\p@ by\NumA\p@ to\D@shMod |
| 67 |
\DividE\p@ by\NumA\p@ to \@tempa |
| 68 |
\MultVect\V@ttC by\@tempa,0 to\V@ttB |
| 69 |
\MultVect\V@ttB by 2,0 to\V@ttC |
| 70 |
\advance\NumB\@ne |
| 71 |
\edef\@mpt{\noexpand\egroup |
| 72 |
\noexpand\multiput(\V@ttA)(\V@ttC){\number\NumB}% |
| 73 |
{\noexpand\LIne(\V@ttB)}}% |
| 74 |
\@mpt\ignorespaces}% |
| 75 |
\let\Dline\Dashline |
| 76 |
|
| 77 |
\def\Dashline@@(#1)(#2)#3{\put(#1){\Dashline@(0,0)(#2){#3}}} |
| 78 |
\fi |
| 79 |
\ifx\Dotline\undefined |
| 80 |
\def\Dotline{\@ifstar{\Dotline@@}{\Dotline@}} |
| 81 |
\def\Dotline@(#1)(#2)#3{% |
| 82 |
\bgroup |
| 83 |
\countdef\NumA 3254\relax \countdef\NumB 3255\relax |
| 84 |
\GetCoord(#1)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttA |
| 85 |
\GetCoord(#2)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttB |
| 86 |
\SubVect\V@ttA from\V@ttB to\V@ttC |
| 87 |
\ModOfVect\V@ttC to\DotlineMod |
| 88 |
\DivideFN\DotlineMod by#3 to\NumD |
| 89 |
\NumA=\expandafter\Integer\NumD.?? |
| 90 |
\DivVect\V@ttC by\NumA,0 to\V@ttB |
| 91 |
\advance\NumA\@ne |
| 92 |
\edef\@mpt{\noexpand\egroup |
| 93 |
\noexpand\multiput(\V@ttA)(\V@ttB){\number\NumA}% |
| 94 |
{\noexpand\makebox(0,0){\noexpand\circle*{0.5}}}}% |
| 95 |
\@mpt\ignorespaces}% |
| 96 |
|
| 97 |
\def\Dotline@@(#1)(#2)#3{\put(#1){\Dotline@(0,0)(#2){#3}}} |
| 98 |
\fi |
| 99 |
\AtBeginDocument{\@ifpackageloaded{eso-pic}{% |
| 100 |
\renewcommand\LenToUnit[1]{\strip@pt\dimexpr#1*\p@/\unitlength}}{}} |
| 101 |
|
| 102 |
\def\GetCoord(#1)#2#3{% |
| 103 |
\expandafter\SplitNod@\expandafter(#1)#2#3\ignorespaces} |
| 104 |
\def\isnot@polar#1:#2!!{\def\@tempOne{#2}\ifx\@tempOne\empty |
| 105 |
\expandafter\@firstoftwo\else |
| 106 |
\expandafter\@secondoftwo\fi |
| 107 |
{\SplitNod@@}{\SplitPolar@@}} |
| 108 |
|
| 109 |
\def\SplitNod@(#1)#2#3{\isnot@polar#1:!!(#1)#2#3}% |
| 110 |
\def\SplitNod@@(#1,#2)#3#4{\edef#3{#1}\edef#4{#2}}% |
| 111 |
\def\SplitPolar@@(#1:#2)#3#4{\DirFromAngle#1to\@DirA |
| 112 |
\ScaleVect\@DirA by#2to\@DirA |
| 113 |
\expandafter\SplitNod@@\expandafter(\@DirA)#3#4} |
| 114 |
|
| 115 |
\let\originalput\put |
| 116 |
\def\put(#1){\bgroup\GetCoord(#1)\@tX\@tY |
| 117 |
\edef\x{\noexpand\egroup\noexpand\originalput(\@tX,\@tY)}\x} |
| 118 |
|
| 119 |
\let\originalmultiput\multiput |
| 120 |
\let\original@multiput\@multiput |
| 121 |
|
| 122 |
\long\def\@multiput(#1)#2#3{\bgroup\GetCoord(#1)\@mptX\@mptY |
| 123 |
\edef\x{\noexpand\egroup\noexpand\original@multiput(\@mptX,\@mptY)}% |
| 124 |
\x{#2}{#3}\ignorespaces} |
| 125 |
|
| 126 |
\gdef\multiput(#1)#2{\bgroup\GetCoord(#1)\@mptX\@mptY |
| 127 |
\edef\x{\noexpand\egroup\noexpand\originalmultiput(\@mptX,\@mptY)}\x(}%) |
| 128 |
\def\vector(#1)#2{% |
| 129 |
\begingroup |
| 130 |
\GetCoord(#1)\d@mX\d@mY |
| 131 |
\@linelen#2\unitlength |
| 132 |
\ifdim\d@mX\p@=\z@\ifdim\d@mY\p@=\z@\@badlinearg\fi\fi |
| 133 |
\ifdim\@linelen<\z@ \@linelen=-\@linelen\fi |
| 134 |
\MakeVectorFrom\d@mX\d@mY to\@Vect |
| 135 |
\DirOfVect\@Vect to\Dir@Vect |
| 136 |
\YpartOfVect\Dir@Vect to\@ynum \@ydim=\@ynum\p@ |
| 137 |
\XpartOfVect\Dir@Vect to\@xnum \@xdim=\@xnum\p@ |
| 138 |
\ifdim\d@mX\p@=\z@ |
| 139 |
\else\ifdim\d@mY\p@=\z@ |
| 140 |
\else |
| 141 |
\DividE\ifdim\@xnum\p@<\z@-\fi\p@ by\@xnum\p@ to\sc@lelen |
| 142 |
\@linelen=\sc@lelen\@linelen |
| 143 |
\fi |
| 144 |
\fi |
| 145 |
\@tdB=\@linelen |
| 146 |
\pIIe@concat\@xdim\@ydim{-\@ydim}\@xdim{\@xnum\@linelen}{\@ynum\@linelen}% |
| 147 |
\@linelen\z@ |
| 148 |
\pIIe@vector |
| 149 |
\fillpath |
| 150 |
\@linelen=\@tdB |
| 151 |
\@tdA=\pIIe@FAW\@wholewidth |
| 152 |
\@tdA=\pIIe@FAL\@tdA |
| 153 |
\advance\@linelen-\@tdA |
| 154 |
\ifdim\@linelen>\z@ |
| 155 |
\moveto(0,0) |
| 156 |
\pIIe@lineto{\@xnum\@linelen}{\@ynum\@linelen}% |
| 157 |
\strokepath\fi |
| 158 |
\endgroup} |
| 159 |
\def\Vector(#1){{% |
| 160 |
\GetCoord(#1)\@tX\@tY |
| 161 |
\ifdim\@tX\p@=\z@\vector(\@tX,\@tY){\@tY} |
| 162 |
\else |
| 163 |
\vector(\@tX,\@tY){\@tX}\fi}} |
| 164 |
\def\VECTOR(#1)(#2){\begingroup |
| 165 |
\SubVect#1from#2to\@tempa |
| 166 |
\expandafter\put\expandafter(#1){\expandafter\Vector\expandafter(\@tempa)}% |
| 167 |
\endgroup\ignorespaces} |
| 168 |
\let\lp@r( \let\rp@r) |
| 169 |
\renewcommand*\polyline[1][\beveljoin]{\p@lylin@[#1]} |
| 170 |
|
| 171 |
\def\p@lylin@[#1](#2){\@killglue#1\GetCoord(#2)\d@mX\d@mY |
| 172 |
\pIIe@moveto{\d@mX\unitlength}{\d@mY\unitlength}% |
| 173 |
\@ifnextchar\lp@r{\p@lyline}{% |
| 174 |
\PackageWarning{curve2e}% |
| 175 |
{Polylines require at least two vertices!\MessageBreak |
| 176 |
Control your polyline specification\MessageBreak}% |
| 177 |
\ignorespaces}} |
| 178 |
|
| 179 |
\def\p@lyline(#1){\GetCoord(#1)\d@mX\d@mY |
| 180 |
\pIIe@lineto{\d@mX\unitlength}{\d@mY\unitlength}% |
| 181 |
\@ifnextchar\lp@r{\p@lyline}{\strokepath\ignorespaces}} |
| 182 |
\providecommand\polygon{} |
| 183 |
\RenewDocumentCommand\polygon{s O{\beveljoin} }{\@killglue\begingroup |
| 184 |
\IfBooleanTF{#1}{\@tempswatrue}{\@tempswafalse}% |
| 185 |
\@polygon[#2]} |
| 186 |
|
| 187 |
\def\@polygon[#1](#2){\@killglue#1\GetCoord(#2)\d@mX\d@mY |
| 188 |
\pIIe@moveto{\d@mX\unitlength}{\d@mY\unitlength}% |
| 189 |
\@ifnextchar\lp@r{\@@polygon}{% |
| 190 |
\PackageWarning{curve2e}% |
| 191 |
{Polygons require at least two vertices!\MessageBreak |
| 192 |
Control your polygon specification\MessageBreak}% |
| 193 |
\ignorespaces}} |
| 194 |
|
| 195 |
\def\@@polygon(#1){\GetCoord(#1)\d@mX\d@mY |
| 196 |
\pIIe@lineto{\d@mX\unitlength}{\d@mY\unitlength}% |
| 197 |
\@ifnextchar\lp@r{\@@polygon}{\pIIe@closepath |
| 198 |
\if@tempswa\pIIe@fillGraph\else\pIIe@strokeGraph\fi |
| 199 |
\endgroup |
| 200 |
\ignorespaces}} |
| 201 |
\def\GraphGrid(#1,#2){\bgroup\textcolor{red}{\linethickness{.1\p@}% |
| 202 |
\RoundUp#1modulo10to\@GridWd \RoundUp#2modulo10to\@GridHt |
| 203 |
\@tempcnta=\@GridWd \divide\@tempcnta10\relax \advance\@tempcnta\@ne |
| 204 |
\multiput(0,0)(10,0){\@tempcnta}{\line(0,1){\@GridHt}}% |
| 205 |
\@tempcnta=\@GridHt \divide\@tempcnta10\advance\@tempcnta\@ne |
| 206 |
\multiput(0,0)(0,10){\@tempcnta}{\line(1,0){\@GridWd}}\thinlines}% |
| 207 |
\egroup\ignorespaces} |
| 208 |
\def\RoundUp#1modulo#2to#3{\expandafter\@tempcnta\Integer#1.??% |
| 209 |
\count254\@tempcnta\divide\count254by#2\relax |
| 210 |
\multiply\count254by#2\relax |
| 211 |
\count252\@tempcnta\advance\count252-\count254 |
| 212 |
\ifnum\count252>0\advance\count252-#2\relax |
| 213 |
\advance\@tempcnta-\count252\fi\edef#3{\number\@tempcnta}\ignorespaces}% |
| 214 |
\def\Integer#1.#2??{#1}% |
| 215 |
\ifdefined\dimexpr |
| 216 |
\unless\ifdefined\DividE |
| 217 |
\def\DividE#1by#2to#3{\bgroup |
| 218 |
\dimendef\Num2254\relax \dimendef\Den2252\relax |
| 219 |
\dimendef\@DimA 2250 |
| 220 |
\Num=\p@ \Den=#2\relax |
| 221 |
\ifdim\Den=\z@ |
| 222 |
\edef\x{\noexpand\endgroup\noexpand\def\noexpand#3{\strip@pt\maxdimen}}% |
| 223 |
\else |
| 224 |
\@DimA=#1\relax |
| 225 |
\edef\x{% |
| 226 |
\noexpand\egroup\noexpand\def\noexpand#3{% |
| 227 |
\strip@pt\dimexpr\@DimA*\Num/\Den\relax}}% |
| 228 |
\fi |
| 229 |
\x\ignorespaces}% |
| 230 |
\fi |
| 231 |
\unless\ifdefined\DivideFN |
| 232 |
\def\DivideFN#1by#2to#3{\DividE#1\p@ by#2\p@ to{#3}}% |
| 233 |
\fi |
| 234 |
\unless\ifdefined\MultiplY |
| 235 |
\def\MultiplY#1by#2to#3{\bgroup |
| 236 |
\dimendef\@DimA 2254 \dimendef\@DimB2255 |
| 237 |
\@DimA=#1\p@\relax \@DimB=#2\p@\relax |
| 238 |
\edef\x{% |
| 239 |
\noexpand\egroup\noexpand\def\noexpand#3{% |
| 240 |
\strip@pt\dimexpr\@DimA*\@DimB/\p@\relax}}% |
| 241 |
\x\ignorespaces}% |
| 242 |
\let\MultiplyFN\MultiplY |
| 243 |
\fi |
| 244 |
\fi |
| 245 |
|
| 246 |
\unless\ifdefined\Numero |
| 247 |
\def\Numero#1#2{\bgroup\dimen3254=#2\relax |
| 248 |
\edef\x{\noexpand\egroup\noexpand\edef\noexpand#1{% |
| 249 |
\strip@pt\dimen3254}}\x\ignorespaces}% |
| 250 |
\fi |
| 251 |
\def\g@tTanCotanFrom#1to#2and#3{% |
| 252 |
\DividE 114.591559\p@ by#1to\X@ \@tdB=\X@\p@ |
| 253 |
\countdef\I=2546\def\Tan{0}\I=11\relax |
| 254 |
\@whilenum\I>\z@\do{% |
| 255 |
\@tdC=\Tan\p@ \@tdD=\I\@tdB |
| 256 |
\advance\@tdD-\@tdC \DividE\p@ by\@tdD to\Tan |
| 257 |
\advance\I-2\relax}% |
| 258 |
\def#2{\Tan}\DividE\p@ by\Tan\p@ to\Cot \def#3{\Cot}\ignorespaces}% |
| 259 |
\def\SinOf#1to#2{\bgroup% |
| 260 |
\@tdA=#1\p@% |
| 261 |
\ifdim\@tdA>\z@% |
| 262 |
\@whiledim\@tdA>180\p@\do{\advance\@tdA -360\p@}% |
| 263 |
\else% |
| 264 |
\@whiledim\@tdA<-180\p@\do{\advance\@tdA 360\p@}% |
| 265 |
\fi \ifdim\@tdA=\z@ |
| 266 |
\def\@tempA{0}% |
| 267 |
\else |
| 268 |
\ifdim\@tdA>\z@ |
| 269 |
\def\Segno{+}% |
| 270 |
\else |
| 271 |
\def\Segno{-}% |
| 272 |
\@tdA=-\@tdA |
| 273 |
\fi |
| 274 |
\ifdim\@tdA>90\p@ |
| 275 |
\@tdA=-\@tdA \advance\@tdA 180\p@ |
| 276 |
\fi |
| 277 |
\ifdim\@tdA=90\p@ |
| 278 |
\def\@tempA{\Segno1}% |
| 279 |
\else |
| 280 |
\ifdim\@tdA=180\p@ |
| 281 |
\def\@tempA{0}% |
| 282 |
\else |
| 283 |
\ifdim\@tdA<\p@ |
| 284 |
\@tdA=\Segno0.0174533\@tdA |
| 285 |
\DividE\@tdA by\p@ to \@tempA% |
| 286 |
\else |
| 287 |
\g@tTanCotanFrom\@tdA to\T and\Tp |
| 288 |
\@tdA=\T\p@ \advance\@tdA \Tp\p@ |
| 289 |
\DividE \Segno2\p@ by\@tdA to \@tempA% |
| 290 |
\fi |
| 291 |
\fi |
| 292 |
\fi |
| 293 |
\fi |
| 294 |
\edef\endSinOf{\noexpand\egroup |
| 295 |
\noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}% |
| 296 |
\endSinOf}% |
| 297 |
\def\CosOf#1to#2{\bgroup% |
| 298 |
\@tdA=#1\p@% |
| 299 |
\ifdim\@tdA>\z@% |
| 300 |
\@whiledim\@tdA>360\p@\do{\advance\@tdA -360\p@}% |
| 301 |
\else% |
| 302 |
\@whiledim\@tdA<\z@\do{\advance\@tdA 360\p@}% |
| 303 |
\fi |
| 304 |
\ifdim\@tdA>180\p@ |
| 305 |
\@tdA=-\@tdA \advance\@tdA 360\p@ |
| 306 |
\fi |
| 307 |
\ifdim\@tdA<90\p@ |
| 308 |
\def\Segno{+}% |
| 309 |
\else |
| 310 |
\def\Segno{-}% |
| 311 |
\@tdA=-\@tdA \advance\@tdA 180\p@ |
| 312 |
\fi |
| 313 |
\ifdim\@tdA=\z@ |
| 314 |
\def\@tempA{\Segno1}% |
| 315 |
\else |
| 316 |
\ifdim\@tdA<\p@ |
| 317 |
\@tdA=0.0174533\@tdA \Numero\@tempA\@tdA |
| 318 |
\@tdA=\@tempA\@tdA \@tdA=-.5\@tdA |
| 319 |
\advance\@tdA \p@ |
| 320 |
\DividE\@tdA by\p@ to\@tempA% |
| 321 |
\else |
| 322 |
\ifdim\@tdA=90\p@ |
| 323 |
\def\@tempA{0}% |
| 324 |
\else |
| 325 |
\g@tTanCotanFrom\@tdA to\T and\Tp |
| 326 |
\@tdA=\Tp\p@ \advance\@tdA-\T\p@ |
| 327 |
\@tdB=\Tp\p@ \advance\@tdB\T\p@ |
| 328 |
\DividE\Segno\@tdA by\@tdB to\@tempA% |
| 329 |
\fi |
| 330 |
\fi |
| 331 |
\fi |
| 332 |
\edef\endCosOf{\noexpand\egroup |
| 333 |
\noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}% |
| 334 |
\endCosOf}% |
| 335 |
\def\TanOf#1to#2{\bgroup% |
| 336 |
\@tdA=#1\p@% |
| 337 |
\ifdim\@tdA>90\p@% |
| 338 |
\@whiledim\@tdA>90\p@\do{\advance\@tdA -180\p@}% |
| 339 |
\else% |
| 340 |
\@whiledim\@tdA<-90\p@\do{\advance\@tdA 180\p@}% |
| 341 |
\fi% |
| 342 |
\ifdim\@tdA=\z@% |
| 343 |
\def\@tempA{0}% |
| 344 |
\else |
| 345 |
\ifdim\@tdA>\z@ |
| 346 |
\def\Segno{+}% |
| 347 |
\else |
| 348 |
\def\Segno{-}% |
| 349 |
\@tdA=-\@tdA |
| 350 |
\fi |
| 351 |
\ifdim\@tdA=90\p@ |
| 352 |
\def\@tempA{\Segno16383.99999}% |
| 353 |
\else |
| 354 |
\ifdim\@tdA<\p@ |
| 355 |
\@tdA=\Segno0.0174533\@tdA |
| 356 |
\DividE\@tdA by\p@ to\@tempA% |
| 357 |
\else |
| 358 |
\g@tTanCotanFrom\@tdA to\T and\Tp |
| 359 |
\@tdA\Tp\p@ \advance\@tdA -\T\p@ |
| 360 |
\DividE\Segno2\p@ by\@tdA to\@tempA% |
| 361 |
\fi |
| 362 |
\fi |
| 363 |
\fi |
| 364 |
\edef\endTanOf{\noexpand\egroup |
| 365 |
\noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}% |
| 366 |
\endTanOf}% |
| 367 |
\def\ArcTanOf#1to#2{\bgroup |
| 368 |
\countdef\Inverti 4444\Inverti=0 |
| 369 |
\def\Segno{} |
| 370 |
\edef\@tF{#1}\@tdF=\@tF\p@ \@tdE=57.295778\p@ |
| 371 |
\@tdD=\ifdim\@tdF<\z@ -\@tdF\def\Segno{-}\else\@tdF\fi |
| 372 |
\ifdim\@tdD>\p@ |
| 373 |
\Inverti=\@ne |
| 374 |
\@tdD=\dimexpr\p@*\p@/\@tdD\relax |
| 375 |
\fi |
| 376 |
\unless\ifdim\@tdD>0.02\p@ |
| 377 |
\def\@tX{\strip@pt\dimexpr57.295778\@tdD\relax}% |
| 378 |
\else |
| 379 |
\edef\@tX{45}\relax |
| 380 |
\countdef\I 2523 \I=9\relax |
| 381 |
\@whilenum\I>0\do{\TanOf\@tX to\@tG |
| 382 |
\edef\@tG{\strip@pt\dimexpr\@tG\p@-\@tdD\relax}\relax |
| 383 |
\MultiplY\@tG by57.295778to\@tG |
| 384 |
\CosOf\@tX to\@tH |
| 385 |
\MultiplY\@tH by\@tH to\@tH |
| 386 |
\MultiplY\@tH by\@tG to \@tH |
| 387 |
\edef\@tX{\strip@pt\dimexpr\@tX\p@ - \@tH\p@\relax}\relax |
| 388 |
\advance\I\m@ne}% |
| 389 |
\fi |
| 390 |
\ifnum\Inverti=\@ne |
| 391 |
\edef\@tX{\strip@pt\dimexpr90\p@-\@tX\p@\relax} |
| 392 |
\fi |
| 393 |
\edef\x{\egroup\noexpand\edef\noexpand#2{\Segno\@tX}}\x\ignorespaces}% |
| 394 |
\def\MakeVectorFrom#1#2to#3{\edef#3{#1,#2}\ignorespaces}% |
| 395 |
\def\CopyVect#1to#2{\edef#2{#1}\ignorespaces}% |
| 396 |
\def\ModOfVect#1to#2{\GetCoord(#1)\t@X\t@Y |
| 397 |
\@tempdima=\t@X\p@ \ifdim\@tempdima<\z@ \@tempdima=-\@tempdima\fi |
| 398 |
\@tempdimb=\t@Y\p@ \ifdim\@tempdimb<\z@ \@tempdimb=-\@tempdimb\fi |
| 399 |
\ifdim\@tempdima=\z@ |
| 400 |
\ifdim\@tempdimb=\z@ |
| 401 |
\def\@T{0}\@tempdimc=\z@ |
| 402 |
\else |
| 403 |
\def\@T{0}\@tempdimc=\@tempdimb |
| 404 |
\fi |
| 405 |
\else |
| 406 |
\ifdim\@tempdima>\@tempdimb |
| 407 |
\DividE\@tempdimb by\@tempdima to\@T |
| 408 |
\@tempdimc=\@tempdima |
| 409 |
\else |
| 410 |
\DividE\@tempdima by\@tempdimb to\@T |
| 411 |
\@tempdimc=\@tempdimb |
| 412 |
\fi |
| 413 |
\fi |
| 414 |
\unless\ifdim\@tempdimc=\z@ |
| 415 |
\unless\ifdim\@T\p@=\z@ |
| 416 |
\@tempdima=\@T\p@ \@tempdima=\@T\@tempdima |
| 417 |
\advance\@tempdima\p@% |
| 418 |
\@tempdimb=\p@% |
| 419 |
\@tempcnta=5\relax |
| 420 |
\@whilenum\@tempcnta>\z@\do{\DividE\@tempdima by\@tempdimb to\@T |
| 421 |
\advance\@tempdimb \@T\p@ \@tempdimb=.5\@tempdimb |
| 422 |
\advance\@tempcnta\m@ne}% |
| 423 |
\@tempdimc=\@T\@tempdimc |
| 424 |
\fi |
| 425 |
\fi |
| 426 |
\Numero#2\@tempdimc |
| 427 |
\ignorespaces}% |
| 428 |
\def\DirOfVect#1to#2{\GetCoord(#1)\t@X\t@Y |
| 429 |
\ModOfVect#1to\@tempa |
| 430 |
\unless\ifdim\@tempdimc=\z@ |
| 431 |
\DividE\t@X\p@ by\@tempdimc to\t@X |
| 432 |
\DividE\t@Y\p@ by\@tempdimc to\t@Y |
| 433 |
\fi |
| 434 |
\MakeVectorFrom\t@X\t@Y to#2\ignorespaces}% |
| 435 |
\def\ModAndDirOfVect#1to#2and#3{% |
| 436 |
\GetCoord(#1)\t@X\t@Y |
| 437 |
\ModOfVect#1to#2% |
| 438 |
\ifdim\@tempdimc=\z@\else |
| 439 |
\DividE\t@X\p@ by\@tempdimc to\t@X |
| 440 |
\DividE\t@Y\p@ by\@tempdimc to\t@Y |
| 441 |
\fi |
| 442 |
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}% |
| 443 |
\def\DistanceAndDirOfVect#1minus#2to#3and#4{% |
| 444 |
\SubVect#2from#1to\@tempa |
| 445 |
\ModAndDirOfVect\@tempa to#3and#4\ignorespaces}% |
| 446 |
\def\XpartOfVect#1to#2{% |
| 447 |
\GetCoord(#1)#2\@tempa\ignorespaces}% |
| 448 |
\def\YpartOfVect#1to#2{% |
| 449 |
\GetCoord(#1)\@tempa#2\ignorespaces}% |
| 450 |
\def\DirFromAngle#1to#2{% |
| 451 |
\CosOf#1to\t@X |
| 452 |
\SinOf#1to\t@Y |
| 453 |
\MakeVectorFrom\t@X\t@Y to#2\ignorespaces}% |
| 454 |
\def\ArgOfVect#1to#2{\bgroup\GetCoord(#1){\t@X}{\t@Y}% |
| 455 |
\def\s@gno{}\def\addflatt@ngle{0} |
| 456 |
\ifdim\t@X\p@=\z@ |
| 457 |
\ifdim\t@Y\p@=\z@ |
| 458 |
\def\ArcTan{0}% |
| 459 |
\else |
| 460 |
\def\ArcTan{90}% |
| 461 |
\ifdim\t@Y\p@<\z@\def\s@gno{-}\fi |
| 462 |
\fi |
| 463 |
\else |
| 464 |
\ifdim\t@Y\p@=\z@ |
| 465 |
\ifdim\t@X\p@<\z@ |
| 466 |
\def\ArcTan{180}% |
| 467 |
\else |
| 468 |
\def\ArcTan{0}% |
| 469 |
\fi |
| 470 |
\else |
| 471 |
\ifdim\t@X\p@<\z@% |
| 472 |
\def\addflatt@ngle{180}% |
| 473 |
\edef\t@X{\strip@pt\dimexpr-\t@X\p@}% |
| 474 |
\edef\t@Y{\strip@pt\dimexpr-\t@Y\p@}% |
| 475 |
\ifdim\t@Y\p@<\z@ |
| 476 |
\def\s@gno{-}% |
| 477 |
\edef\t@Y{-\t@Y}% |
| 478 |
\fi |
| 479 |
\fi |
| 480 |
\DivideFN\t@Y by\t@X to \t@A |
| 481 |
\ArcTanOf\t@A to\ArcTan |
| 482 |
\fi |
| 483 |
\fi |
| 484 |
\edef\ArcTan{\unless\ifx\s@gno\empty\s@gno\fi\ArcTan}% |
| 485 |
\unless\ifnum\addflatt@ngle=0\relax |
| 486 |
\edef\ArcTan{% |
| 487 |
\strip@pt\dimexpr\ArcTan\p@\ifx\s@gno\empty-\else+\fi |
| 488 |
\addflatt@ngle\p@\relax}% |
| 489 |
\fi |
| 490 |
\edef\x{\noexpand\egroup\noexpand\edef\noexpand#2{\ArcTan}}% |
| 491 |
\x\ignorespaces} |
| 492 |
\def\ScaleVect#1by#2to#3{\GetCoord(#1)\t@X\t@Y |
| 493 |
\@tempdima=\t@X\p@ \@tempdima=#2\@tempdima\Numero\t@X\@tempdima |
| 494 |
\@tempdima=\t@Y\p@ \@tempdima=#2\@tempdima\Numero\t@Y\@tempdima |
| 495 |
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}% |
| 496 |
\def\ConjVect#1to#2{\GetCoord(#1)\t@X\t@Y |
| 497 |
\@tempdima=-\t@Y\p@\Numero\t@Y\@tempdima |
| 498 |
\MakeVectorFrom\t@X\t@Y to#2\ignorespaces}% |
| 499 |
\def\AddVect#1and#2to#3{\GetCoord(#1)\tu@X\tu@Y |
| 500 |
\GetCoord(#2)\td@X\td@Y |
| 501 |
\@tempdima\tu@X\p@\advance\@tempdima\td@X\p@ \Numero\t@X\@tempdima |
| 502 |
\@tempdima\tu@Y\p@\advance\@tempdima\td@Y\p@ \Numero\t@Y\@tempdima |
| 503 |
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}% |
| 504 |
\def\SubVect#1from#2to#3{\GetCoord(#1)\tu@X\tu@Y |
| 505 |
\GetCoord(#2)\td@X\td@Y |
| 506 |
\@tempdima\td@X\p@\advance\@tempdima-\tu@X\p@ \Numero\t@X\@tempdima |
| 507 |
\@tempdima\td@Y\p@\advance\@tempdima-\tu@Y\p@ \Numero\t@Y\@tempdima |
| 508 |
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}% |
| 509 |
\def\MultVect#1by{\@ifstar{\@ConjMultVect#1by}{\@MultVect#1by}}% |
| 510 |
\def\@MultVect#1by#2to#3{\GetCoord(#1)\tu@X\tu@Y |
| 511 |
\GetCoord(#2)\td@X\td@Y |
| 512 |
\@tempdima\tu@X\p@ \@tempdimb\tu@Y\p@ |
| 513 |
\@tempdimc=\td@X\@tempdima\advance\@tempdimc-\td@Y\@tempdimb |
| 514 |
\Numero\t@X\@tempdimc |
| 515 |
\@tempdimc=\td@Y\@tempdima\advance\@tempdimc\td@X\@tempdimb |
| 516 |
\Numero\t@Y\@tempdimc |
| 517 |
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}% |
| 518 |
\def\@ConjMultVect#1by#2to#3{\GetCoord(#1)\tu@X\tu@Y |
| 519 |
\GetCoord(#2)\td@X\td@Y \@tempdima\tu@X\p@ \@tempdimb\tu@Y\p@ |
| 520 |
\@tempdimc=\td@X\@tempdima\advance\@tempdimc+\td@Y\@tempdimb |
| 521 |
\Numero\t@X\@tempdimc |
| 522 |
\@tempdimc=\td@X\@tempdimb\advance\@tempdimc-\td@Y\@tempdima |
| 523 |
\Numero\t@Y\@tempdimc |
| 524 |
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces} |
| 525 |
\def\DivVect#1by#2to#3{\ModAndDirOfVect#2to\@Mod and\@Dir |
| 526 |
\DividE\p@ by\@Mod\p@ to\@Mod \ConjVect\@Dir to\@Dir |
| 527 |
\ScaleVect#1by\@Mod to\@tempa |
| 528 |
\MultVect\@tempa by\@Dir to#3\ignorespaces}% |
| 529 |
\def\Arc(#1)(#2)#3{\begingroup |
| 530 |
\@tdA=#3\p@ |
| 531 |
\unless\ifdim\@tdA=\z@ |
| 532 |
\@Arc(#1)(#2)% |
| 533 |
\fi |
| 534 |
\endgroup\ignorespaces}% |
| 535 |
\def\@Arc(#1)(#2){% |
| 536 |
\ifdim\@tdA>\z@ |
| 537 |
\let\Segno+% |
| 538 |
\else |
| 539 |
\@tdA=-\@tdA \let\Segno-% |
| 540 |
\fi |
| 541 |
\Numero\@gradi\@tdA |
| 542 |
\ifdim\@tdA>360\p@ |
| 543 |
\PackageWarning{curve2e}{The arc aperture is \@gradi\space degrees |
| 544 |
and gets reduced\MessageBreak% |
| 545 |
to the range 0--360 taking the sign into consideration}% |
| 546 |
\@whiledim\@tdA>360\p@\do{\advance\@tdA-360\p@}% |
| 547 |
\fi |
| 548 |
\SubVect#2from#1to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun |
| 549 |
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY |
| 550 |
\@@Arc |
| 551 |
\strokepath\ignorespaces}% |
| 552 |
\def\@@Arc{% |
| 553 |
\pIIe@moveto{\@pPunX\unitlength}{\@pPunY\unitlength}% |
| 554 |
\ifdim\@tdA>180\p@ |
| 555 |
\advance\@tdA-180\p@ |
| 556 |
\Numero\@gradi\@tdA |
| 557 |
\SubVect\@pPun from\@Cent to\@V |
| 558 |
\AddVect\@V and\@Cent to\@sPun |
| 559 |
\MultVect\@V by0,-1.3333333to\@V \if\Segno-\ScaleVect\@V by-1to\@V\fi |
| 560 |
\AddVect\@pPun and\@V to\@pcPun |
| 561 |
\AddVect\@sPun and\@V to\@scPun |
| 562 |
\GetCoord(\@pcPun)\@pcPunX\@pcPunY |
| 563 |
\GetCoord(\@scPun)\@scPunX\@scPunY |
| 564 |
\GetCoord(\@sPun)\@sPunX\@sPunY |
| 565 |
\pIIe@curveto{\@pcPunX\unitlength}{\@pcPunY\unitlength}% |
| 566 |
{\@scPunX\unitlength}{\@scPunY\unitlength}% |
| 567 |
{\@sPunX\unitlength}{\@sPunY\unitlength}% |
| 568 |
\CopyVect\@sPun to\@pPun |
| 569 |
\fi |
| 570 |
\ifdim\@tdA>\z@ |
| 571 |
\DirFromAngle\@gradi to\@Dir \if\Segno-\ConjVect\@Dir to\@Dir \fi |
| 572 |
\SubVect\@Cent from\@pPun to\@V |
| 573 |
\MultVect\@V by\@Dir to\@V |
| 574 |
\AddVect\@Cent and\@V to\@sPun |
| 575 |
\@tdA=.5\@tdA \Numero\@gradi\@tdA |
| 576 |
\DirFromAngle\@gradi to\@Phimezzi |
| 577 |
\GetCoord(\@Phimezzi)\@cosphimezzi\@sinphimezzi |
| 578 |
\@tdB=1.3333333\p@ \@tdB=\@Raggio\@tdB |
| 579 |
\@tdC=\p@ \advance\@tdC -\@cosphimezzi\p@ \Numero\@tempa\@tdC |
| 580 |
\@tdB=\@tempa\@tdB |
| 581 |
\DividE\@tdB by\@sinphimezzi\p@ to\@cZ |
| 582 |
\ScaleVect\@Phimezzi by\@cZ to\@Phimezzi |
| 583 |
\ConjVect\@Phimezzi to\@mPhimezzi |
| 584 |
\if\Segno-% |
| 585 |
\let\@tempa\@Phimezzi |
| 586 |
\let\@Phimezzi\@mPhimezzi |
| 587 |
\let\@mPhimezzi\@tempa |
| 588 |
\fi |
| 589 |
\SubVect\@sPun from\@pPun to\@V |
| 590 |
\DirOfVect\@V to\@V |
| 591 |
\MultVect\@Phimezzi by\@V to\@Phimezzi |
| 592 |
\AddVect\@sPun and\@Phimezzi to\@scPun |
| 593 |
\ScaleVect\@V by-1to\@V |
| 594 |
\MultVect\@mPhimezzi by\@V to\@mPhimezzi |
| 595 |
\AddVect\@pPun and\@mPhimezzi to\@pcPun |
| 596 |
\GetCoord(\@pcPun)\@pcPunX\@pcPunY |
| 597 |
\GetCoord(\@scPun)\@scPunX\@scPunY |
| 598 |
\GetCoord(\@sPun)\@sPunX\@sPunY |
| 599 |
\pIIe@curveto{\@pcPunX\unitlength}{\@pcPunY\unitlength}% |
| 600 |
{\@scPunX\unitlength}{\@scPunY\unitlength}% |
| 601 |
{\@sPunX\unitlength}{\@sPunY\unitlength}% |
| 602 |
\fi} |
| 603 |
\def\VectorArc(#1)(#2)#3{\begingroup |
| 604 |
\edef\tempG{#3}\@tdA=#3\p@ |
| 605 |
\fptestF{#3=0}{\@VArc(#1)(#2)}}% |
| 606 |
|
| 607 |
\def\VectorARC(#1)(#2)#3{\begingroup |
| 608 |
\edef\tempG{#3}\@tdA=#3\p@ |
| 609 |
\fptestF{#3=0}{\@VArc(#1)(#2)}}% |
| 610 |
|
| 611 |
\def\@VArc(#1)(#2){% |
| 612 |
\fptest{\tempG>\z@}{\let\Segno+}% |
| 613 |
{\edef\tempG={-\tempG}\let\Segno-}% |
| 614 |
\fptestT{\tempG>360}{% |
| 615 |
\PackageWarning{curve2e}{The arc aperture is \tempG\space degrees |
| 616 |
and gets reduced^^J% |
| 617 |
to the range 0--360 taking the sign into |
| 618 |
consideration}% |
| 619 |
\edef\tempG{\Modulo{\tempG}{360}}}% |
| 620 |
\@tdA=\tempG\p@ |
| 621 |
\Numero\@gradi\@tdA |
| 622 |
\SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun |
| 623 |
\@tdE=\pIIe@FAW\@wholewidth \@tdE=\pIIe@FAL\@tdE |
| 624 |
\DividE\@tdE by \@Raggio\unitlength to\DeltaGradi |
| 625 |
\@tdD=\DeltaGradi\p@ |
| 626 |
\@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD |
| 627 |
\@tdD=\ifx\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD |
| 628 |
\DirFromAngle\@tempa to\@Dir |
| 629 |
\MultVect\@V by\@Dir to\@sPun |
| 630 |
\edef\@tempA{\ifx\Segno--\@ne\fi}% |
| 631 |
\MultVect\@sPun by 0,\@tempA to\@vPun |
| 632 |
\DirOfVect\@vPun to\@Dir |
| 633 |
\AddVect\@sPun and #1 to \@sPun |
| 634 |
\GetCoord(\@sPun)\@tdX\@tdY |
| 635 |
\@tdD\ifx\Segno--\fi\DeltaGradi\p@ |
| 636 |
\@tdD=0.5\@tdD \Numero\DeltaGradi\@tdD |
| 637 |
\DirFromAngle\DeltaGradi to\@Dird |
| 638 |
\MultVect\@Dir by*\@Dird to\@Dir |
| 639 |
\GetCoord(\@Dir)\@xnum\@ynum |
| 640 |
\put(\@tdX,\@tdY){\vector(\@xnum,\@ynum){0}}% |
| 641 |
\@tdE =\ifx\Segno--\fi\DeltaGradi\p@ |
| 642 |
\advance\@tdA -\@tdE \Numero\@gradi\@tdA |
| 643 |
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY |
| 644 |
\@@Arc\strokepath\endgroup\ignorespaces}% |
| 645 |
|
| 646 |
\def\@VARC(#1)(#2){% |
| 647 |
\fptest{\tempG>\z@}{\let\Segno+}% |
| 648 |
{\edef\tempG={-\tempG}\let\Segno-}% |
| 649 |
\@tdA=\tempG\p@ |
| 650 |
\Numero\@gradi\@tdA |
| 651 |
\fptestT{\tempG>360}{% |
| 652 |
\PackageWarning{curve2e}{The arc aperture is \tempG\space degrees |
| 653 |
and gets reduced^^J% |
| 654 |
to the range 0--360 taking the sign into |
| 655 |
consideration}% |
| 656 |
\edef\tempG{\Modulo{\tempG}{360}}% |
| 657 |
} |
| 658 |
\SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun |
| 659 |
\@tdE=\pIIe@FAW\@wholewidth \@tdE=0.8\@tdE |
| 660 |
\DividE\@tdE by \@Raggio\unitlength to\DeltaGradi |
| 661 |
\@tdD=\DeltaGradi\p@ \@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD |
| 662 |
\@tdD=\if\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD |
| 663 |
\DirFromAngle\@tempa to\@Dir |
| 664 |
\MultVect\@V by\@Dir to\@sPun% corrects the end point |
| 665 |
\edef\@tempA{\if\Segno--\fi1}% |
| 666 |
\MultVect\@sPun by 0,\@tempA to\@vPun |
| 667 |
\DirOfVect\@vPun to\@Dir |
| 668 |
\AddVect\@sPun and #1 to \@sPun |
| 669 |
\GetCoord(\@sPun)\@tdX\@tdY |
| 670 |
\@tdD\if\Segno--\fi\DeltaGradi\p@ |
| 671 |
\@tdD=.5\@tdD \Numero\@tempB\@tdD |
| 672 |
\DirFromAngle\@tempB to\@Dird |
| 673 |
\MultVect\@Dir by*\@Dird to\@Dir |
| 674 |
\GetCoord(\@Dir)\@xnum\@ynum |
| 675 |
\put(\@tdX,\@tdY){\vector(\@xnum,\@ynum){0}}% end point arrowt ip |
| 676 |
\@tdE =\DeltaGradi\p@ |
| 677 |
\advance\@tdA -2\@tdE \Numero\@gradi\@tdA |
| 678 |
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY |
| 679 |
\SubVect\@Cent from\@pPun to \@V |
| 680 |
\edef\@tempa{\if\Segno-\else-\fi\@ne}% |
| 681 |
\MultVect\@V by0,\@tempa to\@vPun |
| 682 |
\@tdE\if\Segno--\fi\DeltaGradi\p@ |
| 683 |
\Numero\@tempB{0.5\@tdE}% |
| 684 |
\DirFromAngle\@tempB to\@Dird |
| 685 |
\MultVect\@vPun by\@Dird to\@vPun% corrects the starting point |
| 686 |
\DirOfVect\@vPun to\@Dir\GetCoord(\@Dir)\@xnum\@ynum |
| 687 |
\put(\@pPunX,\@pPunY){\vector(\@xnum,\@ynum){0}}% starting point arrow tip |
| 688 |
\edef\@tempa{\if\Segno--\fi\DeltaGradi}% |
| 689 |
\DirFromAngle\@tempa to \@Dir |
| 690 |
\SubVect\@Cent from\@pPun to\@V |
| 691 |
\MultVect\@V by\@Dir to\@V |
| 692 |
\AddVect\@Cent and\@V to\@pPun |
| 693 |
\GetCoord(\@pPun)\@pPunX\@pPunY |
| 694 |
\@@Arc |
| 695 |
\strokepath\ignorespaces}% |
| 696 |
\def\CurveBetween#1and#2WithDirs#3and#4{% |
| 697 |
\StartCurveAt#1WithDir{#3}\relax |
| 698 |
\CurveTo#2WithDir{#4}\CurveFinish\ignorespaces}% |
| 699 |
\def\StartCurveAt#1WithDir#2{% |
| 700 |
\begingroup |
| 701 |
\GetCoord(#1)\@tempa\@tempb |
| 702 |
\CopyVect\@tempa,\@tempb to\@Pzero |
| 703 |
\pIIe@moveto{\@tempa\unitlength}{\@tempb\unitlength}% |
| 704 |
\GetCoord(#2)\@tempa\@tempb |
| 705 |
\CopyVect\@tempa,\@tempb to\@Dzero |
| 706 |
\DirOfVect\@Dzero to\@Dzero |
| 707 |
\ignorespaces} |
| 708 |
\def\ChangeDir<#1>{% |
| 709 |
\GetCoord(#1)\@tempa\@tempb |
| 710 |
\CopyVect\@tempa,\@tempb to\@Dzero |
| 711 |
\DirOfVect\@Dzero to\@Dzero |
| 712 |
\ignorespaces} |
| 713 |
\def\CurveFinish{\strokepath\endgroup\ignorespaces}% |
| 714 |
\def\FillCurve{\fillpath\endgroup\ignorespaces} |
| 715 |
\def\CurveEnd{\fillstroke\endgroup\ignorespaces} |
| 716 |
\def\CbezierTo#1WithDir#2AndDists#3And#4{% |
| 717 |
\GetCoord(#1)\@tX\@tY \MakeVectorFrom\@tX\@tY to\@Puno |
| 718 |
\GetCoord(#2)\@tX\@tY \MakeVectorFrom\@tX\@tY to \@Duno |
| 719 |
\DirOfVect\@Duno to\@Duno |
| 720 |
\ScaleVect\@Dzero by#3to\@Czero \AddVect\@Pzero and\@Czero to\@Czero |
| 721 |
\ScaleVect\@Duno by-#4to \@Cuno \AddVect\@Puno and\@Cuno to \@Cuno |
| 722 |
\GetCoord(\@Czero)\@XCzero\@YCzero |
| 723 |
\GetCoord(\@Cuno)\@XCuno\@YCuno |
| 724 |
\GetCoord(\@Puno)\@XPuno\@YPuno |
| 725 |
\pIIe@curveto{\@XCzero\unitlength}{\@YCzero\unitlength}% |
| 726 |
{\@XCuno\unitlength}{\@YCuno\unitlength}% |
| 727 |
{\@XPuno\unitlength}{\@YPuno\unitlength}% |
| 728 |
\CopyVect\@Puno to\@Pzero |
| 729 |
\CopyVect\@Duno to\@Dzero |
| 730 |
\ignorespaces}% |
| 731 |
\def\CbezierBetween#1And#2WithDirs#3And#4UsingDists#5And#6{% |
| 732 |
\StartCurveAt#1WithDir{#3}\relax |
| 733 |
\CbezierTo#2WithDir#4AndDists#5And{#6}\CurveFinish} |
| 734 |
|
| 735 |
\def\@isTension#1;#2!!{\def\@tempA{#1}% |
| 736 |
\def\@tempB{#2}\unless\ifx\@tempB\empty\strip@semicolon#2\fi} |
| 737 |
\def\strip@semicolon#1;{\def\@tempB{#1}} |
| 738 |
\def\CurveTo#1WithDir#2{% |
| 739 |
\def\@Tuno{1}\def\@Tzero{1}\relax |
| 740 |
\edef\@Puno{#1}\@isTension#2;!!% |
| 741 |
\expandafter\DirOfVect\@tempA to\@Duno |
| 742 |
\bgroup\unless\ifx\@tempB\empty\GetCoord(\@tempB)\@Tzero\@Tuno\fi |
| 743 |
\DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord |
| 744 |
\MultVect\@Dzero by*\@DirChord to \@Dpzero |
| 745 |
\MultVect\@Duno by*\@DirChord to \@Dpuno |
| 746 |
\GetCoord(\@Dpzero)\@DXpzero\@DYpzero |
| 747 |
\GetCoord(\@Dpuno)\@DXpuno\@DYpuno |
| 748 |
\DivideFN\@Chord by2 to\@semichord |
| 749 |
\ifdim\@DXpzero\p@=\z@ |
| 750 |
\@tdA=1.333333\p@ |
| 751 |
\Numero\@KCzero{\@semichord\@tdA}% |
| 752 |
\fi |
| 753 |
\ifdim\@DYpzero\p@=\z@ |
| 754 |
\@tdA=1.333333\p@ |
| 755 |
\Numero\@Kpzero{\@semichord\@tdA}% |
| 756 |
\fi |
| 757 |
\unless\ifdim\@DXpzero\p@=\z@ |
| 758 |
\unless\ifdim\@DYpzero\p@=\z@ |
| 759 |
\edef\@CosDzero{\ifdim\@DXpzero\p@<\z@ -\fi\@DXpzero}% |
| 760 |
\edef\@SinDzero{\ifdim\@DYpzero\p@<\z@ -\fi\@DYpzero}% |
| 761 |
\@tdA=\@semichord\p@ \@tdA=1.333333\@tdA |
| 762 |
\DividE\@tdA by\@SinDzero\p@ to \@KCzero |
| 763 |
\@tdA=\dimexpr(\p@-\@CosDzero\p@)\relax |
| 764 |
\DividE\@KCzero\@tdA by\@SinDzero\p@ to \@KCzero |
| 765 |
\fi |
| 766 |
\fi |
| 767 |
\MultiplyFN\@KCzero by \@Tzero to \@KCzero |
| 768 |
\ScaleVect\@Dzero by\@KCzero to\@CPzero |
| 769 |
\AddVect\@Pzero and\@CPzero to\@CPzero |
| 770 |
\ifdim\@DXpuno\p@=\z@ |
| 771 |
\@tdA=-1.333333\p@ |
| 772 |
\Numero\@KCuno{\@semichord\@tdA}% |
| 773 |
\fi |
| 774 |
\ifdim\@DYpuno\p@=\z@ |
| 775 |
\@tdA=-1.333333\p@ |
| 776 |
\Numero\@KCuno{\@semichord\@tdA}% |
| 777 |
\fi |
| 778 |
\unless\ifdim\@DXpuno\p@=\z@ |
| 779 |
\unless\ifdim\@DYpuno\p@=\z@ |
| 780 |
\edef\@CosDuno{\ifdim\@DXpuno\p@<\z@ -\fi\@DXpuno}% |
| 781 |
\edef\@SinDuno{\ifdim\@DYpuno\p@<\z@ -\fi\@DYpuno}% |
| 782 |
\@tdA=\@semichord\p@ \@tdA=-1.333333\@tdA |
| 783 |
\DividE\@tdA by \@SinDuno\p@ to \@KCuno |
| 784 |
\@tdA=\dimexpr(\p@-\@CosDuno\p@)\relax |
| 785 |
\DividE\@KCuno\@tdA by\@SinDuno\p@ to \@KCuno |
| 786 |
\fi |
| 787 |
\fi |
| 788 |
\MultiplyFN\@KCuno by \@Tuno to \@KCuno |
| 789 |
\ScaleVect\@Duno by\@KCuno to\@CPuno |
| 790 |
\AddVect\@Puno and\@CPuno to\@CPuno |
| 791 |
\GetCoord(\@Puno)\@XPuno\@YPuno |
| 792 |
\GetCoord(\@CPzero)\@XCPzero\@YCPzero |
| 793 |
\GetCoord(\@CPuno)\@XCPuno\@YCPuno |
| 794 |
\pIIe@curveto{\@XCPzero\unitlength}{\@YCPzero\unitlength}% |
| 795 |
{\@XCPuno\unitlength}{\@YCPuno\unitlength}% |
| 796 |
{\@XPuno\unitlength}{\@YPuno\unitlength}\egroup |
| 797 |
\CopyVect\@Puno to\@Pzero |
| 798 |
\CopyVect\@Duno to\@Dzero |
| 799 |
\ignorespaces}% |
| 800 |
\def\Curve{\@ifstar{\let\fillstroke\fillpath\Curve@}% |
| 801 |
{\let\fillstroke\strokepath\Curve@}} |
| 802 |
\def\Curve@(#1)<#2>{% |
| 803 |
\StartCurveAt#1WithDir{#2}% |
| 804 |
\@ifnextchar\lp@r\@Curve{% |
| 805 |
\PackageWarning{curve2e}{% |
| 806 |
Curve specifications must contain at least two nodes!\MessageBreak |
| 807 |
Please, control your Curve specifications\MessageBreak}}} |
| 808 |
|
| 809 |
\def\@Curve(#1)<#2>{% |
| 810 |
\CurveTo#1WithDir{#2}% |
| 811 |
\@ifnextchar\lp@r\@Curve{% |
| 812 |
\@ifnextchar[\@ChangeDir\CurveEnd}} |
| 813 |
\def\@ChangeDir[#1]{\ChangeDir<#1>\@Curve} |
| 814 |
\def\Qurve{\@ifstar{\let\fillstroke\fillpath\Qurve@}% |
| 815 |
{\let\fillstroke\strokepath\Qurve@}} |
| 816 |
|
| 817 |
\def\Qurve@(#1)<#2>{% |
| 818 |
\StartCurveAt#1WithDir{#2}% |
| 819 |
\@ifnextchar\lp@r\@Qurve{% |
| 820 |
\PackageWarning{curve2e}{% |
| 821 |
Quadratic curve specifications must contain at least |
| 822 |
two nodes!\MessageBreak |
| 823 |
Please, control your Qurve specifications\MessageBreak}}}% |
| 824 |
\def\@Qurve(#1)<#2>{\QurveTo#1WithDir{#2}% |
| 825 |
\@ifnextchar\lp@r\@Qurve{% |
| 826 |
\@ifnextchar[\@ChangeQDir\CurveEnd}}% |
| 827 |
\def\@ChangeQDir[#1]{\ChangeDir<#1>\@Qurve}% |
| 828 |
\def\QurveTo#1WithDir#2{% |
| 829 |
\edef\@Puno{#1}\DirOfVect#2to\@Duno\bgroup |
| 830 |
\DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord |
| 831 |
\MultVect\@Dzero by*\@Duno to \@Scalar |
| 832 |
\YpartOfVect\@Scalar to \@YScalar |
| 833 |
\ifdim\@YScalar\p@=\z@ |
| 834 |
\PackageWarning{curve2e}% |
| 835 |
{Quadratic Bezier arcs cannot have their starting\MessageBreak |
| 836 |
and ending directions parallel or antiparallel with\MessageBreak |
| 837 |
each other. This arc is skipped and replaced with |
| 838 |
a dotted line.\MessageBreak}% |
| 839 |
\Dotline(\@Pzero)(\@Puno){2}\relax |
| 840 |
\else |
| 841 |
\MultVect\@Dzero by*\@DirChord to \@Dpzero |
| 842 |
\MultVect\@Duno by*\@DirChord to \@Dpuno |
| 843 |
\GetCoord(\@Dpzero)\@DXpzero\@DYpzero |
| 844 |
\GetCoord(\@Dpuno)\@DXpuno\@DYpuno |
| 845 |
\MultiplyFN\@DXpzero by\@DXpuno to\@XXD |
| 846 |
\MultiplyFN\@DYpzero by\@DYpuno to\@YYD |
| 847 |
\unless\ifdim\@YYD\p@<\z@\ifdim\@XXD\p@<\z@ |
| 848 |
\PackageWarning{curve2e}% |
| 849 |
{Quadratic Bezier arcs cannot have inflection points\MessageBreak |
| 850 |
Therefore the tangents to the starting and ending arc\MessageBreak |
| 851 |
points cannot be directed to the same half plane.\MessageBreak |
| 852 |
This arc is skipped and replaced by a dotted line\MessageBreak}% |
| 853 |
\Dotline(\@Pzero)(\@Puno){2}\fi |
| 854 |
\else |
| 855 |
\edef\@CDzero{\@DXpzero}\relax |
| 856 |
\edef\@SDzero{\@DYpzero}\relax |
| 857 |
\edef\@CDuno{\@DXpuno}\relax |
| 858 |
\edef\@SDuno{\@DYpuno}\relax |
| 859 |
\MultiplyFN\@SDzero by\@CDuno to\@tempA |
| 860 |
\MultiplyFN\@SDuno by\@CDzero to\@tempB |
| 861 |
\edef\@tempA{\strip@pt\dimexpr\@tempA\p@-\@tempB\p@}\relax |
| 862 |
\@tdA=\@SDuno\p@ \@tdB=\@Chord\p@ \@tdC=\@tempA\p@ |
| 863 |
\edef\@tempC{\strip@pt\dimexpr \@tdA*\@tdB/\@tdC}\relax |
| 864 |
\MultiplyFN\@tempC by\@CDzero to \@XC |
| 865 |
\MultiplyFN\@tempC by\@SDzero to \@YC |
| 866 |
\ModOfVect\@XC,\@YC to\@KC |
| 867 |
\ScaleVect\@Dzero by\@KC to\@CP |
| 868 |
\AddVect\@Pzero and\@CP to\@CP |
| 869 |
\GetCoord(\@Pzero)\@XPzero\@YPzero |
| 870 |
\GetCoord(\@Puno)\@XPuno\@YPuno |
| 871 |
\GetCoord(\@CP)\@XCP\@YCP |
| 872 |
\@ovxx=\@XPzero\unitlength \@ovyy=\@YPzero\unitlength |
| 873 |
\@ovdx=\@XCP\unitlength \@ovdy=\@YCP\unitlength |
| 874 |
\@xdim=\@XPuno\unitlength \@ydim=\@YPuno\unitlength |
| 875 |
\pIIe@bezier@QtoC\@ovxx\@ovdx\@ovro |
| 876 |
\pIIe@bezier@QtoC\@ovyy\@ovdy\@ovri |
| 877 |
\pIIe@bezier@QtoC\@xdim\@ovdx\@clnwd |
| 878 |
\pIIe@bezier@QtoC\@ydim\@ovdy\@clnht |
| 879 |
\pIIe@moveto\@ovxx\@ovyy |
| 880 |
\pIIe@curveto\@ovro\@ovri\@clnwd\@clnht\@xdim\@ydim |
| 881 |
\fi\fi\egroup |
| 882 |
\CopyVect\@Puno to\@Pzero |
| 883 |
\CopyVect\@Duno to\@Dzero |
| 884 |
\ignorespaces} |
| 885 |
|
| 886 |
|
| 887 |
%% |
| 888 |
%% Distributable under the LaTeX Project Public |
| 889 |
%% License, version 1.3c or higher (your choice). |
| 890 |
%% The latest version of this license is at: |
| 891 |
%% http://www.latex-project.org/lppl.txt |
| 892 |
%% |
| 893 |
%% This work is "maintained" |
| 894 |
%% |
| 895 |
%% This work consists of file curve2e.dtx, and the |
| 896 |
%% derived files curve2e.sty and curve2e.pdf, plus |
| 897 |
%% the auxiliary derived files README.txt and |
| 898 |
%% curve2e-v161.sty. |
| 899 |
%% |
| 900 |
%% |
| 901 |
%% End of file `curve2e-v161.sty'. |