Mandelbrot graphic test

Contributions to this software library are always welcome. Please ensure that you post program listings rather than .raw files. They give a reasonable idea of what your program does without having to load them into a DM42 and you can also include comments in your code. Check out the following link for a decoder/encoder: https://technical.swissmicros.com/decoders/dm42/

You can then copy/paste the listing and post it in "code" tags.
wawachief
Posts: 30
Joined: Tue Dec 12, 2017 7:39 pm
Location: France, Normandie

Mandelbrot graphic test

Post by wawachief »

Hi there

I just opened my Christmas gift this morning .. gess what : it was a DM42 :)

After the upgrade to 3.1 os, I made my first program today to draw the mandelbrot to see how fast it is.
And it is fast compared to the original 42 of course, but in HiRes, the complete drawing takes quite a while.

I am very pleased of this wonderful calc ! Thanks so much to swissmicro and Thomas for making this a reality.

Code: Select all

00 { 375-Byte Prgm }
01▸LBL "mandel"
02 MVAR "XMIN"
03 MVAR "XMAX"
04 MVAR "YMIN"
05 MVAR "YMAX"
06 MVAR "NITER"
07▸LBL 05
08 RCL "GrMod"
09 "hp"
10 X=0?
11 ├"•"
12 KEY 1 GTO 06
13 "200"
14 2
15 -
16 X=0?
17 ├"•"
18 KEY 2 GTO 07
19 "400"
20 1
21 -
22 X=0?
23 ├"•"
24 KEY 3 GTO 08
25 CLA
26 KEY 4 GTO 05
27 KEY 5 GTO 05
28 "next>"
29 KEY 6 GTO 09
30 MENU
31 STOP
32 GTO 05
33▸LBL 06
34 131
35 STO 10
36 16
37 STO 11
38 0
39 STO "GrMod"
40 GTO 05
41▸LBL 07
42 200
43 STO 10
44 120
45 STO 11
46 2
47 STO "GrMod"
48 GTO 05
49▸LBL 08
50 400
51 STO 10
52 240
53 STO 11
54 3
55 STO "GrMod"
56 GTO 05
57▸LBL 09
58 VARMENU "mandel"
59 "Enter scale R/S"
60 PROMPT
61▸LBL 00
62 CLLCD
63 RCL "XMIN"
64 STO 00
65 RCL "XMAX"
66 X<>Y
67 -
68 RCL 10
69 ÷
70 STO 02
71 RCL "YMIN"
72 STO 01
73 RCL "YMAX"
74 X<>Y
75 -
76 RCL 11
77 ÷
78 STO 03
79▸LBL 01
80 RCL 03
81 STO+ 01
82▸LBL 02
83 RCL 02
84 STO+ 00
85 XEQ 11
86 RCL 00
87 RCL "XMAX"
88 X>Y?
89 GTO 02
90 RCL "XMIN"
91 STO 00
92 RCL 01
93 RCL "YMAX"
94 X>Y?
95 GTO 01
96 STOP
97▸LBL 10
98 RCL 00
99 RCL 01
100 RCL "YMIN"
101 -
102 RCL "YMAX"
103 RCL "YMIN"
104 -
105 ÷
106 X<>Y
107 RCL "XMIN"
108 -
109 RCL "XMAX"
110 RCL "XMIN"
111 -
112 ÷
113 RCL 10
114 ×
115 RND
116 X<>Y
117 RCL 11
118 ×
119 RND
120 X<>Y
121 PIXEL
122 RTN
123▸LBL 11
124 RCL "NITER"
125 STO 04
126 RCL 00
127 RCL 01
128 COMPLEX
129 ENTER
130▸LBL 12
131 X↑2
132 RCL ST Y
133 +
134 ENTER
135 ABS
136 2
137 X<Y?
138 RTN
139 R↓
140 R↓
141 DSE 04
142 GTO 12
143 XEQ 10
144 RTN
145 END
Attachments
MANDEL.raw.zip
(440 Bytes) Downloaded 478 times
DM42 SN:00218
HP-11c - HP-19b - HP25 - HP 45 - HP42s - HP48gx
Michael
Site Admin
Posts: 261
Joined: Wed Apr 05, 2017 11:31 pm

Re: Mandelbrot graphic test

Post by Michael »

Cool. Which values draw the nicest Mandelbrot at highest resolution?
wawachief
Posts: 30
Joined: Tue Dec 12, 2017 7:39 pm
Location: France, Normandie

Re: Mandelbrot graphic test

Post by wawachief »

for the scale, the following values show the entire set :
xmin=-2
xmax=1
ymin=-1
ymax=1

for the niter variable, 25 is the minimum. the higher, the better details you will have but the longer it will take to plot the whole thing. For a hires plot, niter=100 seems reasonable.
DM42 SN:00218
HP-11c - HP-19b - HP25 - HP 45 - HP42s - HP48gx
Michael
Site Admin
Posts: 261
Joined: Wed Apr 05, 2017 11:31 pm

Re: Mandelbrot graphic test

Post by Michael »

Sweet, this is NITER=40
Image
Thomas Okken
Posts: 1098
Joined: Tue May 02, 2017 5:48 pm
Location: Netherlands
Contact:

Re: Mandelbrot graphic test

Post by Thomas Okken »

Michael wrote:
Mon Dec 25, 2017 11:31 pm
Sweet, this is NITER=40
Image
Crazy! I remember doing this on my Mac in 1985, and it would take hours for pictures like those. :shock:
Michael
Site Admin
Posts: 261
Joined: Wed Apr 05, 2017 11:31 pm

Re: Mandelbrot graphic test

Post by Michael »

This one took ~40min @80MHz with NITER=100
Image
rprosperi
Posts: 1698
Joined: Mon Apr 24, 2017 7:48 pm
Location: New York

Re: Mandelbrot graphic test

Post by rprosperi »

Michael wrote:
Tue Dec 26, 2017 1:02 am
This one took ~40min @80MHz with NITER=100
This answers the question I asked rhetorically in another thread recently: Why would one want to run a program for hours at a time on USB power?

Michael's initial assessment says it all: It's cool.

@wawachief: Thanks for sharing the program

@Michael: Thanks for sharing the DM Art.
--bob p

DM42: β00071 & 00282, DM41X: β00071 & 00656, DM10L: 071/100
Michael
Site Admin
Posts: 261
Joined: Wed Apr 05, 2017 11:31 pm

Re: Mandelbrot graphic test

Post by Michael »

rprosperi wrote:
Tue Dec 26, 2017 2:33 am
Michael's initial assessment says it all: It's cool.
OK you got me, I'm a nerd 8-)
User avatar
Walter
Posts: 3070
Joined: Tue May 02, 2017 11:13 am
Location: On a mission close to DRS, Germany

Re: Mandelbrot graphic test

Post by Walter »

Michael wrote:
Tue Dec 26, 2017 2:45 am
rprosperi wrote:
Tue Dec 26, 2017 2:33 am
Michael's initial assessment says it all: It's cool.
OK you got me, I'm a nerd 8-)
Guessed that! ;)

Else you and David would have hardly made such a great device. :D
WP43 SN00000, 34S, and 31S for obvious reasons; HP-35, 45, ..., 35S, 15CE, DM16L S/N# 00093, DM42β SN:00041
wawachief
Posts: 30
Joined: Tue Dec 12, 2017 7:39 pm
Location: France, Normandie

Re: Mandelbrot graphic test

Post by wawachief »

And here is the "elephants" zone.
xmin=0.30
xmax=0.32
ymin=0.0225
ymax=0.0375
niter=100
Image
DM42 SN:00218
HP-11c - HP-19b - HP25 - HP 45 - HP42s - HP48gx
Post Reply