English
Forum

Mandelbrotmenge draw

 

Julian
Schmidt
Hey,
I try straight The Mandelbrotmenge with XProfan to draw.

The Formel to education the Mandelbrotmenge is



C standing here for a complex number. How geb I The in XProfan on?
I thought me first the the amount of C same the length the Verktors is.
Ergo same root(Realteil(c)^2+Imaginärteil(c)^2)
this shining only not To functions.
Def !CXMin -2.2
Def !CXMax 1.2
Def !CYMin -1.5
Def !CYMax 1.5
Def &Iterationen 20
Windowstyle 24
Window Title "Mandelbrotmenge"
Window 50,100 - 400, 300
Declare CX!, CY!, CX2!, CY2!, Z!
Declare LX&, LY&
Declare IC&, ColIC&

whileloop 0, width(%hwnd)

    LX&=&loop
    CX2!=CX!
    CX!=!CXMin+(LX&/width(%hwnd))*(!CXMax-!CXMin)
    Clear LY&

    whileloop 0,height(%hwnd)

        LY&=&loop
        CY2!=CY!
        CY!=!CYMax-(LY&/height(%hwnd))*(!CYMax-!CYMin)
        Clear IC&,Z!

        whileloop &Iterationen

            Z!=Sqr(Z!)+Sqrt(Sqr(CX2!)+Sqr(CY2!))' ZN+1=ZN+Complex(CX,CY)
            IC&=&loop
            Case Z!>4 : break

        EndWhile

        ColIC&=(IC&/&Iterationen)*255
        SetPixel LX&,LY&,RGB(ColIC&,ColIC&,ColIC&)

    Endwhile

Endwhile

waitinput

Greeting
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
07/30/13  
 




Julian
Schmidt
someone a idea?
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
08/07/13  
 




Georg
Teles
Oha, You dig Yes deeply, had I The Höhere maths not default would I Perhaps help can xP sry no idea
 
XProfan 10
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

08/08/13  
 




Paul
Glatz

Def !CXMin -2.2
Def !CXMax 1.2
Def !CYMin -1.5
Def !CYMax 1.5
Def &Iterationen 100
Windowstyle 24
Window Title "Mandelbrotmenge"
Window 50,100 - 400, 300
Declare CX!, CY!, CX2!, CY2!, x!, x2!, y!
Declare LX&, LY&
Declare IC&, ColIC&

whileloop 0, width(%hwnd)

    LX&=&loop
    CX2!=CX!
    CX!=!CXMin+(LX&/width(%hwnd))*(!CXMax-!CXMin)
    Clear LY&

    whileloop 0,height(%hwnd)

        LY&=&loop
        CY2!=CY!
        CY!=!CYMax-(LY&/height(%hwnd))*(!CYMax-!CYMin)
        Clear IC&, x!, x2!, y!

        whileloop &Iterationen

            SetText %hwnd,st$(&loop)
            x2! = x! * x! - y! * y! + cx2!
            y! = 2 * x! * y! + cy2!
            x! = x2!
            IC& = &loop

            If (x! * x! + y! * y! > 4)

                Break

            EndIf

        EndWhile

        ColIC&=(IC&/&Iterationen)*255
        SetPixel LX&,LY&,RGB(ColIC&,ColIC&,ColIC&)

    Endwhile

Endwhile

waitinput
 
08/08/13  
 




Julian
Schmidt
Klappt!


33 kB
Hochgeladen:08/08/13
Downloadcounter142
Download
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
08/08/13  
 




Paul
Glatz
here time something larger


152 kB
Hochgeladen:08/08/13
Downloadcounter159
Download
 
08/08/13  
 




Julian
Schmidt
other Farbschema
Def !CXMin -2.2
Def !CXMax 1.2
Def !CYMin -1.5
Def !CYMax 1.5
Def &Iterationen 50
Windowstyle 24
Window Title "Mandelbrotmenge"
Window 50,100 - 400, 300
Declare CX!, CY!, x!, x2!, y!
Declare LX&, LY&
Declare IC&

whileloop 0, width(%hwnd)

    LX&=&loop
    CX!=!CXMin+(LX&/width(%hwnd))*(!CXMax-!CXMin)
    Clear LY&

    whileloop 0,height(%hwnd)

        LY&=&loop
        CY!=!CYMax-(LY&/height(%hwnd))*(!CYMax-!CYMin)
        Clear IC&, x!, x2!, y!

        whileloop &Iterationen,0,-1

            x2! = x! * x! - y! * y! + cx!
            y! = 2 * x! * y! + cy!
            x! = x2!
            IC& = &loop

            If (x! * x! + y! * y! > 4)

                Break

            EndIf

        EndWhile

        SetPixel LX&,LY&,RGB((LX&/width(%hwnd))*256,(LX&/width(%hwnd))*256,IC& | (IC& << 8))

    Endwhile

Endwhile

waitinput


19 kB
Hochgeladen:08/08/13
Downloadcounter240
Download
 
XProfan X2
Win7 Professional, SP1, AMD FX(tm)-8350 Eight-Core Processor

˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗˗
Webseite [...] 
08/08/13  
 




Paul
Glatz
others colours
Def !CXMin -2.2
Def !CXMax 1.2
Def !CYMin -1.5
Def !CYMax 1.5
Def &Iterationen 100
Windowstyle 24
Window Title "Mandelbrotmenge"
Window 50,100 - 400, 300
Declare CX!, CY!, CX2!, CY2!, x!, x2!, y!
Declare LX&, LY&
Declare IC&, ColIC&

whileloop 0, width(%hwnd)

    LX&=&loop
    CX2!=CX!
    CX!=!CXMin+(LX&/width(%hwnd))*(!CXMax-!CXMin)
    Clear LY&

    whileloop 0,height(%hwnd)

        LY&=&loop
        CY2!=CY!
        CY!=!CYMax-(LY&/height(%hwnd))*(!CYMax-!CYMin)
        Clear IC&, x!, x2!, y!

        whileloop &Iterationen

            x2! = x! * x! - y! * y! + cx2!
            y! = 2 * x! * y! + cy2!
            x! = x2!
            IC& = &loop

            If (x! * x! + y! * y! > 4)

                Break

            EndIf

        EndWhile

        If IC& = &Iterationen

            SetPixel LX&,LY&,0

        Else

            ColIC&=((&Iterationen - IC&)/&Iterationen)*360
            SetPixel LX&,LY&,hsv(ColIC&,1,1)

        EndIf

    Endwhile

EndWhile

Waitinput

Proc hsv

    Parameters h!,s!,v!
    Var hi% = h!/60
    Var f! = ((h!/60) - hi%)
    Var p! = V!*(1-s!)
    Var q! = V!*(1-s!*f!)
    Var t! = V!*(1-s!*(1-f!))

    Select hi%

        CaseOf 1

        Return rgb(q!*255,v!*255,p!*255)

        CaseOf 2

        Return rgb(p!*255,v!*255,t!*255)

        CaseOf 3

        Return rgb(p!*255,q!*255,v!*255)

        CaseOf 4

        Return rgb(t!*255,p!*255,v!*255)

        CaseOf 5

        Return rgb(V!*255,p!*255,q!*255)
        Otherwise
        Return rgb(v!*255,t!*255,p!*255)

    EndSelect

ENDPROC



36 kB
Hochgeladen:08/08/13
Downloadcounter147
Download
 
08/08/13  
 




Georg
Teles
sees super from, class
 
XProfan 10
TC-Programming [...] 
XProfan 8.0 - 10.0 - X2 - X3 - X4

08/08/13  
 




p.specht

try straight, the Mandelbrot-Progi the gentlemen Schmid and Glatz through xpse something vapor To make. from many Fehlern learnt, here half-way funktionierendes part (Notes in the next Posting).
' --------------------------------------------------------
{$cleq}

Windowstyle 24:Window Title "Mandelbrot-Menge"
cls
'Window (%maxx-640)/2,(%maxy-480)/2 - 640,480
'Window 0,0-%maxx,%maxy-42
declare cxmin!,cxmax!,cymin!,cymax!,iter&,tm&,ans&,zoom!,i&

zoom!=0.7
whileloop 10:i&=&loop
zoom!=zoom!*1.3333
CXMin!=-2.2 /zoom!
CXMax!= 1.2 /zoom!
CYMin!=-1.5 /zoom!
CYMax!= 1.5 /zoom!
iter&=255
tm&=&gettickcount
ans&=Mandel(cxmin!,cxmax!,cymin!,cymax!,iter&)
tm&=&gettickcount-tm&
locate 1,1:print stature$("#0.0000 sec ",tm&/1000);
waitinput 10
case (%key=27) or (%key=2):end
Endwhile
waitinput 60000
end

nproc Mandel
parameters cxmin!,cxmax!,cymin!,cymax!,iter&
Declare CX!,CY!,x!,x2!,y!,tmp!,LX&
Declare LY&,IC&,col&,w&,hddc&,xd!,yd!
w&=width(hwnd)
hddc& = ~GetWindowDC( %hWnd )
xd! = CXMax! - CXMin!
yd! = CYMax! - CYMin!

whileloop 0,w&
LX&=&loop
CX! = CXMin!
' f!=float(l&), Float2Long simply l&=long(f!)
tmp!= float(LX&) / float(w&)
cx!=cx! + tmp! * xd!
LY&=0
whileloop 0,height(%hwnd)
LY&=&loop
CY!=CYMax!-(float(LY&)/float(height(%hwnd)))*yd!
IC&=0
x!=0
x2!=0
y!=0
whileloop Iter&,0,-1
IC& = &loop
x2! = sqr(x!) - sqr(y!) + cx!
y! = 2.0 * x! * y!
y! = y! + cy!
x! = x2!
If (sqr(x!)+sqr(y!)) > 4.0
Break
EndIf
EndWhile
col&=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
return w&
endproc
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
08/31/13  
 




p.specht

plenty learnt, The night durchgemacht at debugging:
%-Variable there in xpse not (not more than as Zierde To System-Variables),
CLEAR not working,
setpixel u.ähnl. always only as function() and the right devicecontext (hdc),
still a couple Error appeal: float() / float() * 2.0 <<komma zero!!
greeting

question on The Fachwelt:
Do I whom devicekontext not too latterly killen?
which Speicherlecks Gibts if need be yet?
 
Computer: Gerät, daß es in Mikrosekunden erlaubt, 50.000 Fehler zu machen, zB 'daß' statt 'das'...
09/01/13  
 




funkheld
Hmmm..., sees well from .

Perhaps ought to one in the nProc for XPSE time Fließkomma-ASM reinsetzen.
interested me time as so goes.
and too The speed.

If I me whom ASM-code of XPSE for anschaue, see I none only ASM-Floatbefehl therein, I suppose, that here simply The slow Fließkommaroutienen of Profan taken go ?

one can in the ASM too The Grafikroutinen with install
have time one Test made, it go Rechtecke drawn of left supra to right under :
declare ende&
Window 20,20-750,770
Cls RGB(255,255,255)
USEP 0,1,RGB(255,0,0)
api_asm()
ende&=1

WHILE ende&

    sleep 1
    waitkey

ENDWHILE

nproc api_asm() {

    long f=0
    Long z=500
    mov ecx,0
    mov eax,0
    beginning:
    Add eax,1
    Add ecx,1
    Mov f,eax
    PushAll
    Rectangle(%hdc,20+f,20+f,200+f,200+f)
    PopAll
    cmp ecx,z
    jb beginning

}


Thank you.
greeting
 
12/26/13  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

13.562 Views

Untitledvor 0 min.
Sven Bader07/29/21
Thomas Freier08/24/19
Julian Schmidt03/31/16
Ernst03/02/15
More...

Themeninformationen



Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie