| |
|
|
p.specht
|
{$cleq}
Título de la ventana "Mandelbrot-Menge"
' In starker Anlehnung a el Programa de Julian Schmid y Paul Glatz
' Reine (D) Demo 2013-09 by P. Pájaro carpintero, Wien. Use solely at your own risk!
Windowstyle 24
Ventana 400,300
' Ventana (%maxx-640)/2,(%maxy-480)/2 - 640,480
' Ventana 0,0-%maxx,%maxy-42
declarar cxmin!,cxmax!,cymin!,cymax!,iter&,tm&,ans&,zoom!,i&
zoom!=0.7
whileloop 10:i&=&bucle
zoom!=zoom!*1.3333
CXMin!=-2.2 /zoom!
CXMax!= 1.2 /zoom!
CYMin!=-1.5 /zoom!
CYMax!= 1.5 /zoom!
iter&=128
tm&=&gettickcount
ans&=Mandel(cxmin!,cxmax!,cymin!,cymax!,iter&)
tm&=&gettickcount-tm&
locate 1,1:imprimir format$("#0.0000 sec ",tm&/1000);
waitinput 10
caso (%key=27) or (%key=2):end
Endwhile
waitinput 60000
end
nProc Mandel
parámetros cxmin!,cxmax!,cymin!,cymax!,iter&
Declarar CX!,CY!,x!,x2!,y!,tmp!,LX&
Declarar LY&,IC&,col&,w&,hddc&,xd!,yd!
w&=width(hwnd)
hddc& = ~GetWindowDC( %hWnd )
xd! = CXMax! - CXMin!
yd! = CYMax! - CYMin!
whileloop 0,w&
LX&=&bucle
CX! = CXMin!
' f!=float(l&), Float2Largo simplemente l&=long(f!)
tmp!= float(LX&) / float(w&)
cx!=cx! + tmp! * xd!
LY&=0
whileloop 0,height(%hwnd)
LY&=&bucle
CY!=CYMax!-(float(LY&)/float(height(%hwnd)))*yd!
IC&=0
x!=0
x2!=0
y!=0
whileloop Iter&,0,-1
IC& = &bucle
x2! = sqr(x!) - sqr(y!) + cx!
y! = 2.0 * x! * y!
y! = y! + cy!
x! = x2!
If (sqr(x!)+sqr(y!)) > 4.0
Romper
EndIf
EndWhile
col&=IC&*ic&*ic&*ic&*ic&
'col&=RGB( long((float(LX&)/float(width(%hwnd))) )*256, long(float(LX&)/float(width(%hwnd)))*256, IC& | (IC& << 8))
'col& = RGB(IC&,IC&,IC& | (IC& << 8) ) 'sw
SetPixel(%hdc,LX&,LY&,col&)
Endwhile
Endwhile
volver w&
ENDPROC
|
|
|
| Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'... | 09.05.2021 ▲ |
|
|
|