summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/curve2e
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2015-06-14 17:52:09 +0000
committerKarl Berry <karl@freefriends.org>2015-06-14 17:52:09 +0000
commit0064febc472a7423c4e27f5e6708263587c19b89 (patch)
tree1184d8b95c92b85224b4e4bf9c26cb7d5df8eb9a /Master/texmf-dist/tex/latex/curve2e
parent3f2aeeffbd8d4dd39f5b5d6a80fe209951e54478 (diff)
curve2e (6jun15)
git-svn-id: svn://tug.org/texlive/trunk@37532 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/curve2e')
-rw-r--r--Master/texmf-dist/tex/latex/curve2e/curve2e.sty156
1 files changed, 109 insertions, 47 deletions
diff --git a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
index 41bd06afae4..e97c8f5f16b 100644
--- a/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
+++ b/Master/texmf-dist/tex/latex/curve2e/curve2e.sty
@@ -6,22 +6,21 @@
%%
%% curve2e.dtx (with options: `package')
%% ______________________________________________________
-%% The curve2e package for LaTeX and XeLaTeX
-%% Copyright (C) 2005-2012 Claudio Beccari
+%% The curve2e package for LaTeX and XeLATeX
+%% Copyright (C) 2010 Claudio Beccari
%% All rights reserved
%%
%% License information appended
%%
%%
%% File `curve2e.dtx'.
-%% Copyright (C) 2005--2011 Claudio Beccari all rights reserved.
+%% Copyright (C) 2005--2015 Claudio Beccari all rights reserved.
%%
-\NeedsTeXFormat{LaTeX2e}
+\NeedsTeXFormat{LaTeX2e}[2014/05/01]
\ProvidesPackage{curve2e}%
- [2012/12/11 v.1.41 Extension package for pict2e]
+ [2015/06/06 v.1.42 Extension package for pict2e]
\RequirePackage{color}
-\RequirePackageWithOptions{pict2e}[2011/04/01]
-
+\RequirePackageWithOptions{pict2e}[2014/01/01]
\def\TRON{\tracingcommands\tw@ \tracingmacros\tw@}%
\def\TROF{\tracingcommands\z@ \tracingmacros\z@}%
\ifx\undefined\@tdA \newdimen\@tdA \fi
@@ -36,8 +35,8 @@
\def\thicklines{\linethickness{\defaultlinewidth}}%
\def\thinlines{\linethickness{.5\defaultlinewidth}}%
\thinlines\ignorespaces}
-\def\LIne(#1,#2){\pIIe@moveto\z@\z@
- \pIIe@lineto{#1\unitlength}{#2\unitlength}\pIIe@strokeGraph}%
+\def\LIne(#1,#2){\moveto(0,0)
+ \pIIe@lineto{#1\unitlength}{#2\unitlength}\strokepath}%
\def\segment(#1)(#2){\@killglue\polyline(#1)(#2)}%
\def\line(#1)#2{\begingroup
\@linelen #2\unitlength
@@ -48,9 +47,9 @@
\DividE\ifdim\d@mX\p@<\z@-\fi\p@ by\d@mX\p@ to\sc@lelen
\@linelen=\sc@lelen\@linelen
\fi
- \pIIe@moveto\z@\z@
+ \moveto(0,0)
\pIIe@lineto{\d@mX\@linelen}{\d@mY\@linelen}%
- \pIIe@strokeGraph
+ \strokepath
\fi
\endgroup\ignorespaces}%
\ifx\Dline\undefined
@@ -62,7 +61,7 @@
\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.??
+ \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
@@ -98,15 +97,15 @@
\pIIe@concat\@xdim\@ydim{-\@ydim}\@xdim{\@xnum\@linelen}{\@ynum\@linelen}%
\@linelen\z@
\pIIe@vector
- \pIIe@fillGraph
+ \fillpath
\@linelen=\@tdB
\@tdA=\pIIe@FAW\@wholewidth
\@tdA=\pIIe@FAL\@tdA
\advance\@linelen-\@tdA
\ifdim\@linelen>\z@
- \pIIe@moveto\z@\z@
+ \moveto(0,0)
\pIIe@lineto{\@xnum\@linelen}{\@ynum\@linelen}%
- \pIIe@strokeGraph\fi
+ \strokepath\fi
\endgroup}
\def\Vector(#1,#2){%
\ifdim#1\p@=\z@\vector(#1,#2){#2}
@@ -117,19 +116,19 @@
\expandafter\put\expandafter(#1){\expandafter\Vector\expandafter(\@tempa)}%
\endgroup\ignorespaces}
\let\lp@r( \let\rp@r)
-\providecommand*\polyline[1][\beveljoin]{\p@lylin@[#1]}
+\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}%
- {Polygonal lines require at least two vertices!\MessageBreak
- Control your polygonal line specification\MessageBreak}%
+ {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}{\pIIe@strokeGraph\ignorespaces}}
+ \@ifnextchar\lp@r{\p@lyline}{\strokepath\ignorespaces}}
\def\GraphGrid(#1,#2){\begingroup\textcolor{red}{\linethickness{.1\p@}%
\RoundUp#1modulo10to\@GridWd \RoundUp#2modulo10to\@GridHt
\@tempcnta=\@GridWd \divide\@tempcnta10\relax \advance\@tempcnta\@ne
@@ -144,39 +143,48 @@
\ifnum\count252>0\advance\count252-#2\relax
\advance\@tempcnta-\count252\fi\edef#3{\number\@tempcnta}\ignorespaces}%
\def\Integer#1.#2??{#1}%
-\ifx\DividE\undefined
-\ifx\dimexpr\undefined\else
-\def\DividE#1by#2to#3{%
-\begingroup
+\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@
-\edef\x{\noexpand\endgroup\noexpand\def\noexpand#3{\strip@pt\maxdimen}}%
+ \edef\x{\noexpand\endgroup\noexpand\def\noexpand#3{\strip@pt\maxdimen}}%
\else
-\@DimA=#1\relax
-\@DimA=\dimexpr\@DimA*\Num/\Den\relax
-\edef\x{\noexpand\endgroup\noexpand\def\noexpand#3{\strip@pt\@DimA}}%
+ \@DimA=#1\relax
+ \@DimA=\dimexpr\@DimA*\Num/\Den\relax
+ \edef\x{\noexpand\egroup\noexpand\def\noexpand#3{\strip@pt\@DimA}}%
\fi
-\x}
-\fi\fi
-\ifx\undefined\@Numero%
- {\let\cc\catcode \cc`p=12\cc`t=12\gdef\@Numero#1pt{#1}}%
+\x\ignorespaces}%
\fi
-\ifx\undefined\Numero
- \def\Numero#1#2{\dimen254#2\relax
- \edef#1{\expandafter\@Numero\the\dimen254}\ignorespaces}%
+ \unless\ifdefined\DivideFN
+ \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}}%
+ \x\ignorespaces}%
+ \fi
+\fi
+
+\unless\ifdefined\Numero
+ \def\Numero#1#2{\dimen3254#2\relax
+ \edef#1{\strip@pt\dimen3254}\ignorespaces}%
\fi
\def\g@tTanCotanFrom#1to#2and#3{%
\DividE 114.591559\p@ by#1to\X@ \@tdB=\X@\p@
-\countdef\I=254\def\Tan{0}\I=11\relax
+\countdef\I=2546\def\Tan{0}\I=11\relax
\@whilenum\I>\z@\do{%
\@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\SinOf#1to#2{\begingroup%
+\def\SinOf#1to#2{\bgroup%
\@tdA=#1\p@%
\ifdim\@tdA>\z@%
\@whiledim\@tdA>180\p@\do{\advance\@tdA -360\p@}%
@@ -211,10 +219,10 @@
\fi
\fi
\fi
-\edef\endSinOf{\noexpand\endgroup
+\edef\endSinOf{\noexpand\egroup
\noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}%
\endSinOf}%
-\def\CosOf#1to#2{\begingroup%
+\def\CosOf#1to#2{\bgroup%
\@tdA=#1\p@%
\ifdim\@tdA>\z@%
\@whiledim\@tdA>360\p@\do{\advance\@tdA -360\p@}%
@@ -249,10 +257,10 @@
\fi
\fi
\fi
-\edef\endCosOf{\noexpand\endgroup
+\edef\endCosOf{\noexpand\egroup
\noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}%
\endCosOf}%
-\def\TanOf#1to#2{\begingroup%
+\def\TanOf#1to#2{\bgroup%
\@tdA=#1\p@%
\ifdim\@tdA>90\p@%
\@whiledim\@tdA>90\p@\do{\advance\@tdA -180\p@}%
@@ -281,7 +289,7 @@
\fi
\fi
\fi
-\edef\endTanOf{\noexpand\endgroup
+\edef\endTanOf{\noexpand\egroup
\noexpand\def\noexpand#2{\@tempA}\noexpand\ignorespaces}%
\endTanOf}%
\def\MakeVectorFrom#1#2to#3{\edef#3{#1,#2}\ignorespaces}%
@@ -311,7 +319,7 @@
\ignorespaces}%
\def\DirOfVect#1to#2{\GetCoord(#1)\t@X\t@Y
\ModOfVect#1to\@tempa
-\ifdim\@tempdimc=\z@\else
+\unless\ifdim\@tempdimc=\z@
\DividE\t@X\p@ by\@tempdimc to\t@X
\DividE\t@Y\p@ by\@tempdimc to\t@Y
\fi
@@ -335,6 +343,60 @@
\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@
+ \ifdim\t@Y\p@=\z@
+ \def\ArcTan{0}%
+ \else
+ \def\ArcTan{90}%
+ \ifdim\t@Y\p@<\z@\def\s@gno{-}\fi
+ \fi
+\else
+ \ifdim\t@Y\p@=\z@
+ \ifdim\t@X\p@<\z@
+ \def\ArcTan{180}%
+ \else
+ \def\ArcTan{0}%
+ \fi
+ \else
+ \ifdim\t@X\p@<\z@%
+ \def\addflatt@ngle{180}%
+ \edef\t@X{\strip@pt\dimexpr-\t@X\p@}%
+ \edef\t@Y{\strip@pt\dimexpr-\t@Y\p@}%
+ \ifdim\t@Y\p@<\z@
+ \def\s@gno{-}%
+ \edef\t@Y{-\t@Y}%
+ \fi
+ \fi
+ \DivideFN\t@Y by\t@X to \t@A
+ \ArcTanOf\t@A to\ArcTan
+ \fi
+\fi
+\edef\ArcTan{\unless\ifx\s@gno\empty\s@gno\fi\ArcTan}%
+\unless\ifnum\addflatt@ngle=0\relax
+ \edef\ArcTan{%
+ \strip@pt\dimexpr\ArcTan\p@\ifx\s@gno\empty-\else+\fi
+ \addflatt@ngle\p@\relax}%
+\fi
+\edef\x{\noexpand\egroup\noexpand\edef\noexpand#2{\ArcTan}}%
+\x\ignorespaces}
\def\ScaleVect#1by#2to#3{\GetCoord(#1)\t@X\t@Y
\@tempdima=\t@X\p@ \@tempdima=#2\@tempdima\Numero\t@X\@tempdima
\@tempdima=\t@Y\p@ \@tempdima=#2\@tempdima\Numero\t@Y\@tempdima
@@ -394,7 +456,7 @@
\SubVect#2from#1to\@V \ModOfVect\@V to\@Raggio \CopyVect#2to\@pPun
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc
-\pIIe@strokeGraph\ignorespaces}%
+\strokepath\ignorespaces}%
\def\@@Arc{%
\pIIe@moveto{\@pPunX\unitlength}{\@pPunY\unitlength}%
\ifdim\@tdA>180\p@
@@ -492,7 +554,7 @@
\advance\@tdA -\@tdE \Numero\@gradi\@tdA
\CopyVect#1to\@Cent \GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc
-\pIIe@strokeGraph\ignorespaces}%
+\strokepath\ignorespaces}%
\def\@VARC(#1)(#2){%
\ifdim\@tdA>\z@
\let\Segno+%
@@ -542,7 +604,7 @@
\AddVect\@Cent and\@V to\@pPun
\GetCoord(\@pPun)\@pPunX\@pPunY
\@@Arc
-\pIIe@strokeGraph\ignorespaces}%
+\strokepath\ignorespaces}%
\def\CurveBetween#1and#2WithDirs#3and#4{%
\StartCurveAt#1WithDir{#3}\relax
\CurveTo#2WithDir{#4}\CurveFinish}%
@@ -559,7 +621,7 @@
\CopyVect\@tempa,\@tempb to\@Dzero
\DirOfVect\@Dzero to\@Dzero
\ignorespaces}
-\def\CurveFinish{\pIIe@strokeGraph\endgroup\ignorespaces}%
+\def\CurveFinish{\strokepath\endgroup\ignorespaces}%
\def\CurveTo#1WithDir#2{%
\def\@Puno{#1}\def\@Duno{#2}\DirOfVect\@Duno to\@Duno
\DistanceAndDirOfVect\@Puno minus\@Pzero to\@Chord and\@DirChord
@@ -655,7 +717,7 @@
\def\@ChangeDir[#1]{\ChangeDir<#1>\@Curve}
%%
-%% Copyright 2005-2012 Claudio Beccari
+%% Copyright 2005-2015 Claudio Beccari
%%
%% Distributable under the LaTeX Project Public License,
%% version 1.3c or higher (your choice). The latest version of