blob: 4e021d197e001718288295864cae6aaec8fe074f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
%% $Id: pstricks-add.sty 726 2018-02-05 13:52:25Z herbert $
%
\RequirePackage{pstricks}
\RequirePackage{pst-plot}
\RequirePackage{pst-node}
\RequirePackage{pst-3d}
\RequirePackage{pst-math}
\RequirePackage{multido}
\ProvidesPackage{pstricks-add}[2018/02/04 v. 0.16 package wrapper for
pstricks-add.tex (hv)]
\input{pstricks-add.tex}
\ProvidesFile{pstricks-add.tex}
[\filedate\space v\fileversion\space `PSTricks-add' (hv)]
\IfFileExists{pstricks-add.pro}{%
\ProvidesFile{pstricks-add.pro}
[2009/12/17 v. 0.23, PostScript prologue file (hv)]
\@addtofilelist{pstricks-add.pro}}{}%
\RequirePackage{pst-calculate}
\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
}
\endinput
|