Standard
Class Standard_Newton

Object
  extended by common:Generic
      extended by common:Formula
          extended by common:ConvergentFormula
              extended by Standard:Standard_Newton

class 
ConvergentFormula:Standard_Newton

Object version of Newton in Standard.ufm. Standard Newton fractal.


Ultra Fractal Source

Toggle UF Source Code Display

 class Standard_Newton(common.ulb:ConvergentFormula) {
 ;
 ; Object version of Newton in Standard.ufm.
 ; Standard Newton fractal.
 ;
 public:
   complex func Init(complex pz)
     ConvergentFormula.Init(pz)
     return pz
   endfunc
 
   complex func Iterate(complex pz)
     ConvergentFormula.Iterate(pz)
     return ((@p_power - 1) * pz^@p_power + @r) / (@p_power * pz ^ (@p_power - 1))
   endfunc
 
 default:
   title = "Newton"
   helpfile = "Uf*.chm"
   helptopic = "Html/formulas/standard/newton.html"
   rating = recommended
   param p_power ; Overrides p_power from Formula
     caption = "Exponent"
     default = (3,0)
     hint = "Specifies the exponent of the equation that is solved by \
             Newton's method. Use real numbers (set the imaginary part \
             to zero) to obtain classic Newton fractals."
   endparam
   param r
     caption = "Root"
     default = (1,0)
     hint = "Specifies the root of the equation that is solved. Use larger \
             numbers for slower convergence."
   endparam
   param p_bailout ; Overrides p_bailout from ConvergentFormula
     caption = "Bailout value"
     default = 0.00001
     min = 0
     exponential = true
     hint = "This parameter defines how soon a convergent orbit bails out while \
             iterating. Smaller values give more precise results but usually \
             require more iterations."
   endparam
 }
 


Constructor Summary
Standard_Newton()
           
 
Method Summary
 complex Init(complex pz)
          Set up for a sequence of values
 complex Iterate(complex pz)
          Produce the next value in the sequence
 
Methods inherited from class common:ConvergentFormula
GetLowerBailout, IsBailedOut
 
Methods inherited from class common:Formula
GetPrimaryExponent, GetUpperBailout
 
Methods inherited from class common:Generic
GetParent
 
Methods inherited from class Object
 

Constructor Detail

Standard_Newton

public Standard_Newton()
Method Detail

Init

public complex Init(complex pz)
Description copied from class: ConvergentFormula
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 ConvergentFormula
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: ConvergentFormula
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 ConvergentFormula
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