I have uploaded new Distance Coloring plug-in files to jlb.ulb. These are similar in concept to Orbit Traps: for each iteration, as the z associated with a pixel moves in the complex plane, information can be accumulated about distances. Afterwards this information is used to calculate an index into the gradient for coloring. See a sample image and a upr in the following post.

Load the upr in the following post into UltraFractal to follow along. This upr has 16 layers, each with the same divergent formula (a simple Julia), the same smooth gradient (gold to brown), and the same location and magnification. Each layer colors the formula differently. The top layer is the standard Smooth (Mandelbrot) coloring for comparison.

Experiment by making changes in these examples.

As with all the UF formulas, you don’t need to understand the details to make interesting fractals.

In the Accumulation Phase, zz is chosen from among z, z-z_prev, z/z_prev, z-pixel, and z/pixel. Here z_prev is the previous value of z. Then, optionally, zz may be replaced by F(a*zz), where F is one of the built-in functions (like sin or log) and “a” is a parameter. This zz is used for distance calculations.Next is the distance method. It calculates a distance, d. All of the iterations may be used, or just some of them. I describe various distance methods below.Note that in the Final phase, “How to color,” the first six possibilities only use specific distances: First, Last, Smallest, Largest, Distance Range (Largest-Smallest), and Distance Ratio (Largest/Smallest). These are floats rather than complex values.The remaining six possibilities use averages, and there are more possibilities. The averages may be weighted. Positive values of p give more weight to later iterations; negative values of p give more weight to earlier iterations; p of zero weights all iterations the same.For these final six possibilities, each distance d may be used, or the multiplied values d*zz or d

*G(b*zz), where G is one of the built-in functions (like sin or log) and “b” is a parameter. If the multipliers are used, the result is a complex value and other averages are possible. See below for the averages

After the averages, two final smooths are possible to mimic the standard colorings of Smooth (Mandelbrot) and Triangle Inequality Average, though they may give interesting shapes for other formulas.

Finally, after an answer is calculated, it or its reciprocal may be used for the index into the gradient.

Averages:

(Note: It’s not necessary to know the mathematics to use the formulas!)

Assume that N of the iterations were used.

Arithmetic Average: Add up all the distances and divide by N.

Geometric Average: Multiply all the distances together and take the Nth root.

Harmonic Average: Add up the reciprocals of all the distances, divide by N, and take the reciprocal.

Standard Deviation: Add up the squares of (distance minus Arithmetic Average) and divide by N.

Coefficient of Variation: Divide the standard deviation by the Arithmetic Average.

Fractal Dimension: Divide the standard deviation by the Distance Range.

Distance methods:

Circles: Use from one to five circles, each defined by its center and size (radius). Color using only iterations with zz inside one or more circles, or outside one or more circles, as specified. If inside, use the smallest distance to a circle center. If outside, use the largest distance. A circle shape of 2 gives normal round circles; shape less than 2 makes them pointy; shape more than 2 makes them squarer. For inside, a positive power emphasizes iterations closer to the center(s); negative power emphasizes iterations farther from the center(s). For outside, the reverse is true.

Exponential smoothing: Distance is calculated as in the standard versions in standard.ucl and standard.ulb, except for the scale parameter.

Lines: Use one or two lines. Each line is defined by a point on the line and an angle. Color using iterations only on the positive or negative side of the line or lines, as specified. Distances from the line(s) are calculated using a scale and a power. A positive power emphasizes iterations farther from the line(s); a negative power emphasizes iterations closer to the line(s).

Quadrant: The plane is divided into four quadrants depending on the center point and an angle. Color using only iterations with zz in the specified quadrant. Distances are calculated based on one of many combinations of the real and imaginary parts of zz, relative to the quadrant center and angle.

Simple: Distances are calculated based on one of many combinations of the real and imaginary parts of zz.

Square: A square is defined by its center and its side length. Color using only iterations with zz inside or outside the square, as specified. For inside, a positive power emphasizes iterations closer to the center; a negative power emphasizes iterations farther from the center. For outside, the reverse is true.

TIA Distance: Distance is calculated as in the standard versions in Standard.ucl and Standard.ulb. Sometimes the TIA final smooth is useful.

Trap: This is a wrapper for using one of the TrapShape distance calculating plug-ins. These can be found in ck.ulb, dmj5.ulb, kcc5.ulb, mhb.ulb, mmf.ulb, mt.ulb, reb.ulb, rkb.ulb, sam.ulb, and standard.ulb.