summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips/pst-func
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-03-22 23:29:41 +0000
committerKarl Berry <karl@freefriends.org>2008-03-22 23:29:41 +0000
commit8328d8188fb85a8733a4f03c71b40f415ac51365 (patch)
tree7ad37fe6429fe77c892d6395d01700f1329ce34b /Master/texmf-dist/dvips/pst-func
parentb552fc5adb5017e593f10eeed7bfd18e10e531ac (diff)
pst-func 0.53
git-svn-id: svn://tug.org/texlive/trunk@7087 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pst-func')
-rw-r--r--Master/texmf-dist/dvips/pst-func/pst-func.pro50
1 files changed, 49 insertions, 1 deletions
diff --git a/Master/texmf-dist/dvips/pst-func/pst-func.pro b/Master/texmf-dist/dvips/pst-func/pst-func.pro
index df17f4578d6..03bdf15ef53 100644
--- a/Master/texmf-dist/dvips/pst-func/pst-func.pro
+++ b/Master/texmf-dist/dvips/pst-func/pst-func.pro
@@ -15,7 +15,7 @@
%% `pst-func' is a PSTricks package to plot special math functions
%%
%%
-%% version 0.07 / 2007-08-30 Herbert Voss <voss _at_ pstricks.de>
+%% version 0.08 / 2008-03-21 Herbert Voss <voss _at_ pstricks.de>
%
/tx@FuncDict 100 dict def
tx@FuncDict begin
@@ -38,6 +38,54 @@ tx@FuncDict begin
m factorial n factorial m n sub factorial mul div } ifelse } ifelse
} def
%
+/BezierPascal [
+ [ 1 ] % 0
+ [ 1 1 ] % 1
+ [ 1 2 1 ] % 2
+ [ 1 3 3 1 ] % 3
+ [ 1 4 6 4 1 ] % 4
+ [ 1 5 10 10 5 1 ] % 5
+ [ 1 6 15 20 15 6 1 ] % 6
+ [ 1 7 21 35 35 21 7 1 ] % 7
+ [ 1 8 28 56 70 56 28 8 1 ] % 8
+ [ 1 9 36 84 126 126 84 36 9 1 ] % 9
+] def
+%
+/GetBezierCoor { % t on stack
+ 10 dict begin % hold all local
+ /t ED
+ /t1 1 t sub def % t1=1-t
+ /Coeff BezierPascal BezierType get def % get the coefficients
+ 0 0 % initial values for x y
+ BezierType -1 0 { % BezierType,...,2,1,0
+ /I ED % I=BezierType,...,2,1,0
+ /J BezierType I sub def % J=0,1,2,...,BezierType
+ /T t I exp Coeff J get mul def % coeff(J)*t^I
+ /T1 t1 J exp def % t1^J
+ Points I dup add 1 add get % y(2*I+1)
+ T mul T1 mul add % the y coordinate
+ exch % y x
+ Points I dup add get % x(2*I)
+ T mul T1 mul add % the x coordinate
+ exch % x y
+ } for % x y on stack
+ end
+} def
+%
+/BezierCurve { % on stack [ coors psk@plotpoints BezierType
+ /BezierType ED
+ 1 exch div /epsilon ED
+ ] /Points ED % yi xi ... y3 x3 y2 x2 y1 x1 y0 x0
+ epsilon GetBezierCoor % next Bezier point
+ Points 0 get Points 1 get % starting point
+ ArrowA moveto
+ epsilon epsilon 1 {
+ /t ED
+ t GetBezierCoor
+ t 0.9999 lt { lineto }{ 1 epsilon sub GetBezierCoor 4 2 roll ArrowB pop pop pop pop } ifelse
+ } for
+} def
+%
/Si { % integral sin from 0 to x (arg on stack)
/arg exch def
/Sum arg def