summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-3dplot
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-01-25 00:36:22 +0000
committerKarl Berry <karl@freefriends.org>2008-01-25 00:36:22 +0000
commit084f1b4b577b51129c688cc6b3b87279a313a576 (patch)
tree861000ea7b56771df9c503030c5d1ba89856a3a5 /Master/texmf-dist/tex/generic/pst-3dplot
parent7ca4082666f4f857a378a5330e889aa36051e02b (diff)
pst-3dplot 1.79 (23jan08)
git-svn-id: svn://tug.org/texlive/trunk@6395 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-3dplot')
-rw-r--r--Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex76
1 files changed, 49 insertions, 27 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex b/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
index 8669b0e7433..8e12de2b028 100644
--- a/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
+++ b/Master/texmf-dist/tex/generic/pst-3dplot/pst-3dplot.tex
@@ -1,3 +1,4 @@
+%% $Id: pst-3dplot.tex 9 2008-01-03 20:22:50Z herbert $
%%
%% This is file `pst-3dplot.tex',
%%
@@ -26,8 +27,8 @@
\ifx\PSTricksAddLoaded\endinput\else\input pstricks-add.tex\fi
\ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi
%
-\def\fileversion{1.78}
-\def\filedate{2007/12/22}
+\def\fileversion{1.79}
+\def\filedate{2008/01/03}
\message{`PST-3dplot' v\fileversion, \filedate\space (HV,DL)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -125,6 +126,8 @@
\define@key[psset]{pst-3dplot}{zCoor}{\pst@checknum{#1}\psk@ThreeDplot@zCoor }
\psset[pst-3dplot]{zCoor=0}
%
+\define@boolkey[psset]{pst-3dplot}[Pst@]{algebraic}[true]{}% same as in pstricks-add
+\psset[pst-3dplot]{algebraic=false}
\def\drawStyle@xLines{xLines}% 0
\def\drawStyle@yLines{yLines}% 1
\def\drawStyle@xyLines{xyLines}% 2
@@ -880,21 +883,32 @@
\pst@tempB\space \tx@ConvertToCartesian
/zB \tx@Z def /yB \tx@Y def /xB \tx@X def % b
\else
- \pst@tempC\space /zM exch def /yM exch def /xM exch def % center
- \pst@tempA\space /zA exch def /yA exch def /xA exch def % a
- \pst@tempB\space /zB exch def /yB exch def /xB exch def % b
+ \pst@tempC\space /zM ED /yM ED /xM ED % center
+ \pst@tempA\space /zA ED /yA ED /xA ED % a
+ \pst@tempB\space /zB ED /yB ED /xB ED % b
\fi
/aStart \psk@ThreeDplot@beginAngle\space def
% /aEnd \psk@ThreeDplot@endAngle\space dup aStart lt { 360 add } if def
% /da aEnd aStart sub \psk@plotpoints\space div abs def
/aEnd \psk@ThreeDplot@endAngle\space def
/da aEnd aStart sub \psk@plotpoints\space div def
+ \pst@3ddict
+ /vecA [xA yA zA] vector-length def
+ /vecB [xB yB zB] vector-length def
+ end
/xyz {
- xM xA angle cos mul add xB angle sin mul add
- yM yA angle cos mul add yB angle sin mul add
- zM zA angle cos mul add zB angle sin mul add
- \pst@3ddict saveCoor ConvertTo2D
- x2D \pst@number\psxunit mul y2D \pst@number\psyunit mul end
+ \pst@3ddict %
+%
+% the angle in the parameter equation is not proportional to the real angle!
+% phi=atan(b*tan(angle)/a)+floor(angle/180+0.5)*180
+%
+ /phi angle cvi 90 mod 0 eq { angle } { vecA angle tan mul vecB atan
+ angle 180 div .5 add floor 180 mul add } ifelse def
+ xM xA phi cos mul add xB phi sin mul add
+ yM yA phi cos mul add yB phi sin mul add
+ zM zA phi cos mul add zB phi sin mul add
+ saveCoor ConvertTo2D
+ x2D \pst@number\psxunit mul y2D \pst@number\psyunit mul end
} def
/angle aStart def
}%
@@ -905,14 +919,15 @@
\ignorespaces}
%
\def\pstThreeDEllipse@ii{%
- \addto@pscode{%
+ \addto@pscode{%
xyz \@nameuse{beginqp@\psplotstyle}
\psk@plotpoints 1 sub {
/angle angle da add def
xyz \@nameuse{doqp@\psplotstyle}
} repeat
/angle aEnd def
- xyz \@nameuse{doqp@\psplotstyle}}%
+ xyz \@nameuse{doqp@\psplotstyle}
+ }%
\@nameuse{endqp@\psplotstyle}}
\def\pstThreeDEllipse@iii{%
@@ -927,7 +942,8 @@
} repeat
/angle aEnd def
xyz
- n 2 roll}%
+ n 2 roll
+ }%
\@nameuse{endplot@\psplotstyle}}
%
\def\pstThreeDCircle{\pstThreeDEllipse}
@@ -1308,6 +1324,8 @@
\if@pst% lines and dots
\addto@pscode{
\variablesIIID
+ /func { #5 } def
+ \ifPst@algebraic /Func ( #5 ) tx@addDict begin AlgParser end cvx def \fi
/xMin #1 def
/x xMin def
/x1 #2 def
@@ -1315,10 +1333,9 @@
/y1 #4 def
/dx x1 x sub \psk@ThreeDplot@xPlotpoints\space dup 0 gt {div}{pop} ifelse def
/dy y1 y sub \psk@ThreeDplot@yPlotpoints\space dup 0 gt {div}{pop} ifelse def
- /func {#5} def
/xyz {
- x \psk@ThreeDplot@zCoor\space 0 gt { func }{ y } ifelse
- \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ func } ifelse
+ x \psk@ThreeDplot@zCoor\space 0 gt { \ifPst@algebraic Func \else func \fi }{ y } ifelse
+ \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ \ifPst@algebraic Func \else func \fi } ifelse
tx@3DPlotDict begin
saveCoor
ConvertTo2D
@@ -1332,16 +1349,17 @@
\@nameuse{beginplot@\psplotstyle}%
\addto@pscode{
\variablesIIID
+ /func { #5 } def
+ \ifPst@algebraic /Func ( #5 ) tx@addDict begin AlgParser end cvx def \fi
/xMin #1 def
/x xMin def
/x1 #2 def
/dx x1 x sub \psk@ThreeDplot@xPlotpoints\space dup 0 gt {div}{pop} ifelse def
/dy #4\space #3\space sub \psk@ThreeDplot@yPlotpoints\space dup 0 gt {div}{pop} ifelse def
/y #3\space \n@Y\space dy mul add def
- /func {#5} def
/xyz {
- x \psk@ThreeDplot@zCoor\space 0 gt { func }{ y } ifelse
- \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ func } ifelse
+ x \psk@ThreeDplot@zCoor\space 0 gt { \ifPst@algebraic Func \else func \fi }{ y } ifelse
+ \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ \ifPst@algebraic Func \else func \fi } ifelse
tx@3DPlotDict begin
saveCoor
ConvertTo2D
@@ -1402,6 +1420,8 @@
\if@pst% lines and dots
\addto@pscode{%
\variablesIIID
+ /func { #5 } def
+ \ifPst@algebraic /Func (#5) tx@addDict begin AlgParser end cvx def \fi
/x #1 def
/x1 #2 def
/yMin #3 def
@@ -1409,10 +1429,9 @@
/y1 #4 def
/dx x1 x sub \psk@ThreeDplot@xPlotpoints\space dup 0 gt {div}{pop} ifelse def
/dy y1 y sub \psk@ThreeDplot@yPlotpoints\space dup 0 gt {div}{pop} ifelse def
- /func {#5} def
/xyz {
- x \psk@ThreeDplot@zCoor\space 0 gt { func }{ y } ifelse
- \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ func } ifelse
+ x \psk@ThreeDplot@zCoor\space 0 gt { \ifPst@algebraic Func \else func \fi }{ y } ifelse
+ \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ \ifPst@algebraic Func \else func \fi } ifelse
tx@3DPlotDict begin
saveCoor
ConvertTo2D
@@ -1426,16 +1445,17 @@
\@nameuse{beginplot@\psplotstyle}%
\addto@pscode{%
\variablesIIID
+ /func { #5 } def
+ \ifPst@algebraic /Func (#5) tx@addDict begin AlgParser end cvx def \fi
/yMin #3 def
/y yMin def
/y1 #4 def
/dy y1 y sub \psk@ThreeDplot@yPlotpoints\space dup 0 gt {div}{pop} ifelse def
/dx #2\space #1\space sub \psk@ThreeDplot@xPlotpoints\space dup 0 gt {div}{pop} ifelse def
/x #1\space \n@X\space dx mul add def
- /func { #5 } def % func=f(x,y)
/xyz {
- x \psk@ThreeDplot@zCoor\space 0 gt { func }{ y } ifelse
- \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ func } ifelse
+ x \psk@ThreeDplot@zCoor\space 0 gt { \ifPst@algebraic Func \else func \fi }{ y } ifelse
+ \psk@ThreeDplot@zCoor\space 0 gt { \psk@ThreeDplot@zCoor }{ \ifPst@algebraic Func \else func \fi } ifelse
tx@3DPlotDict begin
saveCoor
ConvertTo2D
@@ -1503,6 +1523,7 @@
\def\pslinetype{0}%
\addto@pscode{%
\variablesIIID
+ \ifPst@algebraic /Func (#5) tx@addDict begin AlgParser end cvx def \fi
/tMin #1 def
/t tMin def
/t1 #2 def
@@ -1512,7 +1533,7 @@
{ 1 sub div }{ pop pop 0 } ifelse def % step for t
/du u1 u sub \psk@ThreeDplot@yPlotpoints\space dup 1 gt %
{ 1 sub div }{ pop pop 0 } ifelse def % step for u
- /xyz { #5
+ /xyz { \ifPst@algebraic Func \else #5 \fi
tx@3DPlotDict begin
saveCoor
ConvertTo2D
@@ -1527,6 +1548,7 @@
\@nameuse{beginplot@\psplotstyle}%
\addto@pscode{%
\variablesIIID
+ \ifPst@algebraic /Func (#5) tx@addDict begin AlgParser end cvx def \fi
/tMin #1 def
/t tMin def
/t1 #2 def
@@ -1536,7 +1558,7 @@
/du #4\space #3\space sub \psk@ThreeDplot@yPlotpoints\space dup 1 gt %
{ 1 sub div }{ pop pop 0 } ifelse def % step for t
/u #3\space \n@Y\space du mul add def
- /xyz { #5
+ /xyz { \ifPst@algebraic Func \else #5 \fi
tx@3DPlotDict begin
saveCoor
ConvertTo2D