|
Kali
|
 |
« Reply #15 on: April 14, 2011, 05:03:57 AM » |
|
That's ok, I found some useful info in that thread anyway! thanks! And go start writing that! Maybe we can make a race to see who finish our self-made fractal software first  (just kidding) I'd probably lost anyway, because I'm encountering some troubles as I'm not a very experienced programmer, but I think I will make it, sooner or later 
|
|
|
|
|
Logged
|
|
|
|
DarkBeam
Global Moderator
Fractal Senior
     
Posts: 2512
Fragments of the fractal -like the tip of it
|
 |
« Reply #16 on: April 14, 2011, 10:41:10 AM » |
|
Don't forget those formulas ; --- Samuel Monnier ducks. Never escapes (all inside) z = real(z) + flip(abs(imag(z))) z = log(z+pixel) ; --- Barnsley generalized ; --- default values re1=1, re2=0, re3=0, fac1=(1,0), fac2=(0,0), fac3=(0,0) ; symmode=false, bartype=0 if bartype==1 condition = real(z)*imag(c)*re1 + imag(z)*real(c)*re2 else condition = real(z)*re1 + imag(z)*re2 endif c = pixel if condition > re3 z = (z + fac1) * c + fac2 else if symmode c= conj(pixel) endif z = (z - fac1) * c + fac3 endif If you need others ask flip(z)=z*(0,1) conj(z)=real(z) + flip(-imag(z))This is the UF public database, you can also pick what you need. http://formulas.ultrafractal.com/cgi/formuladb?browse
|
|
|
|
« Last Edit: April 14, 2011, 12:50:38 PM by DarkBeam »
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
|
Kali
|
 |
« Reply #17 on: April 14, 2011, 01:17:25 PM » |
|
Thanks Luca!
I'm familiar with complex numbers formulas, as I use UltraFractal a lot... but the tricky part will be only using real variables, because I don't want to implement a complex number library (they a re also not needed for most of the formulas I will use). Can you help me, at least, with the Ducks formula using real variables?
|
|
|
|
|
Logged
|
|
|
|
Fractal Ken
Fractal Lover
 
Posts: 246
Proud to be 2D
|
 |
« Reply #18 on: April 14, 2011, 06:14:37 PM » |
|
Let me step in until Luca returns . . . I don't want to implement a complex number library (they a re also not needed for most of the formulas I will use). No!!! Easy handling of complex numbers is important for most traditional formulas. If you must use only reals, here's a way to deal with the complex logarithm function for the ducks formula [I think  ]. Suppose z = (x, y) is complex. Let r = sqrt(x*x + y*y) and t = atan2(y, x). Then log(z) = (log(r), t). Note 1: log(r) represents the usual natural logarithm operating on reals. Note 2: The complex logarithm function isn't uniquely defined, but this method should provide the principal value. Supporting links: Principal value of the complex logarithmPolar form of a complex numberDefinition of atan2
|
|
|
|
|
Logged
|
Fortran will rise again
|
|
|
DarkBeam
Global Moderator
Fractal Senior
     
Posts: 2512
Fragments of the fractal -like the tip of it
|
 |
« Reply #19 on: April 14, 2011, 06:55:42 PM » |
|
Thanks Luca!
I'm familiar with complex numbers formulas, as I use UltraFractal a lot... but the tricky part will be only using real variables, because I don't want to implement a complex number library (they a re also not needed for most of the formulas I will use). Can you help me, at least, with the Ducks formula using real variables?  How can you think to write a fractal program that does not handle complex numbers? It's really impossible  So be serious, go here http://www.cplusplus.com/reference/std/complex/ and back to work 
|
|
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
|
Kali
|
 |
« Reply #20 on: April 14, 2011, 09:28:47 PM » |
|
Hey guys, don't be so upset!  I think I know what I'm doing, just wanted a little help with log function, so thank you Ken! This is not a very "traditional formula" software, and also I don't want to include a crazy amount of formulas, neither a lot of variations. I want to do something a bit different, since, as Luca said well, there are plenty of freeware fractal programs available for traditional formulas and well known 2D fractals. I stated before that there will be a very limited amount of formulas availaible, but the way of doing combinations should make a good variety of results. Also this isn't C++, Luca. It's VB.NET, so optimizing for speed will be very important. A while ago I tried using a complex class, just for Mandelbrot, when I wrote a very rudimentary render for "KaliLinComb" (before Jesse's implementation), and the perfomance was not good (I know, I know... I should use C++) Let's see what happens... For the moment, I'm dealing with some issues in that DataGridView control, but I think I'm almost winning the battle. Thanks for comments, I really appreciate them!
|
|
|
|
« Last Edit: April 14, 2011, 09:42:13 PM by Kali »
|
Logged
|
|
|
|
Fractal Ken
Fractal Lover
 
Posts: 246
Proud to be 2D
|
 |
« Reply #21 on: April 14, 2011, 09:45:24 PM » |
|
(I know, I know... I should use C++)
No, you should use Fortran.  There's a complex data type, so fractal arithmetic can be performed naturally. Just don't try to write a GUI! Fortran will rise again. 
|
|
|
|
|
Logged
|
Fortran will rise again
|
|
|
|
Kali
|
 |
« Reply #22 on: April 14, 2011, 09:59:13 PM » |
|
What about this? Or maybe this 
|
|
|
|
« Last Edit: April 14, 2011, 10:02:39 PM by Kali »
|
Logged
|
|
|
|
Fractal Ken
Fractal Lover
 
Posts: 246
Proud to be 2D
|
 |
« Reply #23 on: April 14, 2011, 10:24:05 PM » |
|
Visual Fortran might actually be good for writing fractal software. I'm not at all familiar with it. (I use the free g95 compiler.) I used punched cards in the first computer science course I took in college. The programming language wasn't Fortran, but rather a PL/I dialect.
|
|
|
|
|
Logged
|
Fortran will rise again
|
|
|
DarkBeam
Global Moderator
Fractal Senior
     
Posts: 2512
Fragments of the fractal -like the tip of it
|
 |
« Reply #24 on: April 14, 2011, 10:46:40 PM » |
|
Why you fight against the milestones of informatics?  I used Vb many times. Vb uses massively dlls and is the slowest language ever, whenever you need speed you lose your time  The only fast language is C, afaik, that naturally supports assembly  and you can obtain awesomely fast routines I tried to write a Win program in pure C but create an interface in C is too time consuming 
|
|
|
|
|
Logged
|
No sweat, guardian of wisdom!
|
|
|
|
Kali
|
 |
« Reply #25 on: April 14, 2011, 11:35:48 PM » |
|
As I said before, I'm not a very experienced programmer, I wrote mostly programs for handling databases, early with DOS Foxpro and Qbasic, then VB6 using SQL and lately VB.NET - I know some little C, but very little experience as I never really needed to implement something with it. So I'm not ready for writing this in C++, and learning it will make me spend too much time now. Maybe some day I will do it, but as for now I'll try to make a decent program using VB, optimizing as much as I can. After all, this isn't 3D raytracing or such... also I'm using some tips & tricks, like not using standard methods for drawing to the screen as I agree they are really slow in VB. Just trust me and wait... 
|
|
|
|
|
Logged
|
|
|
|
|
Kali
|
 |
« Reply #26 on: April 15, 2011, 03:35:26 AM » |
|
Didn't have much time today for coding, but thanks to Ken (and in spite of Luca's discouragement) I already implemented Ducks using only real variables with good results. I ran a test with a 2-color coloring method, just to check if patterns are right, and they are indeed  The original non-antialiased image is 3712 x 1500 pixels, and the rendering time was 45 seconds on my Phenom 9550. The number of iterations used for the formula were 25.  I think I can do some more optimization, tough 
|
|
|
|
|
Logged
|
|
|
|
Fractal Ken
Fractal Lover
 
Posts: 246
Proud to be 2D
|
 |
« Reply #27 on: April 15, 2011, 04:49:18 AM » |
|
Looks good, Kali! I'm glad I was able to help.
|
|
|
|
|
Logged
|
Fortran will rise again
|
|
|
fractalmind
Forums Freshman
 
Posts: 13
|
 |
« Reply #28 on: April 15, 2011, 06:17:19 AM » |
|
Nice work, Kali! Visual Basic is quite slow. There are some very fast basic compilers such as Powerbasic (for Windows) and Purebasic(for Windows,Mac and Linux) These are not free however but produce fast and small executables. There is also a basic to c compiler bcx ( windows freeware). Powerbasic and bcx use qbasic like syntax. If you also want to learn C then bcx is your choice since it ouputs c code. Purebasic outputs fasm asm code. I personally have used Powerbasic (since 1997) but it is quite expensive. http://bcx-basic.sourceforge.net/So C is not the only fast language... 
|
|
|
|
« Last Edit: April 15, 2011, 06:19:45 AM by fractalmind, Reason: lots of typos (just woke up..) »
|
Logged
|
|
|
|
|
Syntopia
|
 |
« Reply #29 on: April 15, 2011, 07:04:50 AM » |
|
Kali, let me suggest you choose the computer programming language that you find the easiest. A language such as VB.NET will not be much slower that C++, due to quite efficient modern JIT compilers. (The old VB6 was slow, but that was a completely different language). Take a look at the Computer Language Shootout: http://shootout.alioth.debian.org/u32/benchmark.php?test=mandelbrot&lang=all - C/C++ is only about 33% faster than Java for a Mandelbrot. And a .NET compiled language like VB.NET will probably be around the speed as Java. If you really are going for speed, you will want to (1) multithread your code, (2) use SIMD instruction (SSE/MMX), (3) or use the GPU.
|
|
|
|
|
Logged
|
|
|
|
|