# Fractals/xaos

XaoS is an interactive fractal zoomer program written in C++ and JS. It allows the user to continuously zoom in or out of a fractal in real-time.
Here is unofficial wiki about XaoS.

# Links

* github: xaos-project

# Algorithms
## Hubička algorithm

XaoS was originally just a "poorly written" Mandelbrot viewer until Jan Hubička added efficient zooming (= real time zoom), using a technique sometimes called the XaoS algorithm or Hubička algorithm.
At the time fractal zoom movies were produced by completely recalculating each frame, even though they naturally had much of their area in common with each other. This made interactive zooming impossible without very powerful computers. Furthermore, unless even more processing is used in order to do antialiasing, recalculating every frame produces a 'twinkle' effect as small bright areas hit and then disappear between pixels.
Yet allowing the user to zoom, rather than jump as in Fractint, seemed like the most natural way to interact with fractals. In order to create an interactive zoom, Hubička needed to find a way to save the calculations which were already made. It would take up too much memory to save every pixel ever calculated, so the Hubička algorithm only saves the previous frame, and rather than remembering the location of each pixel it can keep them aligned in rows and columns and remember those instead.
The most difficult part of the XaoS algorithm was choosing which saved rows and columns to draw where. Doing this wrong results in distorted images, yet it must be done quickly to be useful. After several different heuristics were tried, eventually the problem was treated as an optimization problem.
The remaining rows and columns are colored in the same as the closest row/column, and are freshly calculated as the CPU gets time to do so. This is a careful balance between keeping the zoom going and increasing the level of detail. Calculating areas where the image is being zoomed to is put at a higher priority since these will be on the screen the longest and this is likely where the user is looking anyway. Zooming out, the reverse occurs and the priority is on the edges.
The Hubička algorithm can also be applied to zooming in on other images where the pixels are calculated, and has been used in other software such as the rtzme complex function graphing program, and other fractal zoomers.

# Images

* commons : Category:Fractals created with Xaos
* commons Xaos gallery

# Command line options

To find it use :
Output is :

# Files
## xaf

Xaos Animnation File (*.xaf ) is a file with functions for generating sequence of images
For example :
To make xaf file use record function, syntax :
example :
or :
How to render image sequence from xaf file :

## xpf

xpf stands for Xaos Position File. This file is human-readable, and can easily be improved by hand after saving, or used as a base for animations.
See for example :
standard view (Mandelbrot set without zoom = image) :
when we switch to Julia mode (disabled Mandelbrot mode) :
or change c value ( = julia seed)from c=0 to c= -1
or show plane value ( default = 0 is not shown ) :
minibrot.xpf :
where view is describing viewport ( rectangle part of the plane ):
List of xpf files :
* list by by Chris Gray Some Fractals Computed by XaoS with xpf files by Chris Gray

### view

to describe plane ( view ) Xaos uses:
* 4 numbers in scripts
* 3 numbers in menu
Xaos uses to call it "radius" but it is defind as : the greater of (x2-x1= width) and y2-y1=height." This is the reason why in Xaos one can set the radius to 2/zoom.
To set the same viewpoint in XaoS using menu set 3 numbers to define circle
* the real portion of the center to (x1+x2)/2
* the imaginary part of center to (y1+y2)/2
* "the radius" = the greater of x2-x1 and y2-y1.
where the coordinates of the upper-left and lower-right visible points, specifying the coordinates as four numbers x1, y1, x2, y2.
In xpf file plane can be described by 4 floating point numbers :
* real part of the center
* imaginary part of the center
* width in world coordinate = x2-x1 called "a real radius"
* height in world coordinte = y2-y1 called "an imaginary radius"
Syntax :
Example :

### bailout

Bailout value or escape radius. Xaos uses here square of escape radius so if you want bailout value 2 put here 2*2 = 4.

### formula

Syntax:
example
| Name | description | tutorial | User formula |
| mandel | Standard Mandelbrot or Julia sets. | mset.xaf | Z^2+C |
| mandel3 | Example | power.xaf | Z^3+C |
| mandel4 | Example | power.xaf | Z^4+C |
| mandel5 | Example | power.xaf | Z^5+C |
| mandel6 | Example | power.xaf | Z^6+C |
| newton | This is Newton’s approximation method for finding the roots of a polynomial. It uses the polynomial x^3=1 | newton.xaf | |
| barnsley | Example | Example | Example |
| octo | Example | Example | Example |
| phenix | Example | Example | Example |
| magnet | | | |
| trice | | | |
Changing named formule ( Menu/Fractal/Formule ) does not change user formule !!!

### plane

Syntax :
Allowed values :
| value | name | description |
| 0 | mu | Normal complex plane (default) |
| 1 | 1/mu | Inversion : old infinity is at 0 now and old 0 is at infinity now. |
| 2 | 1/(mu+0.25) | Similar to inversion, but also moves the center outside the Mandelbrot set, so it looks parabolic. |
| 3 | lambda | lambda plane |
| 4 | 1/lambda | Inversion of lambda plane |
| 5 | 1/(lambda-1) | Inversion with moved center |
| 6 | 1/(mu-1.40115) | Inversion with moved center |

### perturbation

It changes the point at which orbits start. Traditionally zero is used.

# doc
## How to render big images ?

It is not simple. One can do it using :
* using animation thru menu ( "saving your fractal to a .xpf file (File->Save), then rendering it using the Misc->Render Animation function. "
* using command line options

## How to change the resolution

"XaoS usually starts in low resolution (320x200 or so) to make calculations faster. In case you have fast computer or you need to save bigger .gif images you may change resolution. This should be done by pressing '=' in full screen drivers or simply by resizing XaoS window."

## Formula

* use xpf file
* use Main Menu/ Fractal/user formula
* Adding Built-in Formulas
* edit the source code in src/engine/formulas.c

### formulas.c

After modifying the code you must recompile XaoS to take any effect.

# References

* ↑ XaoS man page
* ↑ Real-Time Zooming Math Engine by Zoltán Kovács
* ↑ xaosdev.info : algorithm
* ↑ CS and Dance (PDF), archived from the original on 2005-12-20
* 1 2 Hubička, Jan (1997), XaoS Algorithms, archived from the original on 2014-03-28.
* ↑ Visualizations on the Complex Plane, archived from the original on 2006-10-17
* ↑ Xaos- format description
* ↑ Xaos - view
* ↑ Xaos - plane description
* ↑ Xaos - view
* ↑ Xaos doc - formula
* ↑ GNU XaoS » Documentation » XaoS » Plane
* ↑ Xaos doc - perturbation
* ↑ Can't (easily) render high-resolution static images #53
* ↑ xaos-users group : resolution
* ↑ xaos-users group : Higher resolution on Mac OSX
* ↑ Xaos tutorial
* ↑ Xaos doc : Adding Built-in Formulas by Arpad Fekete
* ↑ xaos-users group : Newton fractals