-
Notifications
You must be signed in to change notification settings - Fork 60
User Formulas
XaoS supports entering your own custom formulas:
- Select User formula from the Fractal menu to define a custom fractal formula.
- (Optional) Select User initialization to calculate a different starting point z(0) for each pixel. By default z(0) is set to 0.
User formulas should be interpreted as functions in the form z(n+1) = formula (z(n), z(n-1), c).
In user formulas, as shown above, three variables are available:
variable | meaning |
---|---|
z | current sequence point z(n) |
c | current plane 'point' |
p | previous sequence point z(n-1) |
n | current iteration number n (beginning with 1) |
Format for complex numbers is {re,im}
, e.g. {3,2}
is complex number 3+2i. You must write constants for the coordinates. You can also use a semicolon instead of a comma. Also, parameters in functions must be separated by commas or semicolons (see below).
The number {0,1}
can also be written as i
. If you need to express a complex number with a non-constant, split it to real and imaginary parts like this: (re(z)+im(z)*i)^2+c
.
Real numbers can be used as usual.
Available functions are listed below:
+, -, *, /, ^
The multiplication sign may be omitted in most cases.
- re(x) - real part of x
- im(x) - imaginary part of x
- powi(x,y) - power of x with integer exponent y (fastest)
- powd(x,y) - power of x with real exponent y
- powdc(x,y) - power of x with complex exponent y
- pow(x,y) - same as powd(x,y)
The symbol ^
can also be used (see above) without explicitly defining the number set for the exponent.
- sin(x), cos(x), tan(x), cot(x), asin(x), acos(x), atan(x), acot(x), sinh(x), cosh(x), tanh(x), coth(x) can be used for computing trigonometrical functions
- exp(x), log(x) - exponential and natural logarithm of x
- log2(x), log10(x) - logarithm of x in base 2 and 10
- logn(x,y) - logarithm of y in base x (where x is integer)
- logcn(x,y) - logarithm of y in base x (where x is complex)
- sqrt(x) - square root of x
- rand(x) - random real number in range [0, x)
- abs(x) - absolute value of x
-
z^2+c
andz^3+c
produce the quadratic and cubic Mandelbrot sets.z^2.5+c
produces another fractal "between them". -
(re(z)+im(z)i)^2+c
also produces the quadratic Mandelbrot set. -
powd(z,2)+c
creates the quadratic Mandelbrot set. A minor change in the formula, by usingpowdc(z,{2,0.1})+c
is equivalent toz^{2,0.1}+c
. -
(abs(re(z))+i*abs(im(z)))^2+c
produces the Burning Ship fractal. -
z^2+c*(-1)^n
expresses the iteration (((z(0)^2-c)^2+c)^2-c)^2+....
- The entered formula is case insensitive. But it will always be rewritten in lowercased letters if the parsing was successful.
- Handling user formulas is still in experimental phase. Please expect random crashes or malfunctioning in some cases.
- Fast computation of user formulas is based on Mateusz Malczak's SFFE library.