mirror of
https://github.com/inexorabletash/jsbasic.git
synced 2024-10-09 12:57:09 +00:00
26 lines
594 B
Plaintext
26 lines
594 B
Plaintext
10 REM Boy's Surface
|
|
20 REM From the book "Topologicon" by Jean-Pierre Petit
|
|
100 PI=3.141592:P3=PI/3:P6=PI/6:P8=PI/8
|
|
110 HGR : POKE 49234,0
|
|
120 HCOLOR=3
|
|
130 FOR MU = 0 TO PI STEP 0.1
|
|
140 D=34+4.79*SIN(6*MU-P)
|
|
150 E=6.73*SIN(3*MU-P6)
|
|
160 A=D+E
|
|
170 B=D-E
|
|
180 AL=(P8)*SIN(3*MU)
|
|
190 C1=A*A-B*B
|
|
200 C2=SQR(A*A+B*B)
|
|
210 CM=COS(MU)
|
|
220 SM=SIN(MU)
|
|
230 FOR TE=0 TO 6.282 STEP .03
|
|
240 X1=C1/C2+A*COS(TE)-B*SIN(TE)
|
|
250 Z1=C2+A*COS(TE)+B*SIN(TE)
|
|
260 REM KOORDINATEN
|
|
270 X=X1*CM-Z1*SIN(AL)*SM
|
|
280 Y=X1*SM+Z1*SIN(AL)*SM
|
|
300 REM ZEICHNUNG
|
|
310 HPLOT 140+X,96+Y
|
|
320 NEXT TE
|
|
330 NEXT MU
|