|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:Formula common:ConvergentDivergentFormula mmf:MMF_SwitchConvergentDivergentFormula mmf:MMF_SwitchMagnet2
class
Object version of Magnet 2 for switching
Object switch version by David Makin
class MMF_SwitchMagnet2(MMF_SwitchConvergentDivergentFormula) { ; ; Object version of Magnet 2 for switching<br> ; ; Object switch version by David Makin<br> ; public: import "common.ulb" ; @param pparent the parent, generally "this" for the parent, or zero func MMF_SwitchMagnet2(Generic pparent) MMF_SwitchConvergentDivergentFormula.MMF_SwitchConvergentDivergentFormula(pparent) endfunc complex func Iterate(complex pz) MMF_SwitchConvergentDivergentFormula.Iterate(pz) return sqr((pz^3.0 + 3.0*(fConstant-1.0)*pz \ + (fConstant-1.0)*(fConstant-2.0)) \ /(3.0*sqr(pz) + 3.0*(fConstant-2.0)*pz \ + (fConstant-1.0)*(fConstant-2.0) + 1.0)) endfunc bool func IsBailedOut(complex pz) if ((@p_BailType=="Divergent" || @p_BailType=="Both") \ && |pz|>@p_upperbailout) \ || ((@p_BailType=="Convergent" || @p_BailType=="Both") \ && ((!fType && |pz-m_ZOld|<@p_lowerbailout) \ || (fType && |pz-1.0|<@p_lowerbailout))) m_BailedOut = true endif return m_BailedOut endfunc float func GetUpperBailout() return @p_upperbailout endfunc float func GetLowerBailout() return @p_lowerbailout endfunc default: title = "Switch Magnet 2" rating = recommended complex param p_power visible = false endparam complex param p_start caption = "Mandelbrot Start Value" default = (0,0) visible = @p_manual && @p_mandy endparam complex param p_seed caption = "Julia Seed" default = (0,0) visible = @p_manual && !@p_mandy endparam int param p_BailType caption = "Bailout Type" enum = "Divergent" "Convergent" "Both" default = 2 endparam float param p_lowerbailout caption = "Convergent Bailout" default = 1e-9 exponential = true hint = "Convergent bailout value; smaller values will cause more \ iterations to be done for each point." visible = @p_BailType>0 endparam float param p_upperbailout caption = "Divergent Bailout" default = 1e20 exponential = true hint = "Divergent bailout value; it's best to use large values to \ avoid erroneous detection of divergent bailout in convergent \ areas." visible = @p_BailType!=1 endparam }
Constructor Summary | |
---|---|
MMF_SwitchMagnet2()
|
|
MMF_SwitchMagnet2(Generic pparent)
|
Method Summary | |
---|---|
float |
GetLowerBailout()
Determine the lower bailout boundary. |
float |
GetUpperBailout()
Determine the upper bailout boundary. |
boolean |
IsBailedOut(complex pz)
Test whether the formula has bailed out (i.e. |
complex |
Iterate(complex pz)
Produce the next value in the sequence |
Methods inherited from class mmf:MMF_SwitchConvergentDivergentFormula |
---|
Init, SetParams |
Methods inherited from class common:Formula |
---|
GetPrimaryExponent |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public MMF_SwitchMagnet2(Generic pparent)
pparent
- the parent, generally "this" for the parent, or zeropublic MMF_SwitchMagnet2()
Method Detail |
---|
public complex Iterate(complex pz)
ConvergentDivergentFormula
As long as the sequence has not bailed out, this function will be continually called to produce sequence values.
Iterate
in class ConvergentDivergentFormula
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.
public boolean IsBailedOut(complex pz)
ConvergentDivergentFormula
Since this is a divergent fractal, the test is easy: if it's bigger than the bailout, the sequence is done.
IsBailedOut
in class ConvergentDivergentFormula
pz
- last sequence value to test; this should be the value returned from the previous Iterate() call. Note that it is acceptable to ignore pz and use m_BailedOut, but any code calling IsBailedOut() should pass in the correct pz for Formula classes which do not use m_BailedOut.
public float GetUpperBailout()
ConvergentDivergentFormula
GetUpperBailout
in class ConvergentDivergentFormula
public float GetLowerBailout()
ConvergentDivergentFormula
GetLowerBailout
in class ConvergentDivergentFormula
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |