**The Fractal Programs Landscape and Newtonland**

Download: Landscape.zip Newtonland.zip

These programs are further developments of the possibility of enhancing the lighting-effect in the program *Ratio*, and they presuppose experience with that program. In "Ratio" the motif is seen from above, so that the lighting-effect only appears as a deviation in the colouring. In the landscape programs the motif is a surface constructed by means of the distance function, and it is seen from the side. The surface can be drawn upwards or downwards:

As the programs run slowly, we will limit ourselves to cases of super-attraction: we will presuppose that the rational function is such that the degree of the numerator is at least two larger than the degree of the denominator, so that infinity is a super-attracting fixed point. Or we will, with the program *Newtonland*, draw (downwards) landscapes formed from Julia sets of the Newton type:

**Landscape**

The iteration is towards infinity, and for the Julia sets we draw only the Fatou domain containing infinity:

At the start the visual angle with the vertical is fixed at 45 degrees, and can be altered by key A - it can range from about 15 to 75 degrees. These two pictures show the same Julia set (for a function of the form z^{2}/2 + z^{4}/4 + c), but with height factor 0 and 1 and visual angle 14 and 60, respectively:

The oblique angle of view means that the section seen in the zoom-rectangle is not exactly the section that is drawn. And as the picture has to be drawn from the top and downwards, and from the far distance towards the near, something will grow up and hide what was previously drawn. Therefore, it is a good idea to set the drawing to begin lower down than the upper border of the window, that is, at a line nearer the observer than the line in the base plane corresponding to the upper border of the window. The distance to this line is given by multiplying the distance to the upper border line by a number < 1. It is chosen by key O. However, as it is expedient to divide the picture in some columns and choose individual beginning lines for these, the picture is divided regularly in four columns, and you can choose four numbers (< 1) by the keys F5-F8.

The actual step of forward moving in the plane is calculated such that the corresponding point on the screen is moved one pixel. These calculations (performed by formulas derived from differential calculus) are not exact, but if pixels are passed over (vertically) the gap is filled out by interpolation. By key I you can adjust the steps by multiplying these by a factor: if you let the factor be smaller than 1 you can avoid any interpolation, if you let it be larger than 1 (possibly 5-20) you can increase the speed and get a picture which is good enough for choosing of motif and colouring.

On all the pictures above the light is "natural" - like the light from the sun - that is, the rays are parallel and their line of direction is given by two angles (as in "Ratio"). By keying L, the method of drawing is altered so that the light becomes "artificial", as if it issues from a lantern held by the observer, and therefore the rays make up a cone of light (see this picture in full size and note the mini-Mandelbrot's, the most distinct of which is at the lower left corner).

At artificial light, the colour must grow darker with the distance, and this effect is determined by two decimal numbers: an *intensity* and a *growth* of the decline of the light. In this case the colour is not produced by a cyclic colour scale, but by a scale growing darker towards the right. Such a colour scale can be constructed mathematically or be given by a picture. Our mathematical scales are produced by going along a line in the sphere of the HSL-values, which runs from a point of given HSL-values to the point "black". The line can be made to deviate from the straight line, and this deviation is determined by an *extension* and a *rotation* (if the extension is too large some points of the line may come outside the sphere, and then there will be clear discolourings). Pictures of colour scales must be in BMP-format and have a width of about 720 pixels. They are given two-figured numbers as names (eg. "08.bmp") and put in a folder named "sca0". Keying V alternates between the mathematical colour scales and the pictures (if there are any).

By keying K, the way of colouring is altered, so that the colour is produced by the usual cyclic colour scales. In this case the nuance is also made to depend on the potential function (*density/iter.*) as well as the height (*density/height*).

At natural light the intensity (on the earth) is independent of the distance, but the light grows whiter because of the atmosphere. And sometimes the ground looks as if it is enveloped in a veil of mist. These effects are determined in the fractal landscape by a decimal number *mist/distance* and a decimal number *mist/height*, and two decimal numbers *growth* determining the distribution of the effects. If *mist/distance* is negative, the colour grows darker with the distance. As the effect depends on the maximum distance in the picture, it first appears when the drawing is finished. This Julia set is for the function z^{4}(1 - 5z)/(1 + 5z) + c:

Besides the dependence on the potential (*density/slope*) and on the slope (*density/slope*), the colour can be made to depend on the height (*density/height*). As the surface often has singularities, that is points in which it grows towards infinity, and as these vigorous rises are unaesthetic if they are numerous and dominant, they are converted and made finite. Here is a section of the Mandelbrot set for the functions z^{2}/2 - 0.05/z:

The height is constructed on the basis of an estimation of the distance to the boundary. The steepness of the gradient is determined by a *height factor* which can be adjusted by key H. The infinite is reduced to a *maximum height*, which is relative to the width of the section and which can be adjusted by key M. The height is multiplied by a power of the potential function, however, in order to make the influence of the singularities less near the boundary. The *exponent* (about 0.5-2) can be adjusted by key X. Furthermore, the gradient can be regulated so that it becomes less when it is large. The smoothness in this way is determined by an *exponent*, which starts at 0 and which is adjusted by key C. Furthermore the surface can be cut off, so that when a point lies over the maximum height, its position is altered to that level (plateau) or to the maximum height divided by the height relative to the maximum height, so that either a crater or a hollow arises at the singularity. The type of cutting off is chosen by keys F1-F4:

F1: no cutting off

F2: crater

F3: plateau

F4: hollow

Here are Julia sets for z^{2} and z^{2}/2 + 0.0125*z^{4} with craters:

Here is the Mandelbrot set for z^{2} + z^{4}/10 with plateau:

The distance from the eye to the screen is fixed to the width of the screen for artificial light and 1.5 times the width for natural light, and the distance from the eye to the plane (along the centre line) is two times that distance for artificial light and four times that distance for natural light (the difference is due to the fact that a larger variation in distance is wanted at artificial light). It is possible that the landscape reaches the screen, when this happens the intersection is coloured in the same colour as the boundary.

As in "Ratio" the large picture is produced by key P, and the drawing can be stopped to later continuation by Pause. This operation can be used to test the quality of a part of the picture (the upper) and to stop the drawing prematurely when the bottom seems to be completed. The picture can not be divided into four parts in the same way as in "Ratio", but it can be divided into four columns: press key P two times and enter the number of the column to be drawn, and then enter the width. When the drawing seems finished, it can be stopped by Pause - and possibly continued if something invisible on the screen picture is missing.

This section of the Mandelbrot set for 1 - z^{2} + z^{5}/(2 + 4z) = (2 + 4z - 2z^{2} - 4z^{3} + z^{5})/(2 + 4z) is composed of four columns, starting at different positions at the top. The drawing of all four columns had to be continued afterwards in order to remove black lines at the bottom not visible on the screen picture:

The enclosed program "EditLand" is analogue to the program "Edit", an accessory to "Ratio". This program is - especially for landscapes - almost a necessity in order to complete the colouring. The programs "Scale0" and "Adjust0" are the analogues to the programs "Scale" and "Adjust" for the non-cyclic scales.

The downwards drawing is activated by pressing key V. In this case the light is natural and there is no cutting off, so that it is only the *height factor* which has to be adjusted.

The lower border of the window stands directly on the base plane, and the distance from the observer to the window is twice the distance from the window to the base plane (along the normal in the centre). The drawing can begin at the line in the base plane corresponding to the upper border of the window, but the points of the surface seen by the observer can lie behind this line, therefore the drawing must possibly begin farther away, that is, at a line farther away than the upper border line. The distance to this line is given by multiplying the distance to the upper border line by a number > 1. It is chosen by key O, and you can, analogues to the case of upwards drawing, choose four individual beginning factors (> 1) by the keys F5-F8.

As the upper part of the landscape can lie very far away compared with the lower and nearer part, it can be impossible in practice to colour the farthest away lying, and you should let it be black by choosing a suitable factor for the upper boundary (key O) or four individual factors (keys F5-F8). Here is a downward version of the above picture for 1 - z^{2} + z^{5}/(2 + 4z):

**Newtonland**

This program draws landscapes for Julia sets of the Newton type, that is, a Julia set for an iteration of the form z → z - f(z)/f'(z), where f(z) is a complex polynomial. It works in the same way as *Landscape* for downwards drawing. You can enter the function via an incomplete "julia" document, for instance:

The third picture above is the Julia set for the function 4 - z^{2} + z^{4}. Here are Julia sets for 3 - z^{2} + 2z^{4} and 1 + z + z^{2} + z^{3} + z^{4} (in the last the variation in the colours stems alone from the (real) iteration number and the height, that is, density/slope = 0):

When the degree of the polynomial is larger than 8, the coefficients must be entered via an incomplete "julia" document. Here is the Julia set for the twelfth degree polynomial -16 - 4z^{2} - 4z^{4} - 4z^{6} + z^{8} + z^{10} + z^{12}:

The program
*Ratio*

Updated: March 2011

This site is a subsection of juliasets.dk