summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/curve2e
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-06-19 22:33:34 +0000
committerKarl Berry <karl@freefriends.org>2015-06-19 22:33:34 +0000
commitfe3f79b0e5e6765e703a39b086c37f8ce3a33740 (patch)
tree846c798ba65ef30ae99d46464e226a7ca8865b47 /Master/texmf-dist/tex/latex/curve2e
parente283bedf2d8ede94bd11f584ac25064c393fd9d4 (diff)
curve2e (19jun15)
git-svn-id: svn://tug.org/texlive/trunk@37619 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/curve2e')
-rw-r--r--Master/texmf-dist/tex/latex/curve2e/curve2e.sty344
1 files changed, 203 insertions, 141 deletions
diff --git a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
index e97c8f5f16b..db002fd2a51 100644
--- a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
+++ b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
@@ -9,7 +9,6 @@
%% The curve2e package for LaTeX and XeLATeX
%% Copyright (C) 2010 Claudio Beccari
%% All rights reserved
-%%
%% License information appended
%%
%%
@@ -18,7 +17,9 @@
%%
\NeedsTeXFormat{LaTeX2e}[2014/05/01]
\ProvidesPackage{curve2e}%
- [2015/06/06 v.1.42 Extension package for pict2e]
+ [2015/06/19 v.1.50 Extension package for pict2e]
+
+
\RequirePackage{color}
\RequirePackageWithOptions{pict2e}[2014/01/01]
\def\TRON{\tracingcommands\tw@ \tracingmacros\tw@}%
@@ -35,8 +36,9 @@
\def\thicklines{\linethickness{\defaultlinewidth}}%
\def\thinlines{\linethickness{.5\defaultlinewidth}}%
\thinlines\ignorespaces}
-\def\LIne(#1,#2){\moveto(0,0)
- \pIIe@lineto{#1\unitlength}{#2\unitlength}\strokepath}%
+\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
@@ -52,16 +54,17 @@
\strokepath
\fi
\endgroup\ignorespaces}%
-\ifx\Dline\undefined
-\def\Dline(#1,#2)(#3,#4)#5{%
-\begingroup
- \countdef\NumA254\countdef\NumB252\relax
- \MakeVectorFrom{#1}{#2}to\V@ttA
- \MakeVectorFrom{#3}{#4}to\V@ttB
+\ifx\Dashline\undefined
+\def\Dashline{\@ifstar{\Dashline@@}{\Dashline@}}
+\def\Dashline@(#1)(#2)#3{%
+\bgroup
+ \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
- \DividE\DlineMod\p@ by#5\p@ to\NumD
- \NumA\expandafter\Integer\NumD??
+ \DivideFN\DlineMod by#3 to\NumD
+ \NumA\expandafter\Integer\NumD.??
\ifodd\NumA\else\advance\NumA\@ne\fi
\NumB=\NumA \divide\NumB\tw@
\DividE\DlineMod\p@ by\NumA\p@ to\D@shMod
@@ -69,13 +72,60 @@
\MultVect\V@ttC by\@tempa,0 to\V@ttB
\MultVect\V@ttB by 2,0 to\V@ttC
\advance\NumB\@ne
- \edef\@mpt{\noexpand\endgroup
- \noexpand\multiput(\V@ttA)(\V@ttC){\number\NumB}{\noexpand\LIne(\V@ttB)}}%
+ \edef\@mpt{\noexpand\egroup
+ \noexpand\multiput(\V@ttA)(\V@ttC){\number\NumB}%
+ {\noexpand\LIne(\V@ttB)}}%
\@mpt\ignorespaces}%
+\let\Dline\Dashline
+
+\def\Dashline@@(#1)(#2)#3{\put(#1){\Dashline@(0,0)(#2){#3}}}
+\fi
+\ifx\Dotline\undefined
+\def\Dotline{\@ifstar{\Dotline@@}{\Dotline@}}
+\def\Dotline@(#1)(#2)#3{%
+\bgroup
+ \countdef\NumA 3254\relax \countdef\NumB 3255\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\DotlineMod
+ \DivideFN\DotlineMod by#3 to\NumD
+ \NumA=\expandafter\Integer\NumD.??
+ \DivVect\V@ttC by\NumA,0 to\V@ttB
+ \advance\NumA\@ne
+ \edef\@mpt{\noexpand\egroup
+ \noexpand\multiput(\V@ttA)(\V@ttB){\number\NumA}%
+ {\noexpand\makebox(0,0){\noexpand\circle*{0.5}}}}%
+ \@mpt\ignorespaces}%
+
+\def\Dotline@@(#1)(#2)#3{\put(#1){\Dotline@(0,0)(#2){#3}}}
\fi
\def\GetCoord(#1)#2#3{%
\expandafter\SplitNod@\expandafter(#1)#2#3\ignorespaces}
-\def\SplitNod@(#1,#2)#3#4{\edef#3{#1}\edef#4{#2}}%
+\def\isnot@polar#1:#2!!{\def\@tempOne{#2}\ifx\@tempOne\empty
+\expandafter\@firstoftwo\else
+\expandafter\@secondoftwo\fi
+{\SplitNod@@}{\SplitPolar@@}}
+
+\def\SplitNod@(#1)#2#3{\isnot@polar#1:!!(#1)#2#3}%
+\def\SplitNod@@(#1,#2)#3#4{\edef#3{#1}\edef#4{#2}}%
+\def\SplitPolar@@(#1:#2)#3#4{\DirFromAngle#1to\@DirA
+\ScaleVect\@DirA by#2to\@DirA
+\expandafter\SplitNod@@\expandafter(\@DirA)#3#4}
+
+\let\originalput\put
+\def\put(#1){\bgroup\GetCoord(#1)\@tX\@tY
+\edef\x{\noexpand\egroup\noexpand\originalput(\@tX,\@tY)}\x}
+
+\let\originalmultiput\multiput
+\let\original@multiput\@multiput
+
+\long\def\@multiput(#1)#2#3{\bgroup\GetCoord(#1)\@mptX\@mptY
+\edef\x{\noexpand\egroup\noexpand\original@multiput(\@mptX,\@mptY)}%
+\x{#2}{#3}\ignorespaces}
+
+\gdef\multiput(#1)#2{\bgroup\GetCoord(#1)\@mptX\@mptY
+\edef\x{\noexpand\egroup\noexpand\originalmultiput(\@mptX,\@mptY)}\x(}%)
\def\vector(#1)#2{%
\begingroup
\GetCoord(#1)\d@mX\d@mY
@@ -107,10 +157,11 @@
\pIIe@lineto{\@xnum\@linelen}{\@ynum\@linelen}%
\strokepath\fi
\endgroup}
-\def\Vector(#1,#2){%
-\ifdim#1\p@=\z@\vector(#1,#2){#2}
+\def\Vector(#1){{%
+\GetCoord(#1)\@tX\@tY
+\ifdim\@tX\p@=\z@\vector(\@tX,\@tY){\@tY}
\else
-\vector(#1,#2){#1}\fi}
+\vector(\@tX,\@tY){\@tX}\fi}}
\def\VECTOR(#1)(#2){\begingroup
\SubVect#1from#2to\@tempa
\expandafter\put\expandafter(#1){\expandafter\Vector\expandafter(\@tempa)}%
@@ -129,13 +180,13 @@
\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}}
-\def\GraphGrid(#1,#2){\begingroup\textcolor{red}{\linethickness{.1\p@}%
+\def\GraphGrid(#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}%
-\endgroup\ignorespaces}
+\egroup\ignorespaces}
\def\RoundUp#1modulo#2to#3{\expandafter\@tempcnta\Integer#1.??%
\count254\@tempcnta\divide\count254by#2\relax
\multiply\count254by#2\relax
@@ -146,34 +197,37 @@
\ifdefined\dimexpr
\unless\ifdefined\DividE
\def\DividE#1by#2to#3{\bgroup
-\countdef\Num2254\relax \countdef\Den2252\relax
-\dimendef\@DimA 2254
-\Num=\p@ \@DimA=#2\relax \Den=\@DimA
-\ifnum\Den=\z@
+\dimendef\Num2254\relax \dimendef\Den2252\relax
+\dimendef\@DimA 2250
+\Num=\p@ \Den=#2\relax
+\ifdim\Den=\z@
\edef\x{\noexpand\endgroup\noexpand\def\noexpand#3{\strip@pt\maxdimen}}%
\else
\@DimA=#1\relax
- \@DimA=\dimexpr\@DimA*\Num/\Den\relax
- \edef\x{\noexpand\egroup\noexpand\def\noexpand#3{\strip@pt\@DimA}}%
+ \edef\x{%
+ \noexpand\egroup\noexpand\def\noexpand#3{%
+ \strip@pt\dimexpr\@DimA*\Num/\Den\relax}}%
\fi
\x\ignorespaces}%
\fi
\unless\ifdefined\DivideFN
- \def\DivideFN#1by#2to#3{\DividE#1\p@ by#2\p@ to#3}%
+ \def\DivideFN#1by#2to#3{\DividE#1\p@ by#2\p@ to{#3}}%
\fi
\unless\ifdefined\MultiplY
\def\MultiplY#1by#2to#3{\bgroup
\dimendef\@DimA 2254 \dimendef\@DimB2255
\@DimA=#1\p@\relax \@DimB=#2\p@\relax
- \@DimA=\dimexpr\@DimA*\@DimB/\p@\relax
- \edef\x{\noexpand\egroup\noexpand\def\noexpand#3{\strip@pt\@DimA}}%
+ \edef\x{%
+ \noexpand\egroup\noexpand\def\noexpand#3{%
+ \strip@pt\dimexpr\@DimA*\@DimB/\p@\relax}}%
\x\ignorespaces}%
\fi
\fi
\unless\ifdefined\Numero
- \def\Numero#1#2{\dimen3254#2\relax
- \edef#1{\strip@pt\dimen3254}\ignorespaces}%
+ \def\Numero#1#2{\bgroup\dimen3254=#2\relax
+ \edef\x{\noexpand\egroup\noexpand\edef\noexpand#1{%
+ \strip@pt\dimen3254}}\x\ignorespaces}%
\fi
\def\g@tTanCotanFrom#1to#2and#3{%
\DividE 114.591559\p@ by#1to\X@ \@tdB=\X@\p@
@@ -182,8 +236,7 @@
\@tdC=\Tan\p@ \@tdD=\I\@tdB
\advance\@tdD-\@tdC \DividE\p@ by\@tdD to\Tan
\advance\I-2\relax}%
-\def#2{\Tan}\DividE\p@ by\Tan\p@ to\Cot \def#3{\Cot}%
-\ignorespaces}%
+\def#2{\Tan}\DividE\p@ by\Tan\p@ to\Cot \def#3{\Cot}\ignorespaces}%
\def\SinOf#1to#2{\bgroup%
\@tdA=#1\p@%
\ifdim\@tdA>\z@%
@@ -292,28 +345,55 @@
\edef\endTanOf{\noexpand\egroup
\noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}%
\endTanOf}%
+\def\ArcTanOf#1to#2{\bgroup
+\edef\@tF{#1}\@tdF=\@tF\p@ \@tdE=57.295778\p@
+\@tdD=\ifdim\@tdF>\z@ \@tdF\else -\@tdF\fi
+\unless\ifdim\@tdD>0.02\p@
+ \def\@tX{\strip@pt\dimexpr57.295778\@tdF\relax}%
+\else
+ \edef\@tX{45}\relax
+ \countdef\I 2523 \I=8\relax
+ \@whilenum\I>0\do{\TanOf\@tX to\@tG
+ \edef\@tG{\strip@pt\dimexpr\@tG\p@-\@tdF\relax}\relax
+ \MultiplY\@tG by57.295778to\@tG
+ \CosOf\@tX to\@tH
+ \MultiplY\@tH by\@tH to\@tH
+ \MultiplY\@tH by\@tG to \@tH
+ \edef\@tX{\strip@pt\dimexpr\@tX\p@ - \@tH\p@\relax}\relax
+ \advance\I\m@ne}%
+\fi
+\edef\x{\egroup\noexpand\edef\noexpand#2{\@tX}}\x\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
\@tempdima=\t@X\p@ \ifdim\@tempdima<\z@ \@tempdima=-\@tempdima\fi
\@tempdimb=\t@Y\p@ \ifdim\@tempdimb<\z@ \@tempdimb=-\@tempdimb\fi
-\ifdim\@tempdima>\@tempdimb
- \DividE\@tempdimb by\@tempdima to\@T
- \@tempdimc=\@tempdima
+\ifdim\@tempdima=\z@
+ \ifdim\@tempdimb=\z@
+ \def\@T{0}\@tempdimc=\z@
+ \else
+ \def\@T{0}\@tempdimc=\@tempdimb
+ \fi
\else
- \DividE\@tempdima by\@tempdimb to\@T
- \@tempdimc=\@tempdimb
+ \ifdim\@tempdima>\@tempdimb
+ \DividE\@tempdimb by\@tempdima to\@T
+ \@tempdimc=\@tempdima
+ \else
+ \DividE\@tempdima by\@tempdimb to\@T
+ \@tempdimc=\@tempdimb
+ \fi
\fi
-\ifdim\@T\p@=\z@
-\else
- \@tempdima=\@T\p@ \@tempdima=\@T\@tempdima
- \advance\@tempdima\p@%
- \@tempdimb=\p@%
- \@tempcnta=5\relax
- \@whilenum\@tempcnta>\z@\do{\DividE\@tempdima by\@tempdimb to\@T
- \advance\@tempdimb \@T\p@ \@tempdimb=.5\@tempdimb
- \advance\@tempcnta\m@ne}%
- \@tempdimc=\@T\@tempdimc
+\unless\ifdim\@tempdimc=\z@
+ \unless\ifdim\@T\p@=\z@
+ \@tempdima=\@T\p@ \@tempdima=\@T\@tempdima
+ \advance\@tempdima\p@%
+ \@tempdimb=\p@%
+ \@tempcnta=5\relax
+ \@whilenum\@tempcnta>\z@\do{\DividE\@tempdima by\@tempdimb to\@T
+ \advance\@tempdimb \@T\p@ \@tempdimb=.5\@tempdimb
+ \advance\@tempcnta\m@ne}%
+ \@tempdimc=\@T\@tempdimc
+ \fi
\fi
\Numero#2\@tempdimc
\ignorespaces}%
@@ -343,22 +423,6 @@
\CosOf#1to\t@X
\SinOf#1to\t@Y
\MakeVectorFrom\t@X\t@Y to#2\ignorespaces}%
-\def\ArcTanOf#1to#2{\bgroup
-\edef\@tF{#1}\@tdF=\@tF\p@
-\@tdE=57.295779\p@
-\ifdim\@tdF=\z@\def\@tX{0}\else
-\edef\@tXX{1}%
-\MultiplY57.295779by\@tXX to \@tX
-\countdef\I 2323 \I=7\relax
-\@whilenum\I>0\do{\TanOf\@tX to\@tG
-\CosOf\@tX to \@tH
-\edef\@tG{\strip@pt\dimexpr\@tG\p@-\@tdF\relax}%
-\MultiplY\@tH by\@tH to\@tH
-\MultiplY\@tH by\@tG to \@tH
-\edef\@tXX{\strip@pt\dimexpr\@tXX\p@ - \@tH\p@\relax}%
-\MultiplY57.295779by\@tXX to\@tX
-\advance\I\m@ne}\fi
-\edef\x{\egroup\noexpand\edef\noexpand#2{\@tX}}\x}%
\def\ArgOfVect#1to#2{\bgroup\GetCoord(#1){\t@X}{\t@Y}%
\def\s@gno{}\def\addflatt@ngle{0}
\ifdim\t@X\p@=\z@
@@ -436,7 +500,7 @@
\MultVect\@tempa by\@Dir to#3\ignorespaces}%
\def\Arc(#1)(#2)#3{\begingroup
\@tdA=#3\p@
-\ifdim\@tdA=\z@\else
+\unless\ifdim\@tdA=\z@
\@Arc(#1)(#2)%
\fi
\endgroup\ignorespaces}%
@@ -571,33 +635,33 @@
\@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=\ifx\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD
+\@tdD=\if\Segno--\fi\@gradi\p@ \Numero\@tempa\@tdD
\DirFromAngle\@tempa to\@Dir
\MultVect\@V by\@Dir to\@sPun% corrects the end point
-\edef\@tempA{\ifx\Segno-\m@ne\else\@ne\fi}%
+\edef\@tempA{\if\Segno--\fi1}%
\MultVect\@sPun by 0,\@tempA to\@vPun
\DirOfVect\@vPun to\@Dir
\AddVect\@sPun and #1 to \@sPun
\GetCoord(\@sPun)\@tdX\@tdY
-\@tdD\ifx\Segno--\fi\DeltaGradi\p@
+\@tdD\if\Segno--\fi\DeltaGradi\p@
\@tdD=.5\@tdD \Numero\@tempB\@tdD
\DirFromAngle\@tempB to\@Dird
\MultVect\@Dir by*\@Dird to\@Dir
\GetCoord(\@Dir)\@xnum\@ynum
-\put(\@tdX,\@tdY){\vector(\@xnum,\@ynum){0}}% arrow tip at the end point
+\put(\@tdX,\@tdY){\vector(\@xnum,\@ynum){0}}% end point arrowt ip
\@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{\ifx\Segno-\else-\fi\@ne}%
+\edef\@tempa{\if\Segno-\else-\fi\@ne}%
\MultVect\@V by0,\@tempa to\@vPun
-\@tdE\ifx\Segno--\fi\DeltaGradi\p@
+\@tdE\if\Segno--\fi\DeltaGradi\p@
\Numero\@tempB{0.5\@tdE}%
\DirFromAngle\@tempB to\@Dird
\MultVect\@vPun by\@Dird to\@vPun% corrects the starting point
\DirOfVect\@vPun to\@Dir\GetCoord(\@Dir)\@xnum\@ynum
-\put(\@pPunX,\@pPunY){\vector(\@xnum,\@ynum){0}}% arrow tip at the starting point
-\edef\@tempa{\ifx\Segno--\fi\DeltaGradi}%
+\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 by\@Dir to\@V
@@ -607,7 +671,7 @@
\strokepath\ignorespaces}%
\def\CurveBetween#1and#2WithDirs#3and#4{%
\StartCurveAt#1WithDir{#3}\relax
-\CurveTo#2WithDir{#4}\CurveFinish}%
+\CurveTo#2WithDir{#4}\CurveFinish\ignorespaces}%
\def\StartCurveAt#1WithDir#2{%
\begingroup
\GetCoord(#1)\@tempa\@tempb
@@ -622,71 +686,75 @@
\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\CurveTo#1WithDir#2{%
\def\@Puno{#1}\def\@Duno{#2}\DirOfVect\@Duno to\@Duno
\DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord
\MultVect\@Dzero by*\@DirChord to \@Dpzero
\MultVect\@Duno by*\@DirChord to \@Dpuno
-\GetCoord(\@Dpzero)\@Xpzero\@Ypzero
-\GetCoord(\@Dpuno)\@Xpuno\@Ypuno
-\ifdim\@Xpzero\p@=\z@
- \ifdim\@Xpuno\p@=\z@
- \@tdA=0.666666\p@
- \Numero\@Mcpzero{\@Chord\@tdA}%
- \edef\@Mcpuno{\@Mcpzero}%
- \else
- \@tdA=0.666666\p@
- \Numero\@Mcpzero{\@Chord\@tdA}%
- \SetCPmodule\@Mcpuno from\@ne\@Chord\@Dpuno%
- \fi
-\else
- \ifdim\@Xpuno\p@=\z@
- \@tdA=0.666666\p@
- \Numero\@Mcpuno{\@Chord\@tdA}%
- \SetCPmodule\@Mcpzero from\@ne\@Chord\@Dpzero%
- \else
- \ifdim\@Ypzero\p@=\z@
- \@tdA=0.333333\p@
- \Numero\@Mcpzero{\@Chord\@tdA}%
- \edef\@Mcpuno{\@Mcpzero}%
- \else
- \ifdim\@Ypuno\p@=\z@
- \@tdA=0.333333\p@
- \Numero\@Mcpuno{\@Chord\@tdA}%
- \SetCPmodule\@Mcpzero from\@ne\@Chord\@Dpzero
- \else
- \@tdA=\@Ypzero\p@ \@tdA=\@Ypuno\@tdA
- \ifdim\@tdA>\z@
- \ConjVect\@Dpuno to\@Dwpuno
- \else
- \edef\@Dwpuno{\@Dpuno}%
- \fi
- \GetCoord(\@Dwpuno)\@Xwpuno\@Ywpuno
- \@tdA=\@Xpzero\p@ \@tdA=\@Ywpuno\@tdA
- \@tdB=\@Xwpuno\p@ \@tdB=\@Ypzero\@tdB
- \DividE\@tdB by\@tdA to\@Fact
- \@tdC=\p@ \advance\@tdC-\@Fact\p@
- \ifdim\@tdC<\z@ \@tdC=-\@tdC\fi
- \DividE\p@ by \@Fact\p@ to\@Fact
- \@tdD=\p@ \advance\@tdD-\@Fact\p@
- \ifdim\@tdD<\z@ \@tdD=-\@tdD\fi
- \ifdim\@tdD<0.0001\p@
- \def\@factzero{1}%
- \def\@factuno{1}%
- \else
- \DividE\p@ by\@tdC to\@factzero
- \DividE\p@ by\@tdD to\@factuno
- \fi
- \SetCPmodule\@Mcpzero from\@factzero\@Chord\@Dpzero
- \SetCPmodule\@Mcpuno from\@factuno\@Chord\@Dwpuno
- \fi
- \fi
+\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@)
+ \DividE\@KCzero\@tdA by\@SinDzero\p@ to \@KCzero
\fi
\fi
-\ScaleVect\@Dzero by\@Mcpzero to\@CPzero
+\ScaleVect\@Dzero by\@KCzero to\@CPzero
\AddVect\@Pzero and\@CPzero to\@CPzero
-\ScaleVect\@Duno by\@Mcpuno to\@CPuno
-\SubVect\@CPuno from\@Puno to\@CPuno
+\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@)
+ \DividE\@KCuno\@tdA by\@SinDuno\p@ to \@KCuno
+ \fi
+\fi
+\ScaleVect\@Duno by\@KCuno to\@CPuno
+\AddVect\@Puno and\@CPuno to\@CPuno
\GetCoord(\@Puno)\@XPuno\@YPuno
\GetCoord(\@CPzero)\@XCPzero\@YCPzero
\GetCoord(\@CPuno)\@XCPuno\@YCPuno
@@ -696,15 +764,9 @@
\CopyVect\@Puno to\@Pzero
\CopyVect\@Duno to\@Dzero
\ignorespaces}%
-\def\SetCPmodule#1from#2#3#4{%
-\GetCoord(#4)\t@X\t@Y
-\@tdA=#3\p@
-\@tdA=#2\@tdA
-\@tdA=1.333333\@tdA
-\@tdB=\p@ \advance\@tdB +\t@X\p@
-\DividE\@tdA by\@tdB to#1\relax
-\ignorespaces}%
-\def\Curve(#1)<#2>{%
+\def\Curve{\@ifstar{\let\fillstroke\fillpath\Curve@}%
+{\let\fillstroke\strokepath\Curve@}}
+\def\Curve@(#1)<#2>{%
\StartCurveAt#1WithDir{#2}%
\@ifnextchar\lp@r\@Curve{%
\PackageWarning{curve2e}{%
@@ -713,7 +775,7 @@
\def\@Curve(#1)<#2>{%
\CurveTo#1WithDir{#2}%
\@ifnextchar\lp@r\@Curve{%
- \@ifnextchar[\@ChangeDir\CurveFinish}}
+ \@ifnextchar[\@ChangeDir\CurveEnd}}
\def\@ChangeDir[#1]{\ChangeDir<#1>\@Curve}
%%