Standard Class Standard_DistanceEstimator

Object common:Generic common:Coloring common:GradientColoring Standard:Standard_DistanceEstimator

class

Object version of DistanceEstimator in Standard.ucl. Distance-estimator coloring algorithm for Mandelbrot and other z^n fractal types (Phoenix, Julia). This coloring algorithm estimates the distance to the boundary of the fractal (for example the Mandelbrot set) and colors points accordingly. Originally written by Damien M. Jones

Ultra Fractal Source
;
; Object version of DistanceEstimator in Standard.ucl.
;
; Distance-estimator coloring algorithm for Mandelbrot and other z^n fractal
; types (Phoenix, Julia). This coloring algorithm estimates the distance to the
; boundary of the fractal (for example the Mandelbrot set) and colors points
; accordingly.
;
; Originally written by Damien M. Jones
;
public:
func Init(complex pz, complex ppixel)
fDZ = (0, 0)
endfunc

func Iterate(complex pz)
fDZ = @power * pz^(@power-1) * fDZ + 1
endfunc

float func ResultIndex(complex pz)
float cz = cabs(pz)
return (@power*log(cz) * cz / cabs(fDZ))^(1/@power)
endfunc

private:
complex fDZ

default:
title = "Distance Estimator"
helpfile = "Uf*.chm"
helptopic = "Html/coloring/standard/distanceestimator.html"
param power
caption = "Exponent"
default = 2.0
hint = "This should be set to match the exponent of the \
formula you are using. For Mandelbrot, this is usually 2."
endparam
}

Constructor Summary
Standard_DistanceEstimator()

Method Summary
void Init(complex pz, complex ppixel)
Set up for a sequence of values
void Iterate(complex pz)
Process the next value in the sequence
float ResultIndex(complex pz)
Produce a resulting color index after a sequence is finished

Methods inherited from class common:Coloring
GetPixel

Methods inherited from class common:Generic
GetParent

Methods inherited from class Object

Constructor Detail

Standard_DistanceEstimator

public Standard_DistanceEstimator()
Method Detail

Init

public void Init(complex pz,
complex ppixel)
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:
Parameters:
pz - first value for the sequence; for a normal coloring formula, this will be #z
ppixel - seed value for the sequence; for a normal coloring formula, this will be #pixel

Iterate

public void Iterate(complex pz)
Process 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. Note that such processing generally will not know in advance precisely how long the sequence is, and should be prepared to deal with sequences of arbitrary length.

Your coloring may determine at some point that a solid color should be used rather than an index value.

Overrides:
Parameters:
pz - next value in the sequence; corresponds to #z in a coloring formula

ResultIndex

public float ResultIndex(complex pz)