# Orbit Functions Support

The Fractal Science Kit fractal generator Orbit functions provide access to the orbit points within a single orbit.

During the fractal iteration, the Fractal Science Kit maintains the set of points visited during the orbit thus far, called the orbit points. This set of points is available to selected programs; i.e., Fractal Equations, Orbital Equations, Alternate Values, and some Transformations. Programs access the orbit points using the functions:

Orbit.Count()
Orbit.Point(index)
Orbit.TriangleMetricPoint(index)
Orbit.TriangleMetricValue(index)
Orbit.Z0()
Orbit.C()

The semantics of these functions depends on whether you are processing a Mandelbrot fractal or an Orbital fractal.

# Mandelbrot Fractals

When accessing a Mandelbrot fractal's orbit points, Orbit.Point(index) is used to access the orbit points. If index > 0, we treat it as a 1-based index that corresponds to the dwell. For example, Orbit.Point(3) is the 3rd orbit point. If index <= 0, we treat index as a relative offset from the current dwell; Orbit.Point(0) is equal to Orbit.Point(dwell), Orbit.Point(-1) is equal to Orbit.Point(dwell-1), Orbit.Point(-2) is equal to Orbit.Point(dwell-2), and so on.

Orbit.Count() is the number of orbit points. During the iteration, Orbit.Count() equals the current dwell and points can be accessed via 0 < index <= Orbit.Count() (absolute) or -Orbit.Count() < index <= 0 (relative).

At the end of the iteration:

• If the point escaped, Orbit.Count()=dwell and Orbit.Point(dwell) is the point that escaped.

• If the point was captured, then the following holds. If cycle detection is off, Orbit.Count()=MaxDwell. If cycle detection is on, Orbit.Count()<=MaxDwell, and depends on the results of cycle detection; i.e., Orbit.Count()<MaxDwell if a cycle was detected.

Orbit.Z0() is the initial z value for Mandelbrot fractals and the pixel value for Julia fractals.

Orbit.C() is the pixel value for Mandelbrot fractals and the Julia Constant for Julia fractals.

Orbit.TriangleMetricPoint(index) and Orbit.TriangleMetricValue(index) return the Triangle Metric point/value for the given index and are only supported in Alternate Values programs.

# Orbital Fractals

When accessing an Orbital fractal's orbit points, things are a little different. Rather that generating an orbit per pixel as is done for Mandelbrot fractals, Orbital fractals have a single orbit, but the orbit is very long, sometimes numbering in the millions. That being said, we do not maintain the entire collection of orbit points but only the last N points, where N is defined by the Orbit Buffer Size property set on the Orbital / IFS / Strange Attractor page. Orbit.Count() is set to 0 at the beginning of the orbit. During the iteration, Orbit.Count() is incremented until it reaches Orbit Buffer Size, and is unchanged during the remainder of the iteration. The orbit array holds the last Orbit.Count() points in the orbit and orbit points prior to those points are not accessible.

As with Mandelbrot fractals, orbit points are accessed using absolute or relative indexing. However, since the orbit array holds the last Orbit.Count() points in the orbit, the absolute index values are relative to the beginning of the array and are rarely used. Absolute index values range from 0 < index <= Orbit.Count() and relative index values range from -Orbit.Count() < index <= 0.

Orbit.Z0() and Orbit.C() are not applicable for Orbital fractals and simply return 0.

# Summary

The following is provided for quick reference.

Mandelbrot:

Orbit.Point(dwell) = z
Orbit.Point(dwell-1) = zprev1
Orbit.Point(dwell-2) = zprev2
...
Orbit.Point(1) = the 1st orbit point
Orbit.Point(0) = z
Orbit.Point(-1) = zprev1
Orbit.Point(-2) = zprev2
...

Orbital:

Orbit.Point(0) = z
Orbit.Point(-1) = zprev1
Orbit.Point(-2) = zprev2
...

In both Mandelbrot and Orbital fractals, if the index is outside the valid range, Orbit.Point(index) returns 0.