-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathN-ECK.bc
More file actions
31 lines (31 loc) · 1.11 KB
/
N-ECK.bc
File metadata and controls
31 lines (31 loc) · 1.11 KB
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
1000 A=100:GOTO20:REM ### N-ECK ###
1010 HO=INT((HO-LEN(SR$)-6)/2):VE=0:
1020 SR$="N-ECK":GOSUB110:GOSUB150:PRINT
1030 INPUT"Anzahl der Ecken";N:N=INT(N)
1040 IF(N>12)OR(N<3) THENPRINT"Fehler":GOTO1020
1050 Q=6.283185/N:DIMX(N),Y(N):XX=4/3:YY=.5
1060 R=1/3:P2=1/15:INPUT"Drehwinkel =";W
1070 D=W*.0174533:CN=0:REM pi/180
1080 S=SIN(D):C=COS(D):P=COS(Q):T=SIN(Q)
1090 P4=T/(C*T+S-P*S):X(1)=P:Y(1)=T:GOSUB600
1100 FORI=1 TON-1
1110 P=I*Q:X(I)=COS(P):Y(I)=SIN(P)
1120 NEXTI
1130 X(0)=1:Y(0)=0:X(N)=1:Y(N)=0
1140 HO=YY+R*X(0):RV=XX*R:VE=YY-RV*Y(0):GOSUB620
1150 FORI=1 TON
1160 HO=YY+R*X(I):VE=YY-RV*Y(I):GOSUB630
1170 NEXTI
1180 FORI=0 TON
1190 P=X(I)*C-Y(I)*S:Y(I)=Y(I)*C+X(I)*S:X(I)=P
1200 NEXTI
1210 R=R*P4:IF(R>P2)AND(R<.5) THEN1140
1220 HO=0:VE=.1:SR=W:GOSUB300:SR$="Winkel = "+SR$
1230 GOSUB650:VE=.2:SR$="1:weiter 0=Ende"
1240 GOSUB650:GOSUB210:IFIN=49 THEN1000
1250 GOTO950
30000 REM Es wird ein geschachteltes N-Eck gezeichnet
30010 REM Durch den Winkel wird die Dichte bestimmt
32000 REM -----------------------
32010 REM H. Voelz; 11.5.89;24.8.89 fuer Rundfunk
32020 REM XT-compatibler Rechner