|Function name:||oldz – Return value from previous iteration|
|Input data type||Output data type|
|real||depends on formula type|
|complex||depends on formula type|
This function returns the value of z (the main iteration variable) at the iteration stage given as the argument. Thus oldz(4) returns the value of z after the 4th iteration loop.
Please note that by using this function ChaosPro automatically adds extra code to store the value of z. That means your formulas will run slower. And please note that if you access data beyond the limits of this array (range from 0 to maxiter) you will crash ChaosPro.
Of course, it does not make sense to access this array in a transformation formula, as as this stage the values have not been set. But you may use this array in an iteration formula or especially in a coloring formula.
If the argument is of type complex, then only the real part is taken.
The value of the argument gets converted to an integer and specifies the iteration loop.
oldz(0) specifies the value of z after the transformation and after the initialization sections of the iteration and coloring formulas.
oldz(1) specifies the value of z after the first iteration.
oldz(2) specifies the value of z after the second iteration.
If the formula “bails out” after the 10th iteration, then oldz(10) gets initialized. The abort test gets executed after storing the value.
The return type of this function depends on the formula type: If it is a formula for Escapetime fractals, then of course oldz returns a complex number. If the formula has been declared to be a formula for Quaternions, then the return type is quaternion.