Escapetime - Iteration FormulasIteration formulas are the most important formulas in
ChaosPro: They define the fractal formula used to calculate the fractal, for
example The following three images show the same area using exactly the same settings except the iteration formula.
Such an iteration formula may contain the following functions:
The bailout function must return a boolean data type and must consist of a single expression of the form: bool bailout(void) { return(boolean-expression); } So you cannot make complex if-then-else statements with for-loops in the bailout function. If you do want to program more complex bailout expressions you can place the complex code at the end of the loop function and set a bool variable. In the bailout section you then simply return that bool variable. The main reason for this limiting single-expression-function is speed: ChaosPro can simply evaluate the expression knowing that it returns the final result as a bool type. Otherwise there could be many branches in the execution path where the iteration bails out. Exampledef_mand { parameter complex criticalpoint; parameter complex power; parameter real bailout; void init_once(void) { // nothing useful to do here... } void init(void) { z=criticalpoint; } void loop(void) { z=z^2 + pixel; } bool bailout(void) { return(|z| <= bailout); } void description(void) { this.title = "Mandelbrot"; this.helpfile = "dmj3\dmj3-pub-uf-ot.htm"; power.caption = "Power"; power.default = center+(2,3); power.hint = "Choose the exponent of the iteration formula for the Julia set.\nHigher (int-) values just lead to some kind of rotation symmetry. So try fractional or even complex numbers."; bailout.caption = "Bailout Value"; bailout.default = 4.0; bailout.min = 1.0; bailout.hint = "Defines the bailout radius: As soon as a pixel falls outside a circle with this radius, the iteration stops."; } } |