summaryrefslogtreecommitdiff
path: root/graphics/pictex/addon/picmore.tex
blob: 1bda81e6ae3b4142ac3b21a6b344ff35828baa57 (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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% PiCTeX Erweiterungen von Andreas Schrell  %
%                          Windhoevel 2     %
%                          5600 Wuppertal 2 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Version 1.0                    29.10.1989 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Befehle fr die Benutzer:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \setsignal            zur Benutzung wie \setlinear        %
%                       \plot erzeugt danach Signalverlaeufe%
%                       fuer Impulsdiagramme. Es werden TeX-%
%                       Linien benutzt, daher schneller als %
%                       \plot mit \setlinear                %
% Bsp:                                                      %
% \setsignal \plot 0 1  1 0  2 1  4 0  7 1  8 0 /           %
% erzeugt                                                   %
% 0 1 2 3 4 5 6 7 8                                         %
% __   ___       _                                          %
%   ! !   !     ! !                                         %
%   !_!   !_____! !                                         %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \setmsignal           zur Benutzung wie \setlinear        %
%                       \plot erzeugt danach Signalverlaeufe%
%                       fuer Impulsdiagramme. Es werden TeX-%
%                       Linien benutzt, daher schneller als %
%                       \plot mit \setlinear                %
% Bsp:                                                      %
% \setmsignal \plot 0 1 1  2 2  4 3  6 0  7 1 1      %
% erzeugt                                                   %
% 0 1 2 3 4 5 6 7 8                                         %
%      ---                                                  %
%     !   !                                                 %
%    -    !                                                 %
% --!     !    -                                            %
%         !___!                                             %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\catcode`!=11

\def\setsignal{%
 \let\!drawcurve=\!scurve}
 
\def\!scurve #1 #2 {%
 \edef\!hxS{#1}%
 \edef\!hyS{#2}%
 \!sjoin}
 
\def\!sjoin#1 #2 {%
 \putrule from {\!hxS} {\!hyS} to {#1} {\!hyS}
 \putrule from {#1} {\!hyS} to {#1} {#2}
 \edef\!hxS{#1}%
 \edef\!hyS{#2}%
 \!ifnextchar/{\!finish}{\!sjoin}}


\def\setmsignal{%
 \let\!drawcurve=\!smcurve}
 
\def\!smcurve #1 #2 #3 {%
 \edef\!hxS{#2}%
 \edef\!hyS{#3}%
 \putrule from {#1} {\!hyS} to {\!hxS} {\!hyS}
 \!smjoin}
 
\def\!smjoin#1 #2 {%
 \putrule from {\!hxS} {\!hyS} to {\!hxS} {#2}
 \putrule from {\!hxS} {#2} to {#1} {#2}
 \edef\!hxS{#1}%
 \edef\!hyS{#2}%
 \!ifnextchar/{\!finish}{\!smjoin}}

\catcode`!=12