English Amiga Board


Go Back   English Amiga Board > Main > Amiga scene

 
 
Thread Tools
Old 24 October 2010, 06:47   #21
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Here's the code included with AMOS CRAFT to draw a Mandelbrot fractal in AMOS BASIC. It also demonstrates how CRAFT's built-in Mandelbrot generator works.
It should be easily portable to other forms of BASIC too.
Remember # indicates a floating point type variable, while $AA ($0AA) is a hexadecimal constant. The palette is 16 shades of turquoise:

Code:
' The slow mandelbrot by Hannu Rummukainen
' This program has been made to demonstrate the amazing effectiveness
' of the algorithms used in the CRAFT extension. The program calculates
' a picture of the Mandelbrot set in AMOS. It does the same trick as 
' the following CRAFT instructions:
'
' Fr Window 0
' Fr Position -16000,12800 
' Fr Step 100
' Fr Mandelbrot 16 
'
Screen Open 0,320,256,16,Lowres
Curs Off : Flash Off : Cls 0
Palette 0,$11,$22,$33,$44,$55,$66,$77,$88,$99,$AA,$BB,$CC,$DD,$EE,$FF
'
For Y=0 To 255
   For X=0 To 319
      X#=-2.0+X/81.92
      Y#=1.6-Y/81.92
      N=0
      ZR#=0
      ZI#=0
      Repeat 
         ZR0#=ZR#*ZR#-ZI#*ZI#+X#
         ZI#=2*ZR#*ZI#+Y#
         ZR#=ZR0#
         Inc N
      Until ZR#*ZR#+ZI#*ZI#>4 or N=16
      Plot X,Y,N
   Next X
Next Y
On testing in WinUAE, the CRAFT extension instructions do give a slightly different result to the BASIC code, however:
Attached Thumbnails
Click image for larger version

Name:	AMOS_BASIC_Mandelbrot.png
Views:	131
Size:	56.2 KB
ID:	26798   Click image for larger version

Name:	AMOS_CRAFT_Mandelbrot.png
Views:	134
Size:	53.7 KB
ID:	26799  

Last edited by Mequa; 24 October 2010 at 07:16.
Mequa is offline  
AdSense AdSense  
Old 26 October 2010, 02:43   #22
andreas
Zone Friend
 
Join Date: Jun 2001
Location: Germany
Age: 43
Posts: 5,858
Send a message via ICQ to andreas Send a message via AIM to andreas
Arrow

Quote:
Originally Posted by killergorilla View Post
A clever bloke indeed.

Coincidentally I'm just reading Jurassic Park, which features fractal images inbetween each chapter (as well as mentioning fractals and Mandelbrot in the story).
YES!

Thank you for this post! This was a must to get mentioned.
Notably, you are reading JP - with emphasis on "reading", because the action-laden (plus action-focused) movie did not even allude to this fractal thing one second.
If you haven't read the book, you won't EVER get a notion of Crichton's actual intention to write all this. It's just SO many miles away. Be this a hint to everyone reading this post.
The dialectics of JP (movie) to JP (book) may possibly be compared to the cuddly-cutesy product Disney made (or: "left") out of Rudyard Kipling's "Jungle Book".

Last edited by andreas; 26 October 2010 at 02:50.
andreas is offline  
Old 29 October 2010, 06:16   #23
blade002
Zone Friend
blade002's Avatar
 
Join Date: Dec 2005
Location: Australia
Age: 43
Posts: 2,443
Damn that truly is fucked up! R.I.P
blade002 is offline  
Old 09 November 2010, 00:06   #24
Dreedo
Registered User
Dreedo's Avatar
 
Join Date: Jan 2010
Location: West Yorkshire, UK
Age: 24
Posts: 654
Wondered where Mandelbrot Fractal came from in Paint.Net.
Dreedo is offline  
Old 09 November 2010, 05:48   #25
klx300r
Registered User
klx300r's Avatar
 
Join Date: Oct 2007
Location: Toronto, Canada
Age: 47
Posts: 706
a true pioneer he was...sad news indeed..R.I.P
klx300r is offline  
Old 09 July 2011, 05:52   #26
Mequa
Registered User
 
Join Date: Nov 2009
Location: UK
Posts: 497
Floppy disk XaoS

Almost a year on - what better tribute to Benoit Mandlelbrot than the XaoS realtime fractal zoomer?
This can zoom in and explore various kinds of fractals (including Mandelbrot by default) in breathtaking smoothness and detail, particularly for those used to old-school Amiga fractal generators (which were pretty good back then too).

As well as working on MS Windows, Mac OS X, Linux and BSD, there is also a version included with AROS. I like this software a lot.
Mequa is offline  
Old 09 July 2011, 17:16   #27
cosmicfrog
The 1 who ribbits
cosmicfrog's Avatar
 
Join Date: Apr 2006
Location: leek, Staffs, UK
Age: 50
Posts: 3,555
Send a message via MSN to cosmicfrog
Just found autopilot on Xaos
cosmicfrog is offline  
AdSense AdSense  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Dead A500+ smoorke MarketPlace 37 27 May 2012 13:36
Dead A600 - And what's THAT?? LuMan support.Hardware 7 30 March 2011 00:07
A1200 Dead ? Wasagi support.Hardware 20 02 July 2010 01:16
Dead HD BippyM support.Hardware 30 05 July 2007 00:54
HD Dead? Monolith support.Hardware 12 22 November 2005 16:04

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:58.


Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Page generated in 0.18588 seconds with 12 queries