Logo by DsyneGrafix - Contribute your own Logo!

END OF AN ERA, FRACTALFORUMS.COM IS CONTINUED ON FRACTALFORUMS.ORG

it was a great time but no longer maintainable by c.Kleinhuis contact him for any data retrieval,
thanks and see you perhaps in 10 years again

this forum will stay online for reference
News: Follow us on Twitter
 
*
Welcome, Guest. Please login or register. September 19, 2019, 03:34:10 PM


Login with username, password and session length


The All New FractalForums is now in Public Beta Testing! Visit FractalForums.org and check it out!


Pages: [1]   Go Down
  Print  
Share this topic on DiggShare this topic on FacebookShare this topic on GoogleShare this topic on RedditShare this topic on StumbleUponShare this topic on Twitter
Author Topic: Classic Fractals Source Codes  (Read 1796 times)
0 Members and 1 Guest are viewing this topic.
Blue Raven
Forums Newbie
*
Posts: 3


Insecta freak


« on: May 08, 2014, 11:35:26 AM »

Hello, I just thought, that for beginners of fractal programming, this website could be useful. There are about 10 well commented fractal source codes (sadly, but only written with C++) and explanations how they are working, but about once a week or two, the new ones are added.
http://www.bio-matic.com/programming-works/science/fractals/
« Last Edit: May 08, 2014, 04:53:41 PM by Blue Raven » Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #1 on: May 08, 2014, 12:32:33 PM »

nice attempt, and hello and welcome to the forums

indeed i do not like the technical description in a c++ program, basic things that you might be familar with, like calculating the length of a vector, are hardcoded in you program, to introduce a technique, i think it is rather more helpful to describe it in what has to be done, and define such things seperately, e.g. in a function, as there are:

length(complexnumber)
add(complexnumber1,complexnumber2)
mul(complexnumber1,complexnumber2)

in such a way the mandelbrot way of calculating is more easily recognisable

e.g.

while(length(z)<bailout)
{
z=mul(z,z);
z=add(z,pixel)
}

in such a way the methods and the inner structure is very easy to see and modify wink

so, and when you want to drive it further, e.g. calculate higher or non integer powers it would make sense to introduce the polar representation of a complex number, because with that view, the complex exponentiation is as simple as "length^exponent, exponent*angle" which then needs to be
converted back to a polar representation...

smiley
Logged

---

divide and conquer - iterate and rule - chaos is No random!
Blue Raven
Forums Newbie
*
Posts: 3


Insecta freak


« Reply #2 on: May 08, 2014, 04:56:33 PM »

Well, I understand what you want to say, but fractal generation using defined functions like pow or etc is several times slower, than using just simple arithmetic operations. For example in C++ pow(x, 2) is about 7x slower than x*x . I have already tested it. Mandelbrot generation with 256 iterations takes less than a second while using arithmetics and about 7 seconds while using default C++ functions like pow. But anyway, thanks for your comments, I will try to perfect the given codes and I am sorry for an anonymic try to promote this website.
« Last Edit: May 08, 2014, 04:59:08 PM by Blue Raven » Logged
cKleinhuis
Administrator
Fractal Senior
*******
Posts: 7044


formerly known as 'Trifox'


WWW
« Reply #3 on: May 08, 2014, 05:20:22 PM »

optimizing code is a complete different section wink

this is a whole lot that can be placed in a "remarks&optimisations" section, as well as the various speed improvements for calculation, like squares of same iteration depth finding and so on wink


Logged

---

divide and conquer - iterate and rule - chaos is No random!
top-quark
Forums Freshman
**
Posts: 10


« Reply #4 on: May 08, 2014, 10:56:39 PM »

It's C++. You can declare functions inline and get the best of both worlds - modularity without the call overhead. Just sayin'.

But yes, primitive arithmetic is so much faster than math function calls that it makes sense to do things the hard way.
Logged
Blue Raven
Forums Newbie
*
Posts: 3


Insecta freak


« Reply #5 on: May 09, 2014, 08:25:40 AM »

Good, thanks for your response!
Logged
Pages: [1]   Go Down
  Print  
 
Jump to:  

Related Topics
Subject Started by Replies Views Last post
Best program for high-resolution printing of classic fractals on Mac? Meet & Greet c56young 5 2719 Last post May 31, 2009, 05:39:59 AM
by Nahee_Enterprises
Some classic fractals Movies Showcase (Rate My Movie) paxinum 4 1063 Last post July 12, 2010, 09:36:48 AM
by paxinum
Fractals crack one of the classic mysteries in mathematics - Partition Numbers Fractal News across the World mjk1093 10 4736 Last post February 11, 2011, 09:27:15 AM
by jehovajah
The Fractal Dimension of ZIP Codes Fractal News across the World bib 0 2155 Last post January 05, 2012, 04:02:14 PM
by bib
help on finding classic fractals in -1.5 mandelbox Tutorials « 1 2 3 4 » cKleinhuis 48 1908 Last post November 11, 2012, 07:50:47 PM
by Alef

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.145 seconds with 28 queries. (Pretty URLs adds 0.009s, 2q)