mt
Class MT_Alternate
Object
common:Generic
common:Formula
common:DivergentFormula
mt:MT_Alternate
class
- DivergentFormula:MT_Alternate
Mark Townsend, May 2008
Ultra Fractal Source
Toggle UF Source Code Display
class MT_Alternate(common.ulb:DivergentFormula) {
;
; Mark Townsend, May 2008
;
public:
import "Standard.ulb"
func MT_Alternate(Generic pparent)
fFormula1 = new @formula1Class(this)
fFormula2 = new @formula2Class(this)
endfunc
complex func Init(complex pz)
complex start = fFormula1.Init(pz)
fFormula2.Init(pz)
fIter = 0
return start
endfunc
complex func Iterate(complex pz)
if fIter % 2 == 0
newZ = fFormula1.Iterate(pz)
else
newZ = fFormula2.Iterate(pz)
endif
fIter = fIter + 1
return newZ
endfunc
private:
Formula fFormula1
Formula fFormula2
int fIter
default:
title = "Alternate"
Formula param formula1Class
caption = "First Formula"
default = Standard_Mandelbrot
endparam
Formula param formula2Class
caption = "Second Formula"
default = Standard_Mandelbrot
endparam
float param p_bailout
caption = "Bailout"
default = 1.0e20
endparam
param p_power
visible = false
endparam
}
Methods inherited from class Object |
|
MT_Alternate
public MT_Alternate(Generic pparent)
MT_Alternate
public MT_Alternate()
Init
public complex Init(complex pz)
- Description copied from class:
DivergentFormula
- Set up for a sequence of values
This function will be called at the beginning of each
sequence of values (e.g. at the beginning of each fractal
orbit).
- Overrides:
Init
in class DivergentFormula
- Parameters:
pz
- seed value for the sequence; for a normal fractal formula, this will be #pixel
- Returns:
- first value in the sequence; this corresponds to #z in a fractal formula
Iterate
public complex Iterate(complex pz)
- Description copied from class:
Formula
- Produce the next value in the sequence
As long as the sequence has not bailed out, this function
will be continually called to produce sequence values.
- Overrides:
Iterate
in class Formula
- Parameters:
pz
- previous value in the sequence; corresponds to #z in a fractal formula. Note that you should always use this value for computing the next iteration, rather than a saved value, as the calling code may modify the returned value before passing it back to the next Iterate() call.
- Returns:
- the next value in the sequence