diff options
author | Karl Berry <karl@freefriends.org> | 2021-09-10 21:02:23 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2021-09-10 21:02:23 +0000 |
commit | ededfa09b5b2ca189371118688bcdcffb8f200cb (patch) | |
tree | a1f1a046dc9cc3556bfaf7c9daacac3a32e340b4 /Master/texmf-dist/tex/generic | |
parent | c5121330f7413d484bdcfe5206ac682acf9ff641 (diff) |
pstricks-add (10sep21)
git-svn-id: svn://tug.org/texlive/trunk@60465 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
-rw-r--r-- | Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex | 86 |
1 files changed, 57 insertions, 29 deletions
diff --git a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex index ea91e51a474..2fa480ae814 100644 --- a/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex +++ b/Master/texmf-dist/tex/generic/pstricks-add/pstricks-add.tex @@ -31,8 +31,8 @@ \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi \ifx\PSTmathLoaded\endinput\else \input pst-math \fi % -\def\fileversion{3.89a} -\def\filedate{2020/02/12} +\def\fileversion{3.90} +\def\filedate{2021/09/10} \let\pstricksaddFV\fileversion \message{`pstricks-add' v\fileversion, \filedate\space (dr,hv)} % @@ -750,6 +750,28 @@ a add } ifelse ){#5}% } % +\def\psRiemannSum(#1,#2)#3#4{% (x0,x1) n f(#1) + \def\psFunction@##1{#4}% + \edef\ps@@dx{\pscalculate{(#2-#1)/#3}}% + \edef\ps@@dxHalf{\pscalculate{\ps@@dx/2}}% +% \typeout{dx=\ps@dx}% + \def\psRightSumValue{0}% + \def\psLeftSumValue{0}% + \def\psMiddleSumValue{0}% + \def\psDiffSumValue{0}% + \Multido{\rA=#1+\ps@@dx,\rB=\ps@@dx+\ps@@dx,\rC=\ps@@dxHalf+\ps@@dx}{#3}{% + \def\ps@rightY{\pscalculate{\psFunction@{\rB}}}% + \def\ps@leftY{\pscalculate{\psFunction@{\rA}}}% + \def\ps@middleY{\pscalculate{\psFunction@{\rC}}}% +% \typeout{\ps@leftY, \ps@rightY }% + \edef\psLeftSumValue{\pscalculate{\psLeftSumValue+\ps@@dx*\ps@leftY}}% + \edef\psRightSumValue{\pscalculate{\psRightSumValue+\ps@@dx*\ps@rightY}}% + \edef\psMiddleSumValue{\pscalculate{\psMiddleSumValue+\ps@@dx*\ps@middleY}}% + \edef\psDiffSumValue{\pscalculate{\psDiffSumValue+abs(\ps@@dx*(\ps@rightY-\ps@leftY))}}% +% \typeout{\psLeftSumValue , \psRightSumValue }% + }% end \Multido +} + %\define@key[psset]{pstricks-add}{method}{\def\psk@method{#1}}% defined in pst-plot \define@key[psset]{pstricks-add}{whichabs}{\def\psk@whichabs{#1}}% \define@key[psset]{pstricks-add}{whichord}{\def\psk@whichord{#1}}% @@ -1361,7 +1383,6 @@ a add % \def\psGTriangle{\def\pst@par{}\pst@object{psGTriangle}} \def\psGTriangle@i(#1)(#2)(#3)#4#5#6{{% - \def\solid@star{}% \begin@ClosedObj \pst@getcoor{#1}\pst@tempA % A: "rgb xr xg xb" or "gray xg" \pst@getcoor{#2}\pst@tempB % B @@ -1374,11 +1395,14 @@ a add \pst@tempB % B \psk@gangle % rotating angle \pst@tempA % A, temporary origin - /rgb {} def - /gray {} def - [ \pst@colorC ] aload length 1 eq { dup dup } if 3 array astore % gray -> rgb - [ \pst@colorB ] aload length 1 eq { dup dup } if 3 array astore - [ \pst@colorA ] aload length 1 eq { dup dup } if 3 array astore +% /rgb {} def +% /gray {} def +% /rg /setrgbcolor load def +% /RG /setrgbcolor load def +% we use RGB + [ \psgetRGBColorValues{\pst@colorC} ] aload length 1 eq { dup dup } if 3 array astore % gray -> rgb + [ \psgetRGBColorValues{\pst@colorB} ] aload length 1 eq { dup dup } if 3 array astore + [ \psgetRGBColorValues{\pst@colorA} ] aload length 1 eq { dup dup } if 3 array astore tx@addDict begin GTriangle end % PS part }% \if@star\pspolygon[fillstyle=none](#1)(#2)(#3)\fi% draw borderline @@ -1417,28 +1441,32 @@ a add \define@key[psset]{pstricks-add}{Yoffset}[0pt]{\pst@getlength{#1}\psk@Yoffset} \define@key[psset]{pstricks-add}{XYoffset}[0pt]{\pst@getlength{#1}\psk@Xoffset\let\psk@Yoffset\psk@Xoffset} \psset[pstricks-add]{XYoffset=0pt} +\define@boolkey[psset]{pstricks-add}[Pst@]{PixelPlot}[true]{} % \ifPst@saveData \define@key[psset]{pstricks-add}{colorType}[0]{\def\psk@colorType{#1}} \define@key[psset]{pstricks-add}{colorTypeDef}[{}]{\def\psk@colorTypeDef{#1\space}} -\psset[pstricks-add]{colorType=0,colorTypeDef={}} % 0-> two color mode 1->wavelength mode (400..700nm) +\psset[pstricks-add]{PixelPlot=false,colorType=0,colorTypeDef={}} % 0-> two color mode 1->wavelength mode (400..700nm) % 0-> two color mode % 1-> wavelength mode (400..700nm) % 2-> wavelength mode inverse % 3-> gray color mode % 4-> gray color mode invers % 5-> own color definition +% + \def\psMatrixPlot{\def\pst@par{}\pst@object{psMatrixPlot}} \def\psMatrixPlot@i#1#2#3{% \pst@killglue% \addbefore@par{xStep=1,yStep=1}% \begin@SpecialObj% \addto@pscode{ + 20 dict begin (#3) run % load the data file /Min 0 def /Max 0 def dotmatrix { dup Min lt { /Min ED } { dup Max gt { /Max ED } { pop } ifelse } ifelse } forall /dMaxMin Max Min sub def - \psk@dotsize + \psk@dotsize % defines /DS ... def \psk@Xoffset\space \psk@Yoffset\space translate - \@nameuse{psds@\psk@dotstyle} % + \ifPst@PixelPlot\else\@nameuse{psds@\psk@dotstyle}\fi /n 0 def % index for element 1 1 #1 { % the y loop (outer one) /y exch def % save y @@ -1463,13 +1491,15 @@ a add currentdict /colorTypeDef known { colorTypeDef } { \psk@colorTypeDef } ifelse \fi x \psk@xStep\space mul \pst@number\psxunit mul - \ifPst@ChangeOrder #1 y sub 1 add \else y \fi \psk@yStep\space mul \pst@number\psyunit mul Dot% + \ifPst@ChangeOrder #1 y sub 1 add \else y \fi \psk@yStep\space mul \pst@number\psyunit mul + \ifPst@PixelPlot 1 DS mul 0 360 arc fill \else Dot \fi \ifcase\psk@colorType } { pop } ifelse \fi /n n 1 add def } for } for + end }% \end@SpecialObj% \ignorespaces% @@ -2185,34 +2215,32 @@ a add \def\ps@lympicRing(#1)#2{% \rput(#1){% \pscircle[linewidth=0.25,linecolor=#2](0,0){1.375}% - \pscircle[linewidth=0.05,linecolor=white](0,0){1.425}% - \pscircle[linewidth=0.05,linecolor=white](0,0){1.125}}} + \pscircle[linewidth=0.05,linecolor=\pst@bgcolor](0,0){1.525}% + \pscircle[linewidth=0.05,linecolor=\pst@bgcolor](0,0){1.225}}} \def\ps@lympicArc(#1)#2#3#4{% \rput(#1){% - \psarc[linewidth=0.25,linecolor=#2](0,0){1.25}{#3}{#4}% - \psarc[linewidth=0.05,linecolor=white](0,0){1.4}{#3}{#4}% - \psarc[linewidth=0.05,linecolor=white](0,0){1.1}{#3}{#4}}} + \psarc[linewidth=0.25,linecolor=#2](0,0){1.375}{#3}{#4}% + \psarc[linewidth=0.05,linecolor=\pst@bgcolor](0,0){1.525}{#3}{#4}% + \psarc[linewidth=0.05,linecolor=\pst@bgcolor](0,0){1.225}{#3}{#4}}} \def\psOlympicRings{\pst@object{psOlympicRings}} \def\psOlympicRings@i(#1){% \pst@killglue \begingroup - \addbefore@par{psscale=1}% -% \begin@SpecialObj + \addbefore@par{bgcolor=white,dimen=inner,psscale=1}% \use@par \rput(#1){% \psscalebox{\psk@@psscale}{% - %\begin{pspicture}(-4.5,-3)(4.5,1.5) - \ps@lympicRing(-3,0){OlympicBlue}% - \ps@lympicRing(-1.5,-1.375){OlympicYellow}% - \ps@lympicArc(-3,0){OlympicBlue}{330}{30}% + \ps@lympicRing(-3.2,0){OlympicBlue}% + \ps@lympicRing(-1.6,-1.375){OlympicYellow}% + \ps@lympicArc(-3.2,0){OlympicBlue}{330}{30}% \ps@lympicRing(0,0){black}% - \ps@lympicArc(-1.5,-1.375){OlympicYellow}{30}{90}% - \ps@lympicRing(1.5,-1.375){OlympicGreen}% + \ps@lympicArc(-1.6,-1.375){OlympicYellow}{30}{90}% + \ps@lympicRing(1.6,-1.375){OlympicGreen}% \ps@lympicArc(0,0){black}{330}{30}% - \ps@lympicRing(3,0){OlympicRed}% - \ps@lympicArc(1.5,-1.375){OlympicGreen}{30}{90}}}% - %\end{pspicture} -% \end@SpecialObj + \ps@lympicRing(3.2,0){OlympicRed}% + \ps@lympicArc(1.6,-1.375){OlympicGreen}{30}{90} + }% + }% \endgroup } |