Внутренняя структура Пи
Udo Schmidt (Германия)

Pi

С помощью программы, написанной около 15 лет назад, автор ставит в соответствие координаты точки и ее цвет, задаваемый двойным отклонением номера пикселя от числа Pi (детали в коде программы ниже).


defdbl a-z

A=1 'Iterations-Ausgangswerte
X=1
B=1/sqr(2)
c=1/4

for i=1 to 4
Y=A
A=(A+B)/2
B=SQR(B*Y)
C=C-X*(A-Y)^2
X=2*X
next
P=((A+B)^2)/(4*c) ' PI-Iteration in 4 Stufen

cls: screen 8
Print " Pi wurde hier berechnet als: ",P
PRINT " LdV berechnete Pi mit : ",(4/14+46/146+24/130)*4
print " Die LdV-Abweichung betr„gt : ", P-(4/14+46/146+24/130)*4
print
print " Das Programm startet mit beliebiger Taste"
Z1$=inkey$: input Z$
cls
locate 2,5: Print " Die innere Struktur der Zahl PI, Das Geheimnis von Schwarz-Gelb"
For i=.0001 to 65 step .0002
f=int(i*p*10000)/(i*10000)-p 'Farbwert

A=1+f
X=1 :B=1/SQR(2): C=1/4
for j=1 to 3
Y=A: A=(A+B)/2
B=SQR(B*Y) : C=C-X*(A-Y)^2
X=2*X
next
F=abs(25000*(((A+B)^2)/(4*C)-P)*i) 'Farbtiefe

pset(int((i/.0113)^(3/4)),20+226*(i/.0113-int(i/0.0113))),F 'Punktzeichnung
Z$=inkey$: if z$<>"" then end
next
locate 28,1: Print "Jede Senkrechte hat 113 Pixel. Alle 113 Stufen entstehen wieder Werte f?r PI,"
locate 29,1: Print "die immer genauer werden. Doch bald wechselt die Abweichung zu PI das Vorzeichen" und "
locate 30,1: Print "und ihr absoluter Wert steigt wieder an, w„hrend knapp daneben eine neue Reihe"
locate 31,1: Print "zu wachsen beginnt. Ob sie eine bessere gebrochene Zahl f?r Pi hervorbringt ? "
locate 32,1: PRINT "Versuche 563864 !"
h=33215 'PI-Nenner-Variable
while h>0
circle(int((h/113)^(3/4)),20+h-113*int(h/113)),6,bf,1 'LdV-Wert
locate 32,56: PRINT h
locate 32,20: input "Ihr Nenner bis 600.000 oder 0(Ende): ",h 'UserEingabe
If h>0 then else input "(563864-1(Zeile)-33215)=113*4696 Abstand ",h: end

locate 33,1: PRINT "Ihr Pi-Nenner ergibt die Abweichung:" int(h*p+.01)/h-p
wend

end