summaryrefslogtreecommitdiff
path: root/app/eudas/4.3/doc/abb.9-2
blob: 4e9444d31e45d10af8315c6df58a5582e278bc1a (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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
init dgs; 
window (0.0, 0.0, 13.5, 6.5); viewport (0.0,0.0,13.5,6.5); 
(*scale (1.7,1.7, 0.0,0.0);*)
(*clear pixels;*)
 
INT VAR i; 
move (4.0, 0.0); draw (4.0, 2.0); 
move (5.5, 0.0); draw (5.5, 2.0); 
FOR i FROM 0 UPTO 4 REP 
  move (4.0, real (i) * 0.5); 
  draw (5.5, real (i) * 0.5)
END REP; 
 
move (4.0, 3.0); draw (4.0, 6.0); 
move (5.5, 3.0); draw (5.5, 6.0); 
FOR i FROM 0 UPTO 6 REP 
  move (4.0, real (i) * 0.5 + 3.0); 
  draw (5.5, real (i) * 0.5 + 3.0) 
END REP; 
 
move (7.5, 2.0); draw (7.5, 6.0); 
move (9.0, 2.0); draw (9.0, 6.0); 
FOR i FROM 0 UPTO 8 REP 
  move (7.5, real (i) * 0.5 + 2.0); 
  draw (9.0, real (i) * 0.5 + 2.0) 
END REP; 
 
strichel (5.5, 6.0, 7.5, 6.0); 
strichel (5.5, 3.0, 7.5, 3.0); 
strichel (5.5, 1.0, 7.5, 3.0); 
strichel (5.5, 0.0, 7.5, 2.0); 
 
move (5.5, 4.75); draw (6.0, 4.75); 
  draw (6.0, 1.75); draw (5.5, 1.75); 
move (4.0, 3.75); draw (3.5, 3.75); 
  draw (3.5, 1.25); draw (4.0, 1.25); 
 
font size (0.4); font expansion (1.5); 
move (0.0, 0.8); draw ("Koppeldatei"); 
move (0.0, 4.3); draw ("Hauptdatei"); 
move (10.0, 4.3); draw ("virtuelle"); 
move (10.0, 3.4); draw ("Datei");
 
font size (0.3); 
move (4.5, 0.1); draw ("H2"); 
move (4.5, 0.6); draw ("H1"); 
move (4.5, 1.1); draw ("B"); 
move (4.5, 1.6); draw ("A"); 
move (4.5, 3.1); draw ("F4"); 
move (4.5, 3.6); draw ("B"); 
move (4.5, 4.1); draw ("F3"); 
move (4.5, 4.6); draw ("A"); 
move (4.5, 5.1); draw ("F2"); 
move (4.5, 5.6); draw ("F1"); 
move (8.0, 5.6); draw ("F1"); 
move (8.0, 5.1); draw ("F2"); 
move (8.0, 4.6); draw ("A"); 
move (8.0, 4.1); draw ("F3"); 
move (8.0, 3.6); draw ("B"); 
move (8.0, 3.1); draw ("F4"); 
move (8.0, 2.6); draw ("H1"); 
move (8.0, 2.1); draw ("H2"); 
 
PROC strichel (REAL CONST x anf, y anf, x end, y end) : 
 
  REAL VAR laenge := x end - x anf; 
  INT VAR teile := int (abstand/ 0.4); 
  REAL VAR verhaeltnis := (y end - y anf) / laenge;
  laenge := laenge / (real (2 * teile + 1)); 
  INT VAR i; 
  FOR i FROM 0 UPTO teile REP 
    move (x anf + real (i + i) * laenge, 
          y anf + verhaeltnis * real (i + i) * laenge); 
    draw (x anf + real (i + i + 1) * laenge, 
          y anf + verhaeltnis * real (i + i + 1) * laenge) 
  END REP . 
 
abstand : 
  sqrt ((y end - y anf) + (y end - y anf) + 
        (x end - x anf) * (x end - x anf)) . 
 
END PROC strichel; 
 
 
LET myname = "abb.9-2";
save pixels (myname + ".p"); 
FILE VAR f := sequential file (modify, myname + ".p"); 
to line (f, 1); insert record (f); 
write record (f, "#linefeed (0.8)#"); 
insert record (f); write record (f, myname); 
to eof (f); insert record (f); write record (f, myname); 
to line (f, 1);
(* 
pause (9000);
*)