-
Notifications
You must be signed in to change notification settings - Fork 0
/
KLAUSUR0.PAS
executable file
·197 lines (181 loc) · 4.17 KB
/
KLAUSUR0.PAS
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
program aa;
uses crt,graph;
var
farbe0,farbe1,farbe2,farbe3,k,treiber,modus:integer;
phi,xa,xe,ya,ye,l,alpha,v,x,t,dt:real;
ortx1,ortx2,ortx3:string;
wahl1,wahl:char;
procedure menue;
begin
treiber:=detect;
initgraph(treiber,modus,'');
setbkcolor(15);
setcolor(1);
farbe0:=15;
farbe1:=8;
farbe2:=12;
farbe3:=10;
outtextxy(150,200,'Pendel -> 1');
outtextxy(150,250,'Schaschlikspieá -> 2');
outtextxy(150,300,'Rohrkrmmer -> 3');
outtextxy(400,400,'beenden -> b');
end;
procedure linie(L,alpha:real);
begin
xa:=xe;
ya:=ye;
xe:=xa+L*cos(alpha);
ye:=ya-L*sin(alpha);
line(round(xa),round(ya),round(xe),round(ye));
end;
procedure left(phi:real);
begin
alpha:=alpha+phi/180*pi;
end;
procedure right(phi:real);
begin
alpha:=alpha-phi/180*pi;
end;
procedure graphik;
begin
setbkcolor(15);
setcolor(1);
line(10,30,630,30);
line(10,450,630,450);
line(10,30,10,450);
line(630,30,630,450);
outtextxy(235,15,'Pendel ');
l:=200;
alpha:=pi/5;
line(300,100,300,100+round(l));
line(300,100,300-round(l*sin(alpha)),100+round(l*cos(alpha)));
line(300,140,300+round((l-40)*sin(1.1*alpha)),140+round((l-40)*cos(1.1*alpha)));
sector(304,136,0,360,4,4);
arc(300,100,round(270-alpha/pi*180),270,round(l));
arc(300,140,270,round(270+1.1*alpha/pi*180),round(l-40));
circle(300,100,2);
circle(300,100+round(l),2);
circle(300-round(l*sin(alpha)),100+round(l*cos(alpha)),5);
circle(300+round((l-40)*sin(1.1*alpha)),140+round((l-40)*cos(1.1*alpha)),2);
outtextxy(300-round(l*sin(alpha)),112+round(l*cos(alpha)),'C');
outtextxy(300+round((l-40)*sin(1.1*alpha)),150+round((l-40)*cos(1.1*alpha)),'E');
line(430,100+round(l),430,140+round((l-40)*cos(1.1*alpha)));
line(425,100+round(l),435,100+round(l));
line(425,140+round((l-40)*cos(1.1*alpha)),435,140+round((l-40)*cos(1.1*alpha)));
outtextxy(440,80+round(l),'h');
outtextxy(300,110+round(l),'D');
outtextxy(315,100,'B');
outtextxy(315,133,'A');
end;
procedure figur2;
begin
linie(150,alpha);
left(90);
linie(5,alpha);
right(90);
linie(40,alpha);
right(90);
linie(10,alpha);
right(90);
linie(40,alpha);
right(90);
linie(5,alpha);
end;
procedure graphik2;
begin
setbkcolor(0);
setcolor(15);
line(10,30,630,30);
line(10,450,630,450);
line(10,30,10,450);
line(630,30,630,450);
outtextxy(235,15,'Schaschlikspieá ');
circle(200,100,2);
xe:=200;
ye:=100;
alpha:=-pi/2;
figur2;
xe:=200;
ye:=100;
alpha:=-pi/2-pi/6;
setlinestyle(1,0,1);
figur2;
line(215,100,215,272);
line(215,272,211,265);
line(215,272,219,265);
line(215,100,211,107);
line(215,100,219,107);
line(200,320,120,320);
line(200,320,193,316);
line(200,320,193,324);
line(120,320,127,324);
line(120,320,127,316);
setlinestyle(0,0,1);
outtextxy(155,330,'s');
outtextxy(230,185,'1,50 m');
line(300,275,350,275);
line(300,275,305,270);
line(300,275,305,280);
line(305,275,310,280);
line(305,275,310,270);
line(350,272,350,278);
line(350,272,360,272);
line(350,278,360,278);
line(360,272,360,278);
end;
procedure p1;
begin
cleardevice;
graphik;
repeat until keypressed;
menue;
end;
procedure p2;
begin
cleardevice;
graphik2;
repeat until keypressed;
menue;
end;
procedure graphik3;
begin
setbkcolor(0);
setcolor(15);
line(10,30,630,30);
line(10,450,630,450);
line(10,30,10,450);
line(630,30,630,450);
outtextxy(235,15,'Rohrkrmmer ');
ellipse(200,100,0,360,50,10);
line(150,100,150,250);
line(250,100,250,250);
arc(200,250,180,270,50);
arc(270,250,180,270,20);
line(270,270,400,270);
line(200,300,400,300);
ellipse(400,285,0,360,5,15);
line(200,150,200,200);
line(200,200,205,195);
line(200,200,195,195);
end;
procedure p3;
begin
cleardevice;
graphik3;
repeat until keypressed;
menue;
end;
{MAIN}
begin
wahl1:=' ';
menue;
repeat
wahl1:=' ';
if keypressed then wahl1:=readkey;
case wahl1 of
'1':p1;
'2':p2;
'3':p3;
end;
until wahl1='b';
end.