A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 9 Ω
Das Banner der Rhetos-Website: zwei griechische Denker betrachten ein physikalisches Universum um sie herum.

Basic256 Programme Mandelbrotalgorithmus

Quellcode

© 2016 - 2025

Basiswissen


Das untenstehende Programm kann direkt in Basic256 ausgeführt werden.



Bildbeschreibung und Urheberrecht
Verschieden tief eingetaucht in eine Mandelbrotstruktur. Die einzelnen Bilder stammen von Remo Siegenthaler aus Brienz. Besten Dank dafür! © Remo Siegenthaler, Gunter Heim ☛


Quellcode


# Basic256 Programme Mandelbrotalgorithmus
#
# Credits to https://rosettacode.org

Rechenanleitung zur Erzeugung von Mandelbrot-Figuren (Fraktale).

fastgraphics

graphsize 384,384
refresh
kt=319 : m = 4.0
xmin=2.1 : xmax=-0.6 : ymin=-1.35 : ymax=1.35
dx=(xmax-xmin)/graphwidth : dy=(ymax-ymin)/graphheight

for x=0 to graphwidth
jx = xmin+x*dx
for y=0 to graphheight
jy = ymin+y*dy
k = 0 : wx = 0.0 : wy = 0.0
do
tx = wx*wx-(wy*wy+jx)
ty = 2.0*wx*wy+jy
wx = tx
wy = ty
r = wx*wx+wy*wy
k = k+1
until r>m or k>kt

if k>kt then
color black
else
if k<16 then color k*8,k*8,128+k*4
if k>=16 and k<64 then color 128+k-16,128+k-16,192+k-16
if k>=64 then color kt-k,128+(kt-k)/2,kt-k
end if
plot x,y
next y
refresh
next x
imgsave "Mandelbrot_BASIC-256.png", "PNG"