Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
38
Task/Mandelbrot-set/M2000-Interpreter/mandelbrot-set-1.m2000
Normal file
38
Task/Mandelbrot-set/M2000-Interpreter/mandelbrot-set-1.m2000
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
Module Mandelbrot(x=0&,y=0&,z=1&) {
|
||||
If z<1 then z=1
|
||||
If z>16 then z=16
|
||||
Const iXmax=32*z
|
||||
Const iYmax=26*z
|
||||
Def single Cx, Cy, CxMin=-2.05, CxMax=0.85, CyMin=-1.2, CyMax=1.2
|
||||
Const PixelWidth=(CxMax-CxMin)/iXmax, iXm=(iXmax-1)*PixelWidth
|
||||
Const PixelHeight=(CyMax-CyMin)/iYmax,Ph2=PixelHeight/2
|
||||
Const Iteration=25
|
||||
Const EscRadious=2.5, ER2=EscRadious**2
|
||||
Def single preview
|
||||
preview=iXmax*twipsX*(z/16)
|
||||
Def long yp, xp, dx, dy, dx1, dy1
|
||||
Let dx=twipsx*(16/z), dx1=dx-1
|
||||
Let dy=twipsy*(16/z), dy1=dy-1
|
||||
yp=y
|
||||
For iY=0 to (iYmax-1)*PixelHeight step PixelHeight {
|
||||
Cy=CyMin+iY
|
||||
xp=x
|
||||
if abs(Cy)<Ph2 Then Cy=0
|
||||
For iX=0 to iXm Step PixelWidth {
|
||||
Let Cx=CxMin+iX,Zx=0,Zy=0,Zx2=0,Zy2=0
|
||||
For It=Iteration to 1 {Let Zy=2*Zx*Zy+Cy,Zx=Zx2-Zy2+Cx,Zx2=Zx**2,Zy2=Zy**2 :if Zx2+Zy2>ER2 Then exit
|
||||
}
|
||||
if it>13 then {it-=13} else.if it=0 then SetPixel(xp,yp,0): xp+=dx : continue
|
||||
it*=10:SetPixel(xp,yp,color(it, it,255)) :xp+=dx
|
||||
} : yp+=dy
|
||||
}
|
||||
Sub SetPixel()
|
||||
move number, number: fill dx1, dy1, number
|
||||
End Sub
|
||||
}
|
||||
Cls 1,0
|
||||
sz=(1,2,4,8,16)
|
||||
i=each(sz)
|
||||
While i {
|
||||
Mandelbrot 250*twipsx,100*twipsy, array(i)
|
||||
}
|
||||
38
Task/Mandelbrot-set/M2000-Interpreter/mandelbrot-set-2.m2000
Normal file
38
Task/Mandelbrot-set/M2000-Interpreter/mandelbrot-set-2.m2000
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
Module Mandelbrot(x=0&,y=0&,z=1&) {
|
||||
If z<1 then z=1
|
||||
If z>16 then z=16
|
||||
Const iXmax=32*z
|
||||
Const iYmax=26*z
|
||||
Def single Cx, Cy, CxMin=-2.05, CxMax=0.85, CyMin=-1.2, CyMax=1.2
|
||||
Const PixelWidth=(CxMax-CxMin)/iXmax, iXm=(iXmax-1)*PixelWidth
|
||||
Const PixelHeight=(CyMax-CyMin)/iYmax,Ph2=PixelHeight/2
|
||||
Const Iteration=25
|
||||
Const EscRadious=2.5, ER2=EscRadious**2
|
||||
Def single preview
|
||||
preview=iXmax*twipsX*(z/16)
|
||||
Def long yp, xp, dx, dy, dx1, dy1
|
||||
Let dx=twipsx*(16/z), dx1=dx-1
|
||||
Let dy=twipsy*(16/z), dy1=dy-1
|
||||
yp=y
|
||||
Refresh 2000
|
||||
For iY=0 to (iYmax-1)*PixelHeight step PixelHeight {
|
||||
Cy=CyMin+iY
|
||||
xp=x
|
||||
if abs(Cy)<Ph2 Then Cy=0
|
||||
move xp, yp
|
||||
For iX=0 to iXm Step PixelWidth {
|
||||
Let Cx=CxMin+iX,Zx=0,Zy=0,Zx2=0,Zy2=0
|
||||
For It=Iteration to 1 {Let Zy=2*Zx*Zy+Cy,Zx=Zx2-Zy2+Cx,Zx2=Zx**2,Zy2=Zy**2 :if Zx2+Zy2>ER2 Then exit
|
||||
}
|
||||
if it>13 then {it-=13} else.if it=0 then fill dx1, dy1, 0: Step 0,-dy1: continue
|
||||
it*=10:fill dx1, dy1, color(it, it,255): Step 0,-dy1
|
||||
} : yp+=dy
|
||||
}
|
||||
|
||||
}
|
||||
Cls 1,0
|
||||
sz=(1,2,4,8,16)
|
||||
i=each(sz)
|
||||
While i {
|
||||
Mandelbrot 250*twipsx,100*twipsy, array(i)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue