Quaternion - Iteration FormulasIteration formulas are the most important formulas in
ChaosPro: They define the fractal formula used to calculate the fractal, for
example 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. In order to tell ChaosPro that this formula is ment for fractal type Quaternion (and thus the proper predefined variables are defined), you need to specify the keyword QUATERNION in brackets after the formula identifier. This tells ChaosPro that pixel and z are quaternion variables (instead of complex variables) and that the other predefined variables for this fractal type are defined. ExampleHybrid(QUATERNION) { parameter real Bailout; parameter quaternion c; void init(void) { z=pixel; } void loop(void) { z=z*z-c; } bool bailout(void) { return(|z| <= Bailout); } void description(void) { c.default=(0.3,-0.44,-0.57,0.3); Bailout.default=16; this.maxiter=7; } } |