|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object common:Generic common:Formula ck:ckFormulaObject ck:TransformBefore
class
Object version of the 2 Alternating Formula
now everything is possible :D
the 3 alternating formula is no longer needed.
christian kleinhuis 2008
visit:
fractalforums.com
fractalmovies.com
2 Alternations is all you need !
class TransformBefore(ck.ulb:ckFormulaObject) { ; ; Object version of the 2 Alternating Formula ; now everything is possible :D ; the 3 alternating formula is no longer needed. ; christian kleinhuis 2008 ; visit: ; fractalforums.com ; fractalmovies.com ; ; 2 Alternations is all you need ! ; public: import "Common.ulb" import "Standard.ulb" complex func Init(complex pz) f=new @formulaClass1(this) fTransform=new @transform(this) return f.Init(fTransform.Iterate(pz)); endfunc complex func Iterate(complex pz) return f.Iterate(#z) endfunc bool func IsBailedOut(complex pz) return f.IsBailedOut(pz) endfunc complex func GetPrimaryExponent() return f.GetPrimaryExponent() endfunc private: Formula f; UserTransform fTransform default: title = "Transform Formula Before" rating = recommended Formula param formulaClass1 caption = "Formula #1" default = Standard_Mandelbrot endparam UserTransform param transform caption = "Formula Transform" default = Location expanded = false hint = "Generic Transformation applied to z before iteration loop starts" endparam }
Constructor Summary | |
---|---|
TransformBefore()
|
Method Summary | |
---|---|
complex |
GetPrimaryExponent()
Determine the primary exponent. |
complex |
Init(complex pz)
Set up for a sequence of values |
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 common:Formula |
---|
GetLowerBailout, GetUpperBailout |
Methods inherited from class common:Generic |
---|
GetParent |
Methods inherited from class Object |
---|
|
Constructor Detail |
---|
public TransformBefore()
Method Detail |
---|
public complex Init(complex pz)
Formula
This function will be called at the beginning of each sequence of values (e.g. at the beginning of each fractal orbit).
Init
in class Formula
pz
- seed value for the sequence; for a normal fractal formula, this will be #pixel
public complex Iterate(complex pz)
Formula
As long as the sequence has not bailed out, this function will be continually called to produce sequence values.
Iterate
in class Formula
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)
Formula
This is typically called once per iteration to test whether the sequence has completed. If producing this result is difficult to do separately from the Iterate() processing, you should produce the result in Iterate() and set the m_BailedOut flag appropriately, and leave IsBailedOut() unimplemented in your class to inherit this behavior.
Note that this test is the OPPOSITE sense of the bailout: section in UF's fractal formulas. A bailout: section returns TRUE to continue iterating. IsBailedOut() must return FALSE to continue iterating.
IsBailedOut
in class Formula
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 complex GetPrimaryExponent()
Formula
Many fractals can be characterized by an exponent value that is useful to other formulas, so we provide that here. If your formula does not need or use this value, override the p_power parameter and make it hidden.
GetPrimaryExponent
in class Formula
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |