%%
%% This is file `curve2e.sty',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% curve2e.dtx  (with options: `package')
%% 
%%   Copyright (C)  2005--2020 Claudio Beccari  all rights reserved.
%%   License information appended
%% 
\NeedsTeXFormat{LaTeX2e}[2019/01/01]
\ProvidesPackage{curve2e}%
        [2020-01-29 v.2.2.1 Extension package for pict2e]
\IfFileExists{xfp.sty}{%
  \RequirePackage{color}
  \RequirePackageWithOptions{pict2e}[2014/01/01]
  \@ifl@aded{sty}{xparse}{}{\RequirePackage{xparse}}
  \@ifl@aded{sty}{xfp}{}{\RequirePackage{xfp}}%
}{%
    \RequirePackage{curve2e-v161}%
    \PackageWarningNoLine{curve2e}{%
      Package xfp is required, but apparently\MessageBreak%
      such package cannot be found in this \MessageBreak%
      TeX system installation\MessageBreak%
      Either your installation is not complete \MessageBreak%
      or it is older than 2018-10-17.\MessageBreak%
      \MessageBreak%
      ***************************************\MessageBreak%
      Version 1.61 of curve2e has been loaded\MessageBreak%
      instead of the current version\MessageBreak%
      ***************************************\MessageBreak}%
      \endinput
}
\ExplSyntaxOn
\AtBeginDocument{%
\ProvideExpandableDocumentCommand\fptest{m m m}{%
   \fp_compare:nTF{#1}{#2}{#3}}
\ProvideExpandableDocumentCommand\fpdowhile{m m}{%
   \fp_do_while:nn{#1}{#2}}
}
\ExplSyntaxOff

\def\TRON{\tracingcommands\tw@ \tracingmacros\tw@}%
\def\TROF{\tracingcommands\z@ \tracingmacros\z@}%
\ifx\undefined\@tdA \newdimen\@tdA \fi
\ifx\undefined\@tdB \newdimen\@tdB \fi
\ifx\undefined\@tdC \newdimen\@tdC \fi
\ifx\undefined\@tdD \newdimen\@tdD \fi
\ifx\undefined\@tdE \newdimen\@tdE \fi
\ifx\undefined\@tdF \newdimen\@tdF \fi
\ifx\undefined\defaultlinewidth \newdimen\defaultlinewidth \fi
\gdef\linethickness#1{%
\@wholewidth#1\@halfwidth.5\@wholewidth\ignorespaces}%
\newcommand\defaultlinethickness[1]{\defaultlinewidth=#1\relax
\def\thicklines{\linethickness{\defaultlinewidth}}%
\def\thinlines{\linethickness{.5\defaultlinewidth}}\thinlines
   \ignorespaces}%
\def\LIne(#1){{\GetCoord(#1)\@tX\@tY
  \moveto(0,0)
  \pIIe@lineto{\@tX\unitlength}{\@tY\unitlength}\strokepath}\ignorespaces
}%
\def\segment(#1)(#2){\@killglue\polyline(#1)(#2)}%
\def\line(#1)#2{\begingroup
  \@linelen #2\unitlength
  \ifdim\@linelen<\z@\@badlinearg\else
    \expandafter\DirOfVect#1to\Dir@line
    \GetCoord(\Dir@line)\d@mX\d@mY
    \ifdim\d@mX\p@=\z@\else
      \edef\sc@lelen{\fpeval{1 / abs(\d@mX)}}\relax
      \@linelen=\sc@lelen\@linelen
    \fi
    \moveto(0,0)\pIIe@lineto{\d@mX\@linelen}{\d@mY\@linelen}%
    \strokepath
  \fi
\endgroup\ignorespaces}%
\let\originalmoveto\moveto
\let\originallineto\lineto
\let\originalcurveto\curveto

\def\moveto(#1){\GetCoord(#1)\MTx\MTy
  \originalmoveto(\MTx,\MTy)\ignorespaces}
\def\lineto(#1){\GetCoord(#1)\LTx\LTy
  \originallineto(\LTx,\LTy)\ignorespaces}
\def\curveto(#1)(#2)(#3){\GetCoord(#1)\CTpx\CTpy
  \GetCoord(#2)\CTsx\CTsy\GetCoord(#3)\CTx\CTy
  \originalcurveto(\CTpx,\CTpy)(\CTsx,\CTsy)(\CTx,\CTy)\ignorespaces}

\def\IsPolar#1:#2?{\def\@TempOne{#2}\unless\ifx\@TempOne\empty
   \expandafter\@firstoftwo\else
   \expandafter\@secondoftwo\fi}

\ifx\Dashline\undefined
  \def\Dashline{\@ifstar{\Dashline@}{\Dashline@}}% bckwd compatibility
  \let\Dline\Dashline

  \def\Dashline@(#1)(#2)#3{\put(#1){%
   \GetCoord(#1)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttA
   \GetCoord(#2)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttB
   \IsPolar#2:?{%                        Polar
      \Dashline@@(0,0)(\V@ttB){#3}}%
   {%                                    Cartesian
     \SubVect\V@ttA from\V@ttB to\V@ttC
     \Dashline@@(0,0)(\V@ttC){#3}%
   }
}}

  \def\Dashline@@(#1)(#2)#3{%
   \countdef\NumA3254\countdef\NumB3252\relax
   \GetCoord(#1)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttA
   \GetCoord(#2)\@tA\@tB \MakeVectorFrom\@tA\@tB to\V@ttB
   \SubVect\V@ttA from\V@ttB to\V@ttC
   \ModOfVect\V@ttC to\DlineMod
   \DivideFN\DlineMod by#3 to\NumD
   \NumA=\fpeval{trunc(\NumD,0)}\relax
   \unless\ifodd\NumA\advance\NumA\@ne\fi
   \NumB=\NumA \divide\NumB\tw@
   \DividE\DlineMod\p@ by\NumA\p@ to\D@shMod
   \DividE\p@ by\NumA\p@ to \@tempa
   \Multvect{\V@ttC}{\@tempa,0}\V@ttB
   \Multvect{\V@ttB}{2,0}\V@ttC
   \advance\NumB\@ne
   \put(\V@ttA){\multiput(0,0)(\V@ttC){\NumB}{\LIne(\V@ttB)}}
   \ignorespaces}
\fi
\ifx\Dotline\undefined
  \providecommand\Dotline{}
  \RenewDocumentCommand\Dotline{R(){0,0} R(){1,0} m O{1mm}}{%
  \put(#1){\edef\Diam{\fpeval{{#4}/\unitlength}}%
  \IsPolar#2:?{\CopyVect#2to\DirDot}%
              {\SubVect#1from#2to\DirDot}%
  \countdef\NumA=3254\relax
  \ModAndAngleOfVect\DirDot to\ModDirDot and\AngDirDot
  \edef\NumA{\fpeval{trunc(\ModDirDot/{#3},0)}}%
  \edef\ModDirDot{\fpeval{\ModDirDot/\NumA}}%
  \multiput(0,0)(\AngDirDot:\ModDirDot){\inteval{\NumA+1}}%
    {\makebox(0,0){\circle*{\Diam}}}}\ignorespaces}
\fi
\AtBeginDocument{\@ifpackageloaded{eso-pic}{%
\renewcommand\LenToUnit[1]{\strip@pt\dimexpr#1*\p@/\unitlength}}{}}%
\def\GetCoord(#1)#2#3{\bgroup\edef\x{\egroup\noexpand\IsPolar#1:?}\x
{% Polar
  \bgroup\edef\x{\egroup\noexpand\SplitPolar(#1)}\x\SCt@X\SCt@Y}%
{% Cartesian
  \bgroup\edef\x{\egroup\noexpand\SplitCartesian(#1)}\x\SCt@X\SCt@Y}%
  \edef#2{\SCt@X}\edef#3{\SCt@Y}\ignorespaces}

\def\SplitPolar(#1:#2)#3#4{%
  \edef#3{\fpeval{#2 * cosd#1}}\edef#4{\fpeval{#2 * sind#1}}}

\def\SplitCartesian(#1,#2)#3#4{\edef#3{#1}\edef#4{#2}}

\let\originalput\put
\def\put(#1){\bgroup\GetCoord(#1)\@tX\@tY
\edef\x{\noexpand\egroup\noexpand\originalput(\@tX,\@tY)}\x}
\RenewDocumentCommand{\multiput}{O{0,0} d() d() m m o }{%
  \IfNoValueTF{#2}{\PackageError{curve2e}%
      {\string\multiput\space initial point coordinates missing}%
      {Nothing done}
    }%
    {\IfNoValueTF{#3}{\PackageError{curve2e}
      {\string\multiput\space Increment components missing}%
      {Nothing done}
    }
    {\put(#1){\let\c@multicnt\@multicnt
      \CopyVect #2 to \R
      \CopyVect#3 to\D
        \@multicnt=#4\relax
        \@whilenum \@multicnt > \z@\do{%
          \put(\R){#5}%
          \IfValueTF{#6}{#6}{\AddVect#3 and\R to \R}%
          \advance\@multicnt\m@ne
        }
      }
    }
  }\ignorespaces
}
\NewDocumentCommand{\xmultiput}{O{0,0} d() d() m m o }{%
\IfNoValueTF{#2}{\PackageError{curve2e}{%
  \string\Xmultiput\space initial point coordinates missing}%
  {Nothing done}}%
  {\IfNoValueTF{#3}{\PackageError{curve2e}{%
    \string\Xmultiput\space Increment components missing}%
    {Nothing done}}%
  {\put(#1)%
  {\let\c@multicnt\@multicnt
  \CopyVect #2 to \R
  \CopyVect #3 to \D
    \@multicnt=\@ne
      \fpdowhile{\value{multicnt} < \inteval{#4+1}}% Test
         {%
         \put(\R){#5}
         \IfValueTF{#6}{#6}{%
           \AddVect#3 and\R to \R}
           \advance\@multicnt\@ne
      }
    }
  }}\ignorespaces
}
  \def\vector(#1)#2{%
    \begingroup
      \GetCoord(#1)\d@mX\d@mY
      \@linelen#2\unitlength
      \ifdim\d@mX\p@=\z@\ifdim\d@mY\p@=\z@\@badlinearg\fi\fi
      \ifdim\@linelen<\z@ \@linelen=-\@linelen\fi
      \MakeVectorFrom\d@mX\d@mY to\@Vect
      \DirOfVect\@Vect to\Dir@Vect
        \YpartOfVect\Dir@Vect to\@ynum \@ydim=\@ynum\p@
        \XpartOfVect\Dir@Vect to\@xnum \@xdim=\@xnum\p@
        \ifdim\d@mX\p@=\z@
        \else\ifdim\d@mY\p@=\z@
          \else
            \edef\sc@lelen{\fpeval{1 / abs(\@xnum)}}\relax
            \@linelen=\sc@lelen\@linelen
          \fi
        \fi
      \@tdB=\@linelen
\pIIe@concat\@xdim\@ydim{-\@ydim}\@xdim{\@xnum\@linelen}{\@ynum\@linelen}%
        \@linelen\z@
        \pIIe@vector
        \fillpath
      \@linelen=\@tdB
      \@tdA=\pIIe@FAW\@wholewidth
      \@tdA=\pIIe@FAL\@tdA
      \advance\@linelen-\@tdA
      \ifdim\@linelen>\z@
        \moveto(0,0)
        \pIIe@lineto{\@xnum\@linelen}{\@ynum\@linelen}%
        \strokepath\fi
    \endgroup}
\def\Vector(#1){{%
\GetCoord(#1)\@tX\@tY
\ifdim\@tX\p@=\z@
  \vector(\@tX,\@tY){\@tY}%
\else
  \vector(\@tX,\@tY){\@tX}%
\fi}}
\def\VECTOR(#1)(#2){\begingroup
\SubVect#1from#2to\@tempa
\expandafter\put\expandafter(#1){\expandafter\Vector\expandafter(\@tempa)}%
\endgroup\ignorespaces}
\def\VVECTOR(#1)(#2){{\SubVect#1from#2to\@tempb
\ScaleVect\@tempb by0.5to\@tempb
\AddVect\@tempb and#1to\@tempb
\VECTOR(\@tempb)(#2)\VECTOR(\@tempb)(#1)}\ignorespaces}
\let\lp@r( \let\rp@r)
\renewcommand*\polyline[1][\beveljoin]{\p@lylin@[#1]}

\def\p@lylin@[#1](#2){\@killglue#1\GetCoord(#2)\d@mX\d@mY
    \pIIe@moveto{\d@mX\unitlength}{\d@mY\unitlength}%
    \@ifnextchar\lp@r{\p@lyline}{%
    \PackageWarning{curve2e}%
    {Polylines require at least two vertices!\MessageBreak
     Control your polyline specification\MessageBreak}%
    \ignorespaces}}

\def\p@lyline(#1){\GetCoord(#1)\d@mX\d@mY
    \pIIe@lineto{\d@mX\unitlength}{\d@mY\unitlength}%
    \@ifnextchar\lp@r{\p@lyline}{\strokepath\ignorespaces}}
\providecommand\polygon{}
\RenewDocumentCommand\polygon{s O{\beveljoin} }{\@killglue\begingroup
\IfBooleanTF{#1}{\@tempswatrue}{\@tempswafalse}%
\@polygon[#2]}

\def\@polygon[#1](#2){\@killglue#1\GetCoord(#2)\d@mX\d@mY
    \pIIe@moveto{\d@mX\unitlength}{\d@mY\unitlength}%
    \@ifnextchar\lp@r{\@@polygon}{%
    \PackageWarning{curve2e}%
    {Polygons require at least two vertices!\MessageBreak
     Control your polygon specification\MessageBreak}%
    \ignorespaces}}

  \def\@@polygon(#1){\GetCoord(#1)\d@mX\d@mY
    \pIIe@lineto{\d@mX\unitlength}{\d@mY\unitlength}%
    \@ifnextchar\lp@r{\@@polygon}{\pIIe@closepath
      \if@tempswa\pIIe@fillGraph\else\pIIe@strokeGraph\fi
      \endgroup
      \ignorespaces}}

\def\Gr@phGrid(#1,#2){\bgroup\textcolor{red}{\linethickness{.1\p@}%
\RoundUp#1modulo10to\@GridWd \RoundUp#2modulo10to\@GridHt
\@tempcnta=\@GridWd \divide\@tempcnta10\relax \advance\@tempcnta\@ne
\multiput(0,0)(10,0){\@tempcnta}{\line(0,1){\@GridHt}}%
\@tempcnta=\@GridHt \divide\@tempcnta10\advance\@tempcnta\@ne
\multiput(0,0)(0,10){\@tempcnta}{\line(1,0){\@GridWd}}\thinlines}%
\egroup\ignorespaces}
\NewDocumentCommand\GraphGrid{r() d()}{%
\IfValueTF{#2}{\put(#1){\Gr@phGrid(#2)}}%
              {\put(0,0){\Gr@phGrid(#1)}}}

\def\RoundUp#1modulo#2to#3{\expandafter\@tempcnta\Integer#1.??%
\count254\@tempcnta\divide\count254by#2\relax
\multiply\count254by#2\relax
\count252\@tempcnta\advance\count252-\count254
\ifnum\count252>0\advance\count252-#2\relax
\advance\@tempcnta-\count252\fi\edef#3{\number\@tempcnta}\ignorespaces}%
\def\Integer#1.#2??{#1}%

\def\DividE#1by#2to#3{\edef#3{\fpeval{#1 / #2}}}
\let\DivideFN\DividE
\def\MultiplY#1by#2to#3{\edef#3{\fpeval{#1 * #2}}}\relax
\let\MultiplyFN\MultiplY
\unless\ifdefined\Numero
  \def\Numero#1#2{\edef#1{\fpeval{round(#2,6)}}\ignorespaces}%
\fi
\def\SinOf#1to#2{\edef#2{\fpeval{round(sind#1,6)}}}\relax
\def\CosOf#1to#2{\edef#2{\fpeval{round(cosd#1,6)}}}\relax
\def\ArgOfVect#1to#2{\GetCoord(#1){\t@X}{\t@Y}%
\fptest{\t@X=\z@ && \t@Y=\z@}{\edef#2{0}}{%
\edef#2{\fpeval{round(atand(\t@Y,\t@X),6)}}}\ignorespaces}
\def\MakeVectorFrom#1#2to#3{\edef#3{#1,#2}\ignorespaces}%
\def\CopyVect#1to#2{\edef#2{#1}\ignorespaces}%
\def\ModOfVect#1to#2{\GetCoord(#1)\t@X\t@Y
\edef#2{\fpeval{round(sqrt(\t@X*\t@X + \t@Y*\t@Y),6)}}%
\ignorespaces}%
\def\DirOfVect#1to#2{\GetCoord(#1)\t@X\t@Y
\ModOfVect#1to\@tempa
\fptest{\@tempa=\z@}{}{%
  \edef\t@X{\fpeval{round(\t@X/\@tempa,6)}}%
  \edef\t@Y{\fpeval{round(\t@Y/\@tempa,6)}}%
}\MakeVectorFrom\t@X\t@Y to#2\ignorespaces}%
\def\ModAndDirOfVect#1to#2and#3{%
\ModOfVect#1to#2%
\DirOfVect#1to#3\ignorespaces}%
\def\DistanceAndDirOfVect#1minus#2to#3and#4{%
\SubVect#2from#1to\@tempa
\ModAndDirOfVect\@tempa to#3and#4\ignorespaces}%
\def\XpartOfVect#1to#2{%
\GetCoord(#1)#2\@tempa\ignorespaces}%
\def\YpartOfVect#1to#2{%
\GetCoord(#1)\@tempa#2\ignorespaces}%
\def\DirFromAngle#1to#2{%
\edef\t@X{\fpeval{round(cosd#1,6)}}%
\edef\t@Y{\fpeval{round(sind#1,6)}}%
\MakeVectorFrom\t@X\t@Y to#2\ignorespaces}%
\def\ScaleVect#1by#2to#3{\GetCoord(#1)\t@X\t@Y
\edef\t@X{\fpeval{#2 * \t@X}}%
\edef\t@Y{\fpeval{#2 * \t@Y}}%
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}%
\def\ConjVect#1to#2{\GetCoord(#1)\t@X\t@Y
\edef\t@Y{-\t@Y}%
\MakeVectorFrom\t@X\t@Y to#2\ignorespaces}%
\def\AddVect#1and#2to#3{\GetCoord(#1)\tu@X\tu@Y
\GetCoord(#2)\td@X\td@Y
\edef\t@X{\fpeval{\tu@X + \td@X}}%
\edef\t@Y{\fpeval{\tu@Y + \td@Y}}%
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}%
\def\SubVect#1from#2to#3{\GetCoord(#1)\tu@X\tu@Y
\GetCoord(#2)\td@X\td@Y
\edef\t@X{\fpeval{\td@X - \tu@X}}%
\edef\t@Y{\fpeval{\td@Y - \tu@Y}}%
\MakeVectorFrom\t@X\t@Y to#3\ignorespaces}%
\def\ModAndAngleOfVect#1to#2and#3{\ModOfVect#1to#2\relax
\ArgOfVect#1to#3\ignorespaces}
\countdef\MV@C=2560\relax
\NewDocumentCommand\Multvect{m s m s m}{%
\MV@C=0
\ModAndAngleOfVect#1to\MV@uM and\MV@uA
\ModAndAngleOfVect#3to\MV@dM and\MV@dA
\IfBooleanT{#2}{\MV@C=1}\relax
\IfBooleanT{#4}{\MV@C=1}\relax
\unless\ifnum\MV@C=0\edef\MV@dA{-\MV@dA}\fi
\edef\MV@rM{\fpeval{round((\MV@uM * \MV@dM),6)}}%
\edef\MV@rA{\fpeval{round((\MV@uA + \MV@dA),6)}}%
\GetCoord(\MV@rA:\MV@rM)\t@X\t@Y
\MakeVectorFrom\t@X\t@Y to#5}
\def\MultVect#1by{\@ifstar{\let\MV@c\@ne\@MultVect#1by}%
  {\let\MV@c\empty\@MultVect#1by}}

\def\@MultVect#1by#2to#3{%
  \unless\ifx\MV@c\empty\Multvect{#1}{#2}*{#3}\else
    \Multvect{#1}{#2}{#3}\fi}
\def\DivVect#1by#2to#3{\Divvect{#1}{#2}{#3}}

\NewDocumentCommand\Divvect{ m m m }{%
\ModAndDirOfVect#2to\@Mod and\@Dir
\edef\@Mod{\fpeval{1 / \@Mod}}%
\ConjVect\@Dir to\@Dir
\ScaleVect#1by\@Mod to\@tempa
\Multvect{\@tempa}{\@Dir}#3\ignorespaces}%
\def\Arc(#1)(#2)#3{\begingroup
\@tdA=#3\p@
\unless\ifdim\@tdA=\z@
  \@Arc(#1)(#2)%
\fi
\endgroup\ignorespaces}%
\def\@Arc(#1)(#2){%
\ifdim\@tdA>\z@
  \let\Segno+%
\else
  \@tdA=-\@tdA \let\Segno-%
\fi
\Numero\@gradi\@tdA
\ifdim\@tdA>360\p@
 \PackageWarning{curve2e}{The arc aperture is \@gradi\space degrees
      and gets reduced\MessageBreak%
      to the range 0--360 taking the sign into consideration}%
 \@whiledim\@tdA>360\p@\do{\advance\@tdA-360\p@}%
\fi
\SubVect#2from#1to\@V \ModOfVect\@V to\@Raggio
\CopyVect#2to\@pPun
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc\strokepath\ignorespaces}%
\def\@@Arc{%
\pIIe@moveto{\@pPunX\unitlength}{\@pPunY\unitlength}%
\ifdim\@tdA>180\p@
  \advance\@tdA-180\p@
  \Numero\@gradi\@tdA
  \SubVect\@pPun from\@Cent to\@V
  \AddVect\@V and\@Cent to\@sPun
  \Multvect{\@V}{0,-1.3333333to}\@V
  \if\Segno-\ScaleVect\@V by-1to\@V\fi
  \AddVect\@pPun and\@V to\@pcPun
  \AddVect\@sPun and\@V to\@scPun
  \GetCoord(\@pcPun)\@pcPunX\@pcPunY
  \GetCoord(\@scPun)\@scPunX\@scPunY
  \GetCoord(\@sPun)\@sPunX\@sPunY
  \pIIe@curveto{\@pcPunX\unitlength}{\@pcPunY\unitlength}%
               {\@scPunX\unitlength}{\@scPunY\unitlength}%
               {\@sPunX\unitlength}{\@sPunY\unitlength}%
  \CopyVect\@sPun to\@pPun
\fi
\ifdim\@tdA>\z@
  \DirFromAngle\@gradi to\@Dir \if\Segno-\ConjVect\@Dir to\@Dir \fi
  \SubVect\@Cent from\@pPun to\@V
  \Multvect{\@V}{\@Dir}\@V
  \AddVect\@Cent and\@V to\@sPun
  \@tdA=.5\@tdA \Numero\@gradi\@tdA
  \DirFromAngle\@gradi to\@Phimezzi
  \GetCoord(\@Phimezzi)\@cosphimezzi\@sinphimezzi
  \@tdB=1.3333333\p@ \@tdB=\@Raggio\@tdB
  \@tdC=\p@ \advance\@tdC -\@cosphimezzi\p@ \Numero\@tempa\@tdC
  \@tdB=\@tempa\@tdB
  \DividE\@tdB by\@sinphimezzi\p@ to\@cZ
  \ScaleVect\@Phimezzi by\@cZ to\@Phimezzi
  \ConjVect\@Phimezzi to\@mPhimezzi
  \if\Segno-%
    \let\@tempa\@Phimezzi
    \let\@Phimezzi\@mPhimezzi
    \let\@mPhimezzi\@tempa
  \fi
  \SubVect\@sPun from\@pPun to\@V
  \DirOfVect\@V to\@V
  \Multvect{\@Phimezzi}{\@V}\@Phimezzi
  \AddVect\@sPun and\@Phimezzi to\@scPun
  \ScaleVect\@V by-1to\@V
  \Multvect{\@mPhimezzi}{\@V}\@mPhimezzi
  \AddVect\@pPun and\@mPhimezzi to\@pcPun
  \GetCoord(\@pcPun)\@pcPunX\@pcPunY
  \GetCoord(\@scPun)\@scPunX\@scPunY
  \GetCoord(\@sPun)\@sPunX\@sPunY
  \pIIe@curveto{\@pcPunX\unitlength}{\@pcPunY\unitlength}%
               {\@scPunX\unitlength}{\@scPunY\unitlength}%
               {\@sPunX\unitlength}{\@sPunY\unitlength}%
\fi}
\def\VectorArc(#1)(#2)#3{\begingroup
\@tdA=#3\p@ \ifdim\@tdA=\z@\else
  \@VArc(#1)(#2)%
\fi
\endgroup\ignorespaces}%
\def\VectorARC(#1)(#2)#3{\begingroup
\@tdA=#3\p@
\ifdim\@tdA=\z@\else
  \@VARC(#1)(#2)%
\fi
\endgroup\ignorespaces}%
\def\@VArc(#1)(#2){%
\ifdim\@tdA>\z@
  \let\Segno+%
\else
  \@tdA=-\@tdA \let\Segno-%
\fi \Numero\@gradi\@tdA
\ifdim\@tdA>360\p@
 \PackageWarning{curve2e}{The arc aperture is \@gradi\space degrees
      and gets reduced\MessageBreak%
      to the range 0--360 taking the sign into consideration}%
 \@whiledim\@tdA>360\p@\do{\advance\@tdA-360\p@}%
\fi
\SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun
\@tdE=\pIIe@FAW\@wholewidth \@tdE=\pIIe@FAL\@tdE
\DividE\@tdE by \@Raggio\unitlength to\DeltaGradi
\@tdD=\DeltaGradi\p@
\@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD
\@tdD=\ifx\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD
\DirFromAngle\@tempa to\@Dir
\Multvect{\@V}{\@Dir}\@sPun
\edef\@tempA{\ifx\Segno-\m@ne\else\@ne\fi}%
\Multvect{\@sPun}{0,\@tempA}\@vPun
\DirOfVect\@vPun to\@Dir
\AddVect\@sPun and #1 to \@sPun
\GetCoord(\@sPun)\@tdX\@tdY
\@tdD\ifx\Segno--\fi\DeltaGradi\p@
\@tdD=.5\@tdD \Numero\DeltaGradi\@tdD
\DirFromAngle\DeltaGradi to\@Dird
\Multvect{\@Dir}*{\@Dird}\@Dir%
\GetCoord(\@Dir)\@xnum\@ynum
\put(\@tdX,\@tdY){\vector(\@xnum,\@ynum){0}}%
\@tdE =\ifx\Segno--\fi\DeltaGradi\p@
\advance\@tdA -\@tdE \Numero\@gradi\@tdA
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc
\strokepath\ignorespaces}%
\def\@VARC(#1)(#2){%
\ifdim\@tdA>\z@
  \let\Segno+%
\else
  \@tdA=-\@tdA \let\Segno-%
\fi \Numero\@gradi\@tdA
\ifdim\@tdA>360\p@
 \PackageWarning{curve2e}{The arc aperture is \@gradi\space degrees
      and gets reduced\MessageBreak%
      to the range 0--360 taking the sign into consideration}%
 \@whiledim\@tdA>360\p@\do{\advance\@tdA-360\p@}%
\fi
\SubVect#1from#2to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun
\@tdE=\pIIe@FAW\@wholewidth \@tdE=0.8\@tdE
\DividE\@tdE by \@Raggio\unitlength to\DeltaGradi
\@tdD=\DeltaGradi\p@ \@tdD=57.29578\@tdD \Numero\DeltaGradi\@tdD
\@tdD=\if\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD
\DirFromAngle\@tempa to\@Dir
\Multvect{\@V}{\@Dir}\@sPun% corrects the end point
\edef\@tempA{\if\Segno--\fi1}%
\Multvect{\@sPun}{0,\@tempA}\@vPun
\DirOfVect\@vPun to\@Dir
\AddVect\@sPun and #1 to \@sPun
\GetCoord(\@sPun)\@tdX\@tdY
\@tdD\if\Segno--\fi\DeltaGradi\p@
\@tdD=.5\@tdD \Numero\@tempB\@tdD
\DirFromAngle\@tempB to\@Dird
\Multvect{\@Dir}*{\@Dird}\@Dir
\GetCoord(\@Dir)\@xnum\@ynum
\put(\@tdX,\@tdY){\vector(\@xnum,\@ynum){0}}% end point arrow tip
\@tdE =\DeltaGradi\p@
\advance\@tdA -2\@tdE \Numero\@gradi\@tdA
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
\SubVect\@Cent from\@pPun to \@V
\edef\@tempa{\if\Segno-\else-\fi\@ne}%
\Multvect{\@V}{0,\@tempa}\@vPun
\@tdE\if\Segno--\fi\DeltaGradi\p@
\Numero\@tempB{0.5\@tdE}%
\DirFromAngle\@tempB to\@Dird
\Multvect{\@vPun}{\@Dird}\@vPun% corrects the starting point
\DirOfVect\@vPun to\@Dir\GetCoord(\@Dir)\@xnum\@ynum
\put(\@pPunX,\@pPunY){\vector(\@xnum,\@ynum){0}}% starting point arrow tip
\edef\@tempa{\if\Segno--\fi\DeltaGradi}%
\DirFromAngle\@tempa to \@Dir
\SubVect\@Cent from\@pPun to\@V
\Multvect{\@V}{\@Dir}\@V
\AddVect\@Cent and\@V to\@pPun
\GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc
\strokepath\ignorespaces}%
\def\CurveBetween#1and#2WithDirs#3and#4{%
  \StartCurveAt#1WithDir{#3}\relax
  \CurveTo#2WithDir{#4}\CurveFinish\ignorespaces
}%
\def\StartCurveAt#1WithDir#2{%
\begingroup
\GetCoord(#1)\@tempa\@tempb
\CopyVect\@tempa,\@tempb to\@Pzero
\pIIe@moveto{\@tempa\unitlength}{\@tempb\unitlength}%
\GetCoord(#2)\@tempa\@tempb
\CopyVect\@tempa,\@tempb to\@Dzero
\DirOfVect\@Dzero to\@Dzero
\ignorespaces}
\def\ChangeDir<#1>{%
\GetCoord(#1)\@tempa\@tempb
\CopyVect\@tempa,\@tempb to\@Dzero
\DirOfVect\@Dzero to\@Dzero
\ignorespaces}
\def\CurveFinish{\strokepath\endgroup\ignorespaces}%
\def\FillCurve{\fillpath\endgroup\ignorespaces}
\def\CurveEnd{\fillstroke\endgroup\ignorespaces}
\def\CbezierTo#1WithDir#2AndDists#3And#4{%
\GetCoord(#1)\@tX\@tY \MakeVectorFrom\@tX\@tY to\@Puno
\GetCoord(#2)\@tX\@tY \MakeVectorFrom\@tX\@tY to \@Duno
\DirOfVect\@Duno to\@Duno
\ScaleVect\@Dzero by#3to\@Czero \AddVect\@Pzero and\@Czero to\@Czero
\ScaleVect\@Duno by-#4to \@Cuno \AddVect\@Puno and\@Cuno to \@Cuno
\GetCoord(\@Czero)\@XCzero\@YCzero
\GetCoord(\@Cuno)\@XCuno\@YCuno
\GetCoord(\@Puno)\@XPuno\@YPuno
\pIIe@curveto{\@XCzero\unitlength}{\@YCzero\unitlength}%
             {\@XCuno\unitlength}{\@YCuno\unitlength}%
             {\@XPuno\unitlength}{\@YPuno\unitlength}%
\CopyVect\@Puno to\@Pzero
\CopyVect\@Duno to\@Dzero
\ignorespaces}%
\def\CbezierBetween#1And#2WithDirs#3And#4UsingDists#5And#6{%
\StartCurveAt#1WithDir{#3}\relax
\CbezierTo#2WithDir#4AndDists#5And{#6}\CurveFinish}

\def\@isTension#1;#2!!{\def\@tempA{#1}%
\def\@tempB{#2}\unless\ifx\@tempB\empty\strip@semicolon#2\fi}

\def\strip@semicolon#1;{\def\@tempB{#1}}
\def\CurveTo#1WithDir#2{%
\def\@Tuno{1}\def\@Tzero{1}\relax
\edef\@Puno{#1}\@isTension#2;!!%
\expandafter\DirOfVect\@tempA to\@Duno
\bgroup\unless\ifx\@tempB\empty\GetCoord(\@tempB)\@Tzero\@Tuno\fi
\DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord
\Multvect{\@Dzero}*{\@DirChord}\@Dpzero
\Multvect{\@Duno}*{\@DirChord}\@Dpuno
\GetCoord(\@Dpzero)\@DXpzero\@DYpzero
\GetCoord(\@Dpuno)\@DXpuno\@DYpuno
\DivideFN\@Chord by2 to\@semichord
\ifdim\@DXpzero\p@=\z@
   \@tdA=1.333333\p@
   \Numero\@KCzero{\@semichord\@tdA}%
\fi
\ifdim\@DYpzero\p@=\z@
  \@tdA=1.333333\p@
  \Numero\@Kpzero{\@semichord\@tdA}%
\fi
\unless\ifdim\@DXpzero\p@=\z@
  \unless\ifdim\@DYpzero\p@=\z@
    \edef\@CosDzero{\ifdim\@DXpzero\p@<\z@ -\fi\@DXpzero}%
    \edef\@SinDzero{\ifdim\@DYpzero\p@<\z@ -\fi\@DYpzero}%
    \@tdA=\@semichord\p@ \@tdA=1.333333\@tdA
    \DividE\@tdA by\@SinDzero\p@ to \@KCzero
    \@tdA=\dimexpr(\p@-\@CosDzero\p@)\relax
    \DividE\@KCzero\@tdA by\@SinDzero\p@ to \@KCzero
  \fi
\fi
\MultiplyFN\@KCzero by \@Tzero to \@KCzero
\ScaleVect\@Dzero by\@KCzero to\@CPzero
\AddVect\@Pzero and\@CPzero to\@CPzero
\ifdim\@DXpuno\p@=\z@
   \@tdA=-1.333333\p@
   \Numero\@KCuno{\@semichord\@tdA}%
\fi
\ifdim\@DYpuno\p@=\z@
  \@tdA=-1.333333\p@
  \Numero\@KCuno{\@semichord\@tdA}%
\fi
\unless\ifdim\@DXpuno\p@=\z@
    \unless\ifdim\@DYpuno\p@=\z@
    \edef\@CosDuno{\ifdim\@DXpuno\p@<\z@ -\fi\@DXpuno}%
    \edef\@SinDuno{\ifdim\@DYpuno\p@<\z@ -\fi\@DYpuno}%
    \@tdA=\@semichord\p@ \@tdA=-1.333333\@tdA
    \DividE\@tdA by \@SinDuno\p@ to \@KCuno
    \@tdA=\dimexpr(\p@-\@CosDuno\p@)\relax
    \DividE\@KCuno\@tdA by\@SinDuno\p@ to \@KCuno
  \fi
\fi
\MultiplyFN\@KCuno by \@Tuno to \@KCuno
\ScaleVect\@Duno by\@KCuno to\@CPuno
\AddVect\@Puno and\@CPuno to\@CPuno
\GetCoord(\@Puno)\@XPuno\@YPuno
\GetCoord(\@CPzero)\@XCPzero\@YCPzero
\GetCoord(\@CPuno)\@XCPuno\@YCPuno
\pIIe@curveto{\@XCPzero\unitlength}{\@YCPzero\unitlength}%
             {\@XCPuno\unitlength}{\@YCPuno\unitlength}%
             {\@XPuno\unitlength}{\@YPuno\unitlength}\egroup
\CopyVect\@Puno to\@Pzero
\CopyVect\@Duno to\@Dzero
\ignorespaces}%
\def\Curve{\@ifstar{\let\fillstroke\fillpath\Curve@}%
{\let\fillstroke\strokepath\Curve@}}

\def\Curve@(#1)<#2>{%
    \StartCurveAt#1WithDir{#2}%
    \@ifnextchar\lp@r\@Curve{%
    \PackageWarning{curve2e}{%
    Curve specifications must contain at least two nodes!\Messagebreak
    Please, control your \string\Curve\space specifications\MessageBreak}}}
\def\@Curve(#1)<#2>{%
    \CurveTo#1WithDir{#2}%
    \@ifnextchar\lp@r\@Curve{%
    \@ifnextchar[\@ChangeDir\CurveEnd}}
\def\@ChangeDir[#1]{\ChangeDir<#1>\@Curve}
\def\Qurve{\@ifstar{\let\fillstroke\fillpath\Qurve@}%
{\let\fillstroke\strokepath\Qurve@}}

\def\Qurve@(#1)<#2>{%
    \StartCurveAt#1WithDir{#2}%
    \@ifnextchar\lp@r\@Qurve{%
    \PackageWarning{curve2e}{%
      Quadratic curve specifications must contain at least
      two nodes!\Messagebreak
      Please, control your Qurve specifications\MessageBreak}}}%

\def\@Qurve(#1)<#2>{\QurveTo#1WithDir{#2}%
    \@ifnextchar\lp@r\@Qurve{%
    \@ifnextchar[\@ChangeQDir\CurveEnd}}%

\def\@ChangeQDir[#1]{\ChangeDir<#1>\@Qurve}%
\def\QurveTo#1WithDir#2{%
\edef\@Puno{#1}\DirOfVect#2to\@Duno\bgroup
\DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord
\Multvect{\@Dzero}*{\@Duno}\@Scalar
\YpartOfVect\@Scalar to \@YScalar
\ifdim\@YScalar\p@=\z@
\PackageWarning{curve2e}%
   {Quadratic Bezier arcs cannot have their starting\MessageBreak
   and ending directions parallel or antiparallel with\MessageBreak
   each other. This arc is skipped and replaced with
   a dotted line.\MessageBreak}%
   \Dotline(\@Pzero)(\@Puno){2}\relax
\else
\Multvect{\@Dzero}*{\@DirChord}\@Dpzero
\Multvect{\@Duno}*{\@DirChord}\@Dpuno
\GetCoord(\@Dpzero)\@DXpzero\@DYpzero
\GetCoord(\@Dpuno)\@DXpuno\@DYpuno
\MultiplyFN\@DXpzero by\@DXpuno to\@XXD
\MultiplyFN\@DYpzero by\@DYpuno to\@YYD
\unless\ifdim\@YYD\p@<\z@\ifdim\@XXD\p@<\z@
\PackageWarning{curve2e}%
   {Quadratic Bezier arcs cannot have inflection points\MessageBreak
   Therefore the tangents to the starting and ending arc\MessageBreak
   points cannot be directed to the same half plane.\MessageBreak
   This arc is skipped and replaced by a dotted line\MessageBreak}%
   \Dotline(\@Pzero)(\@Puno){2}\fi
\else
\edef\@CDzero{\@DXpzero}\relax
\edef\@SDzero{\@DYpzero}\relax
\edef\@CDuno{\@DXpuno}\relax
\edef\@SDuno{\@DYpuno}\relax
\MultiplyFN\@SDzero by\@CDuno to\@tempA
\MultiplyFN\@SDuno by\@CDzero to\@tempB
\edef\@tempA{\strip@pt\dimexpr\@tempA\p@-\@tempB\p@}\relax
\@tdA=\@SDuno\p@ \@tdB=\@Chord\p@ \@tdC=\@tempA\p@
\edef\@tempC{\strip@pt\dimexpr \@tdA*\@tdB/\@tdC}\relax
\MultiplyFN\@tempC by\@CDzero to \@XC
\MultiplyFN\@tempC by\@SDzero to \@YC
\ModOfVect\@XC,\@YC to\@KC
\ScaleVect\@Dzero by\@KC to\@CP
\AddVect\@Pzero and\@CP to\@CP
\GetCoord(\@Pzero)\@XPzero\@YPzero
\GetCoord(\@Puno)\@XPuno\@YPuno
\GetCoord(\@CP)\@XCP\@YCP
\@ovxx=\@XPzero\unitlength \@ovyy=\@YPzero\unitlength
\@ovdx=\@XCP\unitlength \@ovdy=\@YCP\unitlength
\@xdim=\@XPuno\unitlength \@ydim=\@YPuno\unitlength
      \pIIe@bezier@QtoC\@ovxx\@ovdx\@ovro
      \pIIe@bezier@QtoC\@ovyy\@ovdy\@ovri
      \pIIe@bezier@QtoC\@xdim\@ovdx\@clnwd
      \pIIe@bezier@QtoC\@ydim\@ovdy\@clnht
      \pIIe@curveto\@ovro\@ovri\@clnwd\@clnht\@xdim\@ydim
\fi\fi\egroup
\CopyVect\@Puno to\@Pzero
\CopyVect\@Duno to\@Dzero
\ignorespaces}

%% 
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of
%% this license is at: http://www.latex-project.org/lppl.txt
%% 
%% This work is "maintained"
%% 
%% This work consists of file curve2e.dtx, and the derived files
%% curve2e.sty and curve2e.pdf, plus the auxiliary derived files
%% README.txt and curve2e-v161.sty.
%% 
%%
%% End of file `curve2e.sty'.
