-
Notifications
You must be signed in to change notification settings - Fork 59
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 change the sequence starting point z0. By default z0 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) |
Format for complex numbers is {re;im}
, e.g. {3;2}
is complex number 3+2i. You must write constants for the coordinates. The number {0;1}
can be written also 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
.
Note that you need to use a semicolon. Also, parameters in functions must be separated by semicolons (see below).
Real numbers can be used as usual.
Available functions are listed below:
+, -, *, /, ^
The multiplication sign may be omitted in most cases.
- RE(z) - real part of z
- IM(z) - imaginary part of z
- POWI(z;n) - power of z with integer exponent n (fastest)
- POWD(z;n) - power of z with real exponent n
- POWDC(z;n) - power of z with complex exponent n
- POW(z;n) - same as powd(z;n)
The symbol
^
can also be used (see above) without explicitly defining the number set for the exponent.
- SIN(z), COS(z), TAN(z), COT(z), ASIN(z), ACOS(z), ATAN(z), ACOT(z), SINH(z), COSH(z), TANH(z), COTH(z) can be used for computing trigonometrical functions
- EXP(z), LOG(z) - exponential and natural logarithm of z
- LOG2(z), LOG10(z) - logarithm of z in base 2 and 10
- LOGN(n;z) - logarithm of z in base n (where n is integer)
- LOGCN(c;z) - logarithm of z in base c (where c is complex)
- SQRT(z) - square root of z
- RAND(max) - random real number in range [0, max)
- ABS(z) - absolute value of z
-
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
.
- The entered formula is case insensitive. But it will always be rewritten in capitalized 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.