I think in the function squared you need to use the absolute value: public Complex square() { double newreal; double newimaginary; newreal = ((real * real) - (imaginary * imaginary)); newimaginary = 2 * abs(imaginary * real); return new Complex(newreal, newimaginary); } Now, to square a complex number, I expand...

If I understand your problem, it sounds like you want to use a 2D histogram to get the density of points, H, x, y = np.histogram2d(xs,ys,bins=100) X, Y = np.meshgrid(x[:-1],y[:-1],indexing='ij') plt.pcolormesh(X,Y,H,alpha=0.8, cmap = plt.cm.YlOrRd_r) plt.colorbar() Which gives, This is a transparent colormesh plotted over the scatter plot. You could also...

java,javascript,fractals,mandelbrot

I heard "escape" should be 4(2^2) Escape radius should be greater then 2 so any value > 2 is good. It can change shape of level sets and shape of numerical aproximation of Mandelbrot set. Square of escape radius should be greater then 4. See also this question HTH...

algorithm,fractals,procedural-programming,procedural-generation,l-systems

L systems are very simple and rely on text substitutions. With this starting information: Axiom : FX Rule : X= +F-F-F+FX Then basically, to produce the next generation of the system you take the previous generation and for each character in it you apply the substitutions. You can use this...

At http://ccl.northwestern.edu/netlogo/docs/faq.html#listexpectedconstant the NetLogo FAQ says: If a list contains only constants, you can write it down just by putting square brackets around it, like [1 2 3]. If you want your list to contain items that may vary at runtime, the list cannot be written down directly. Instead, you...

The algorithm you are using will produce something like this: There can be different ways to obtain a zoom animation effect but the underlying principle is always the same. You display shifted & scaled versions of the original frame one-by-one at a fast rate. Here, I am describing a very...

The Mandelbrot set is a special set in terms of Julia sets, some documentation writes that the Mandelbrot set is the index set of ALL Julia sets (there is one and only one index set - the Mandelbrot - and there are infinite number of Julia sets.) When you calculate...

java,algorithm,colors,fractals

A simple coloring would be to render pixel (X,Y) light green, green, or brown according to whether pixels[W*Y+X] is less than n1, between n1 and n2, or greater than n2. To determine n1 and n2, trial and error would probably be the simplest solution, but you could make an actual...

My problem was parameter ordering, as user cyberguijarro points out over here: Linker problems in Ubuntu 11.10 @boto I know that. Actually, the problem was in the parameter order. Ubuntu 11.10 ships GCC 4.6.1, which apparently introduces stricter parameter ordering constraints. g++ test.cpp -lX11 works fine. – cyberguijarro Jan 24...

c++,multithreading,fractals,mandelbrot

You're making this (quite a lot) harder than it needs to be. This is the sort of task to which OpenMP is almost perfectly suited. For this task it gives almost perfect scaling with a bare minimum of effort. I modified your draw_mandelbrot by inserting a pragma before the outer...

javascript,canvas,pseudocode,fractals,mandelbrot

Complex number have a two part: real, imaginary. So z = a + b*i, where a is real part, and b*i is imaginary. In provided sample for z=z^2+c, where z=z_r+z_i*i NOTE: i*i = -1 So z^2 = (z_r+z_i*i)*(z_r+z_i*i) = z_r*z_r+2*z_r*z_i*i + z_i*i*z_i*i = z_r*z_r+2*z_r*z_i*i - z_i*z_i now add c: z_r*z_r+2*z_r*z_i*i...

php,laravel,fractals,transformer

Your problem is in this line: return $fractal->createData( $resource )->parseIncludes('weeks')->toJson(); createData() returns \League\Fractal\Scope and it has no parseInlcudes method. You've already called parseIncludes here: if (isset($_GET['include'])) { $fractal->parseIncludes($_GET['include']); } So just remove a second call to it in the return statement: return $fractal->createData($resource)->toJson();...

javascript,html5,recursion,fractals

checking the same length, 0.78125, over and over again Each level of recursion doubles the number of calls. It's going to reach that base case like ... 128 (?) times. it produces a left-ward facing spiral kind of structure As it is, there's a single global child variable. When...

java,recursion,bufferedimage,graphics2d,fractals

To draw a Sierpinski triangle calculate the points correctly. The following code here demonstrates it. More elaborated example can be found @ github. For a refference you can view a different approach to calculate triangle's points (calculates the Pascal's triangle and uses places of odd values in it as points...

In your corrected version, you're only drawing the centre triangles. Try drawing each edge of the each triangle at each depth-layer, and the escaping from the recursion when you reach n==0: def Sierpienski(A,B,C,n): if n==0:#On trace le triangle line(A[0],A[1],B[0],B[1])#AB line(B[0],B[1],C[0],C[1])#BC line(C[0],C[1],A[0],A[1])#CA return MAB=[int((A[0]+B[0])/2),int((A[1]+B[1])/2)]#Milieu de AB MBC=[int((B[0]+C[0])/2),int((B[1]+C[1])/2)]#Milieu de BC MCA=[int((C[0]+A[0])/2),int((C[1]+A[1])/2)]#Milieu de...

c++,fractals,allegro,allegro5,mandelbrot

Your calculation of the complex modulus is incorrect. float Complex::getAbsoluteValue() const { return sqrt(real * real + imaginary + imaginary); } You've since removed this section of your post, but it should say float Complex::getAbsoluteValue() const { return sqrt(real * real + imaginary * imaginary); } ...

java,recursion,sequence,fractals

This should work: pulic class test { public static void main(String args[]) { System.out.print(foo(4)); } public static String foo(int n) { String s = ""; if(n == 0) { //do nothing } else { s = foo(n-1); System.out.print(s); s=s+n; } return s; } } ...

c++,c,opencl,fractals,newtons-method

Well somewhat it really helped to run the code as normal C code.. as this makes Debugging easier: so the issue were some coding issues which I have been able to solve now.. for example my pow function was corrupted and when I added or subtracted I forgot to set...

Now I can't wrap my head around how can an image like that have been created with using only one function, on top of which an identity function. (Wouldn't it only draw one pixel infinitely as we are applying identity function on a randomly chosen pixel?) The variations aren't...

matlab,statistics,time-series,histogram,fractals

Your code seems to be generally bug-free but I made some changes since you perform needless repetitions over loops (I moved the outer loop inside and "vectorized" it since all moment calculations can be performed simultaneously for a given histogram. Also, it is building the histogram that takes longest). intel...

This article is just perfect! It's a great insight for everyone who needs a smart way for creatign a continuos palette of colours. http://krazydad.com/tutorials/makecolors.php...

python,python-2.7,numpy,matplotlib,fractals

There are three main ways to improve this plot: 1 - Instead of a scatter plot, create an N by N matrix where the value of each point determines the color at that point. Then use plt.imshow(...) 2 - Experiment with different colormaps (plt.imshow(...cmap="RdGy")) 3 - Increase the number of...

python-2.7,image-processing,matplotlib,fractals,chaos

If I understood your problem correctly, you need to transpose your matrix using the method .T. So just replace fig = plt.figure(figsize=(10,10)) plt.imshow(mat, cmap="spectral", extent=[-2,2, 0, 2]) plt.show() by fig = plt.figure(figsize=(10,10)) ax = gca() ax.imshow(mat.T, cmap="spectral", extent=[-2,2, 0, 2], origin="bottom") plt.show() The argument origin=bottom tells to imshow to have...

c,pointers,image-processing,cuda,fractals

I'm not going to try and sort out your complex matrix allocation scheme. The purpose of my suggestion was so that you can simplify things to simple 1-line allocations. Furthermore, I don't think you really grasped the example I gave. It was a 3D example, and the typedefs had 2...