Jump to content

I did the Brot


Recommended Posts

I added a zoom counter. Image breakdown occurs at zoom=140,737,488,355,328. I am rather surprised the JavaScript number didn't overflow.

I finished the user interface. I will put it on the 'net tomorrow.

image.thumb.png.8672be3d485fbb1e6c8d09768e137fc1.png

  • Like 2
Link to comment
Share on other sites

Posted (edited)

It is live on my new website, BrainDump99 :) 

Mandlebrosia (braindump99-fe87a.web.app)

I used AI to generate some art for my 90s retro home page:

 BrainDump99 (braindump99-fe87a.web.app)

Thinking of adding a feature to get the Julia set for any Mandelbrot point... but I have book project to finish first :( 

EDIT: I forgot to mention you can click anywhere on the Mandelbrot image to zoom in.

Edited by Ags
  • Like 4
Link to comment
Share on other sites

Wow ! ! ! ! 👍

Initial reactions : Impressive !, & I like the way you have exposed iterations and escape to play with, in the olden days that usually involved changes to the prog followed by a rerun or even a recomplile. Colours window is nice

  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, Ags said:

It even runs ok on my phone, didn't expect that.

Ha! :)  for your next trick you can try to make it work on my phone - - it is a proper one that only talks and texts !

Link to comment
Share on other sites

Posted (edited)

One nice thing about HTML canvas is it provides an easy pathway to Save As... a PNG. 

image.png.a424eaa3e11d980a7bedc0b8b2b015d4.pngimage.png.b79250b519fe66ca646f6fa17c7e18fd.png

Edited by Ags
  • Like 4
Link to comment
Share on other sites

On 13/07/2024 at 22:11, Ags said:

One nice thing about HTML canvas is it provides an easy pathway to Save As... a PNG. 

3brots.jpg.65224ab907e160920069b9f25cbff5b8.jpg

Caption competition
for the second one : "Three blind brots , , "
sung to the tune of three blind mice of course, is that the farmer's wife in the middle ?

One wonders if a coordinate system (alt, az, distance /x,y,z) would be good enough to get us to the same image, or would it be limited by the precision of our respective computers or browser ??

I have a caption for the first but it involves EnochP, so prob get me in trouble with the T&C's if I spelled it out :(


 

Edited by MalcolmP
  • Like 1
Link to comment
Share on other sites

Posted (edited)

The web page is partially a Progressive Web Application, I am thinking about completing the transformation into a full PWA so the site is installable on the home screen and coordinates to cool brots can be shared via WhatsApp, FB or other social media poison of choice :) 

My priority is adding higher precision numeric types for deeper zooms and sorting out the UI glitches...

I also have a book on asteroids I'm very actively not finishing :D 

Edited by Ags
  • Like 1
Link to comment
Share on other sites

On 15/07/2024 at 21:45, Ags said:

 WhatsApp, FB or other social media poison of choice :) 

Ugg!     sgl? :)  :) 

Should I be able to run this stand alone in my browser ?
I have the html and a js but they don't seem to want to play together! :( 
(caveat)> I did some elementary html code when it was young and didnt have numbers after it !  ( when we were changing from dos to windows and tcp/ip to http) so this <canvas> & workers stuff's beyond my pay-grade !

Any pointers to good upgrade tuts would be welcome !
, , , exit stage left to google PWA  :)

 

Sbrotflakes

image.thumb.png.753e468df120bbf0e0de6a12e9526433.png

 

  • Like 1
Link to comment
Share on other sites

Posted (edited)

@MalcolmP You can't run a service worker loaded from your file system, it has to be fetched over HTTPS or from localhost. The easiest thing to do is install Python (you can download this from the Microsoft store for free). Then navigate to the folder containing your source files and and type 

powershell

in the address bar and hit enter. This opens a powershell session in the current folder. In the powershell window type

python3 -m http.server

And this starts a localhost web server. Open the given url in a browser and have fun!

Note that service workers get cached so if you change the code in your service worker you need to Cntrl-F5 refresh the web page to get the new code into your browser.

EDIT: by the way, I use a service worker to multithread the brot rendering.

Edited by Ags
  • Thanks 1
Link to comment
Share on other sites

I trialled a BigDecimal math lib but the calculations are simply too slow to be usable.

I fixed the overflow of the zoom level UI control by changing to expontential notation, which is a lot more comprehensible anyway:

image.png.0030b14015a7f2860ab1132710de462e.png

Image breakdown occurs at 2^48 zoom:
image.png.0e4894dc6701ff6ee39bc93d19c4edaf.png

  • Like 1
Link to comment
Share on other sites

15 hours ago, Ags said:

You can't run a service worker loaded from your file system, it has to be fetched over HTTPS or from localhost. 

Very interesting, thank you, Python has long been on my "todo" list :)

"from your file system, it has to be fetched"
Ah!    that explains the error I was seeing in the console

   "Security Error: Content at file:///G:/SGL/Ags/,,,etc
may not load data from file:///G:/SGL,,,etc    "

In my ignorance I was looking in the -Content- of it to try to see what was going wrong, perhaps missing another .js or something, but,
I am a dumbo, I should have remembered that I have had problems in the past when using JS to write a script to file [ot , to reformat ASTAP plate solve coords into a script to bring up Stellarium at that location /ot]
 

Link to comment
Share on other sites

2 hours ago, Ags said:

by changing to expontential notation, which is a lot more comprehensible

I had thought to suggest including a powers of 2 item in the UI (plenty of space in the 'terra incognito' below :) ) as an additional item for maths nerds ! . I like the big number display, it gives a certain 'feel' and context to what the brot is doing :) Perhaps bring it back later sometime in a left/right scrollable action ? 
 

Link to comment
Share on other sites

Now that I know higher precision is a non-starter I'll add a coordinates infobox and shareable URLs.

Link to comment
Share on other sites

On 18/07/2024 at 15:28, Ags said:

Now that I know higher precision is a non-starter


That is sad !
So the UI glitch overflow is not a prob, the needed extra zoom is then only short of about? two charactrs, so an economy of text eg, Zoom= or a double line of "Zoom Level" above a line for the big decimal number would fit?
 

Link to comment
Share on other sites

Posted (edited)

I did mention this was a stepping stone to an online fits viewer / editor, and after a few days of struggles I finally got some code working. The result is currently greyscale, but there is an image on my screen. Image loading is also reasonably quick.

I am basing my code on:

slowe/jsFITS: A Javascript library to read and display FITS files in a browser (github.com)

But it took a a bit of work to change it from using AJAX to using file drag and drop. It was the second library I tried, the first one chewed up a lot of time and I got nowhere.

I think jsFITS is only loading one channel, I'll dig into that next. Also, the library only supports a subset of FITS, so I'll need to fix that too. The library hasn't been touched in 13 years, so there is a lot of old stuff in there.

Edited by Ags
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.