diff options
Diffstat (limited to 'Master/texmf-dist/dvips')
-rw-r--r-- | Master/texmf-dist/dvips/pst-3dplot/pst-3dplot.pro | 56 |
1 files changed, 45 insertions, 11 deletions
diff --git a/Master/texmf-dist/dvips/pst-3dplot/pst-3dplot.pro b/Master/texmf-dist/dvips/pst-3dplot/pst-3dplot.pro index 6cd943f344c..4c432b54f13 100644 --- a/Master/texmf-dist/dvips/pst-3dplot/pst-3dplot.pro +++ b/Master/texmf-dist/dvips/pst-3dplot/pst-3dplot.pro @@ -1,4 +1,4 @@ -%% $Id: pst-3dplot.pro 9 2008-01-03 20:22:50Z herbert $ +%% $Id: pst-3dplot.pro 50 2008-11-12 13:44:21Z herbert $ %% %% This is file `pst-3dplot.pro', %% @@ -92,6 +92,17 @@ tx@3DPlotDict begin } repeat } def % +% the angle in the parameter equation for an ellipse is not proportional to the real angle! +% phi=atan(b*tan(angle)/a)+floor(angle/180+0.5)*180 +% +/getPhi { % on stack: vecA vecB angle + 3 dict begin + /angle exch def /vecB exch def /vecA exch def + angle cvi 90 mod 0 eq { angle } { vecA angle tan mul vecB atan + angle 180 div .5 add floor 180 mul add } ifelse + end +} def +% /RotSet (set ) def % /eulerRotation false def @@ -190,26 +201,20 @@ tx@3DPlotDict begin } def % /SetMxyz { - 1.0 0.0 0.0 0.0 1.0 0.0 0.0 0.0 1.0 3 3 11 array astore /MnewTOold ED RotSequence cvx exec % Now create a new MnewTOold using xyz, etc. - } def % /ConcatMQuaternion { - MnewTOold % Push onto stack SetMQuaternion % Uses [xyz]RotVec and RotAngle to make MnewToOld MnewTOold matmul /MnewTOold ED - } def % /ConcatMxyz { - MnewTOold % Push onto stack SetMxyz % Uses RotX, etc. to set MnewTOold MnewTOold matmul /MnewTOold ED - } def % /RotatePoint{ @@ -798,6 +803,13 @@ tx@3DPlotDict begin end } def % +% u -> e_u with |e_u|=1 +/vector-unit { 1 dict begin + dup vector-length 1 exch div + vector-scale + end +} def +% % u v -> u+v /vector-add { 1 dict begin /v exch def @@ -812,7 +824,7 @@ tx@3DPlotDict begin ] end } def - +% % u v -> u-v /vector-sub { 1 dict begin /v exch def @@ -837,10 +849,33 @@ end } def ] end } def % - +% +% [u] [v] -> [u x v] +/vector-prod { %% x1 y1 z1 x2 y2 z2 +6 dict begin + aload pop + /zp exch def /yp exch def /xp exch def + aload pop + /z exch def /y exch def /x exch def + [ y zp mul z yp mul sub + z xp mul x zp mul sub + x yp mul y xp mul sub ] +end +} def +% +% [u] [v] -> u.v +/vector-mul { %% x1 y1 z1 x2 y2 z2 +6 dict begin + aload pop + /zp exch def /yp exch def /xp exch def + aload pop + /z exch def /y exch def /x exch def + x xp mul y yp mul add z zp mul add +end +} def +% % [x y z ... ] -> r % watch out for overflow - /vector-length { 1 dict begin dup % find maximum entry @@ -853,7 +888,6 @@ dup pop } ifelse } forall - max 0 ne { 0 exch { % 0 v[i] |