Username [Register?]: | Password [Lost Password?]: Save Password?
Bottom of Page
INTL v5.0 > Site Comments > Archives > Archived Forums > Linux Corner: computers for something other than windows? WHAT > Fractals > Viewing Thread
Also Here: 1 guest.
Page: [ 1 ] [ Thread Views: 2073 | Total Posts: 18 ]
Rate This Thread: Reply to Thread | Create New Thread | Create New Poll | Convert To Poll | Subscribe To Thread
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
(Originally posted on: 08-02-08 12:52:26 AM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

So I've been messing around with fractals the last few hours, I wrote a really rudimentary program to create them, been tweaking parameters, creating different functions and initialization constants and I got to thinking, "hey, there are a bunch of math people at INTL," so I decided to make this thread.

Basically, I understand the math that goes into creating fractal images, but I'm not all that entirely sure how to colorize them properly, nor do I know of any really good functions and parameters to create super awesome images. So far, I've managed to make a few really neat looking monochromatic fractals, but nothing groundbreaking.

I guess my question to those of you out there are as follows:

1. Do you know of any good functions and parameters to create neat looking fractals?
2. Anyone have any good "rainbow" color sets? (As in (Iterations: 1-5: 0,0,0; Iterations: 6-10: 255,0,0; Iterations: 11-20: 128, 128, 0; etc.)
3. Does anyone have any cool fractal websites they know of that they want to share?
4. Does anyone want the source code of this program once I'm done writing it and parametrizing it?

Also, here are the fractals I've made so far. Like I said, I've just been fucking around with these for the few hours, so I haven't made anything groundbreaking, but with very little effort, I've managed to make these with the program I wrote:









Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 1 of 18 (Originally posted on: 08-02-08 02:51:01 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Made another fractal. It's just a standard Julia Set. Here are the parameters if anyone cares.

Function: z = z^2 + c
c = -0.8 + 0.156i
Iterations: 2500
Origin: (0.1008, 0.001)
Width: 0.0025
Height: 0.001875



And another...

Function: z = z^2 + c
c = -0.8 + -.1579i
Iterations: 2500
Origin: (-1.35, 0.0)
Width: 0.2
Height: 0.15



Yet another...

Function: z = z^2 + c
c = -0.55113284371278159 + 0.62783963563277212i
Iterations: 2500
Origin: (0, 0)
Width: 0.001
Height: 0.00075


This reply was last edited on 08-02-08 06:41:42 PM by Air Bud.
Science Brad
INTL Premium Member
sigh

Logic is the beginning of wisdom, not the end.

Ballkicks: (+288 / -77)
Posts: 1529 (0.233)
Reg. Date: Jul 2002
Location: Everywhere
Gender: Male
Reply 2 of 18 (Originally posted on: 08-03-08 02:41:58 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

I imagine a google search will probably be useful in turning up stuff, something like source code fractals perhaps, though maybe you searched already. A long time ago I was quite interested in them as a hobby and used to know some places but sadly I lost my bookmarks from that long ago.

The wikipedia page though has some cool pictures http://en.wikipedia.org/wiki/Fractal and info.

A good, but now old, book about them in general is called Chaos: The Making of a New Science. They seem to crop up all over the place in nature and have applications in networking/complexity theory as well as potentially in the fabric of spacetime [see CDT for more info].
"We've arranged a civilization in which most crucial elements profoundly depend on science and technology. We have also arranged things so that almost no one understands science and technology. This is a prescription for disaster. We might get away with it for a while, but sooner or later this combustible mixture of ignorance and power is going to blow up in our faces." -Carl Sagan
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 3 of 18 (Originally posted on: 08-03-08 03:08:07 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

I've done searches online over the last few days and found very little information regarding actual parameters for creating specific fractals, mostly just snazzy pictures, with very little technical explanations of what function or parameters were used to create it.

I've already written a program to generate fractals, it was incredibly easy. Hardest part (which wasn't hard at all) was writing the arithmetic functions for complex numbers. Right now, I'm using the standard z=z^2+c function, just with different values of c, then panning around and zooming in until I find something I like. I'm sure there are more functions and values of c out there, but that's what I'm having trouble finding.

Oddly enough, I never noticed before that your avatar has the Mandelbrot set in it.
Science Brad
INTL Premium Member
sigh

Logic is the beginning of wisdom, not the end.

Ballkicks: (+288 / -77)
Posts: 1529 (0.233)
Reg. Date: Jul 2002
Location: Everywhere
Gender: Male
Reply 4 of 18 (Originally posted on: 08-03-08 08:09:06 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

It's subtle..

You can give some of the first equation a try.
"We've arranged a civilization in which most crucial elements profoundly depend on science and technology. We have also arranged things so that almost no one understands science and technology. This is a prescription for disaster. We might get away with it for a while, but sooner or later this combustible mixture of ignorance and power is going to blow up in our faces." -Carl Sagan
Ballsack 5.0

i'd like to see a pic of ice's duck

Ballkicks: (+91 / -77)
Posts: 1301 (0.219)
Reg. Date: Mar 2004
Location: Dinner with Amphy and Kayte
Gender: Unspecified
Reply 5 of 18 (Originally posted on: 08-05-08 03:05:01 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

I have a simple question: did you use Matlab to make these images?
<<<<<amphy; next week: sunny; week after: kayte; pm me if you want to be in the loop MAGUSMAGUSMAGUSMAGUS
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 6 of 18 (Originally posted on: 08-05-08 04:41:25 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

No. I wrote a C++ program to make them.
etymxris
INTL Developer

JUST AS PLANNED

Ballkicks: (+179 / -16)
Posts: 942 (0.16)
Reg. Date: Jun 2004
Location: Virginia
Gender: Male
Reply 7 of 18 (Originally posted on: 08-06-08 02:59:12 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

They might look a little better if you used sub-pixel addressing. Or you could just make them bigger and resize them down in photoshop. In the second set it looks like you might already be doing one of those.
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 8 of 18 (Originally posted on: 08-06-08 03:10:21 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Yeah, I started generating them at larger widths, then sized them down significantly with Photoshop. I'll look into that sub-pixel addressing though, since it's a bit annoying to do it manually.
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 9 of 18 (Originally posted on: 08-08-08 01:16:56 AM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Okay, so I wrote an antialias routine and the image generation time is much longer, but the quality of the images is pretty fucking awesome. I also made it so that you can switch back and forth between standard Mandelbrot sets and Julia sets. The program is far from completely, but you can download below if you want.

Feel free to download the code, use it for your own purposes and/or make comments on it. It's command-line and a bit annoying to set parameters. I want to eventually make a GUI component for it. However, as it stands now, it works, but isn't exactly fast or efficient or amazing. Included in the ZIP file is a text file that has some sample command-lines. I'll revise it later on to include a help printout.

I also made this fractal that I rather like.



Alternate Colors...



And it's corresponding Julia Set (zoomed in a bit):



Source Code
This reply was last edited on 08-08-08 01:34:51 AM by Air Bud.
Hoff
Lightnin' Hopkins

Helping a brother out.

Ballkicks: (+192 / -38)
Posts: 2563 (0.486)
Reg. Date: Jan 2006
Location:
Gender: Male
Reply 10 of 18 (Originally posted on: 08-10-08 12:51:00 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

The new ones are sweet, I made the second one my background.
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 11 of 18 (Originally posted on: 08-10-08 02:57:31 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Thanks. I'm still working on implementing more.

Brad: I was wondering how that first formula worked, I kept trying to make it work as a Mandelbrot and Julia Set, but then I realized that was a tweaked version of Newton's method, which has it's own method of determining colors based on how long it takes to converge on a root or whether it is considered divergent after n iterations based on where you are on the complex plane.

I generated this image:



It is essentially the exact same image as your avatar, which I created using Newton's Method with: f(x) = x^3-1. The actual formula comes out to be:

where a is any constant complex number (in this case 1+0i)

So the formula in your avatar may actually be wrong. That or I'm implementing this Newton fractal wrong and just got lucky.

Also, here is another Newton fractal:


This reply was last edited on 08-10-08 09:54:05 PM by Air Bud.
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 12 of 18 (Originally posted on: 08-10-08 09:29:29 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Updated the source code, it's now a lot more object-oriented and nicer looking. Main.cpp is still a mess. Of course, no one cares, so whatever. Next thing on the list, work on a function tokenizer to allow for command-line functions to be passed to the program, rather than having to hard-code the functions into it manually.

Source Code
etymxris
INTL Developer

JUST AS PLANNED

Ballkicks: (+179 / -16)
Posts: 942 (0.16)
Reg. Date: Jun 2004
Location: Virginia
Gender: Male
Reply 13 of 18 (Originally posted on: 08-11-08 08:51:17 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Someone has to have a tokenizer/calculator that you can gyp and plug into your program. I wouldn't recommend rolling your own. Also it's going to slow things way down unless you have a way to compile it.

In fact, I'd recommend just having your main fractal program call the compiler to create and compile some function f() based on the passed in arguments. The just compiled code is then loaded as a library and called dynamically. This will make things fast and flexible. Not sure how you'd do all that in Windows but in Linux it's not much of a feat. I know you can compile stuff from the command line with Visual Studio but I've just never had the need to.

What you're trying to do would be easiest in a language with "eval" but since you're using C++ you don't have that option.
etymxris
INTL Developer

JUST AS PLANNED

Ballkicks: (+179 / -16)
Posts: 942 (0.16)
Reg. Date: Jun 2004
Location: Virginia
Gender: Male
Reply 14 of 18 (Originally posted on: 08-15-08 06:00:03 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

A better way. Proof of concept.

fractal.sh
-------------
#!/bin/sh

g++ -o fractal -Df=$1 fractal.cc
./fractal
--------------

fractal.cc
--------------
#include <stdio.h>

int g(int x)
{
return f;
}

int main(int argc, char **argv)
{
printf("f(%d) = %d\n", 5, g(5));
}
----------------

then just do something like
# ./fractal.sh x*3
f(5) = 15

That has all the flexibility of passing in the function you want to compute and is much faster.
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 15 of 18 (Originally posted on: 08-17-08 01:27:03 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Sorry it took so long to respond, interesting idea. I never would've thought of setting it up as a macro like that.

I'm writing the code with NetBeans IDE, so I'm not entirely sure how I would set it up this way inside NetBeans, so I don't have to do everything manually each time.
Air Bud
Internet Superstar

Some plants even masturbate into their own vaginas in order to reproduce.

Ballkicks: (+918 / -56)
Posts: 6785 (0.987)
Reg. Date: Sep 2001
Location: TEH INTARNET!
Gender: Male
Reply 16 of 18 (Originally posted on: 08-21-08 01:44:43 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

I got a bit bored, so I made this:



It's nothing special, really, there are plenty of other Fractal videos on YouTube, just wanted to post this because it was my first attempt at making an animation. I won't be doing another for a while, at least until I find a good batch image converter or write one myself. Manually converting 140+ PBM files to PNG was a pain in the ass that I don't want to repeat again anytime soon.
etymxris
INTL Developer

JUST AS PLANNED

Ballkicks: (+179 / -16)
Posts: 942 (0.16)
Reg. Date: Jun 2004
Location: Virginia
Gender: Male
Reply 17 of 18 (Originally posted on: 08-21-08 05:40:06 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

I'm pretty sure ImageMagick will do batch converting for you. At the very least, it will make writing a batch file to convert the images much easier, since you can do everything from the command line.
Siret
who the flying fuck is siret?

Ballkicks: (+14 / -2)
Posts: 43 (0.009)
Reg. Date: Sep 2006
Location:
Gender: Unspecified
Reply 18 of 18 (Originally posted on: 08-27-08 03:19:25 PM)
Edit Post | Edit History | Send PM | Change Title | Reply w/Quote | Report Post | Ignore | Show All Posts

Use something like this to input fractal equations at run time:

http://www.codeproject.com/KB/recipes/MathieuMathParser.aspx

And if your using visual studios, stick it on a form with a zoom. I think that is about as far as it is worth taking it.
Quick Reply
Page: [ 1 ] Reply to Thread | Create New Thread | Create New Poll | Convert To Poll | Subscribe To Thread
[ Thread Views: 2073 | Total Posts: 18 ]