Orbit Traps 

Orbit Traps OverviewOrbit Traps are Fractal Science Kit fractal generator programs that define a set of geometric objects located on the complex plane and that keep statistics related to how close the orbit points come to these objects. These statistics are available to the controllers to color the fractal. Orbit Traps are displayed within the context of Mandelbrot Fractals. Note the term Orbit Trap is used for both the program that defines the geometric objects and the objects themselves, depending on context. See also:
Each program is composed of a set of properties and instructions. CommentsAlways remember to click the Toggle Code View toolbar button at the top of the Program Editor and read the comments given in the comment section of the program's instructions. The comment section contains usage instructions, hints, notes, documentation, and other important information that will help you understand how best to use the program. Once you are done reading the comments, click the Toggle Code View toolbar button again to view the program's properties. Properties
The following properties are supported:
InstructionsThe remainder of this page can be ignored if you are not a programmer. At the bottom of the window is an editor pane named Instructions. The editor pane is a simple text editor to view/edit your Program Instructions. See Editing Text for details. The instructions are divided into sections. Within each section are statements that conform to the Programming Language syntax. In addition to the Standard Sections, Orbit Traps support 1 other section: trap: The trap section is responsible for setting trappedPoint based on how close z comes to the orbit trap. trappedPoint is a TrappedPointInfo object defined as: Object TrappedPointInfo { Value is a measure of how close a point is to the trap. There are 2 basic types of traps: curves and solids. Curves include lines, circles, polygons, ellipses, etc. Solids include disks (the interior of a circle), filled polygons, solid shapes, etc. When you evaluate how close a point is to a trap, you need to consider which type of trap it is. For curves, the Value is the signed scaled distance of the point z to the closest point on the curve. The sign represents which side of the curve z is on. For example, a circle trap would return negative values along the inside edge of the curve and positive values along the outside edge of the curve. When you compute the scaled distance to the curve, you use both the actual distance and the curve width. The scaled distance is given as a percent of the curve width where the curve width is defined as the extent of the trap on either side of the curve. Values between 1 and 1 are trapped. Values less than 1 or greater than 1 are not trapped. Values equal to 1 or 1 are on the inside/outside edge of the trap. For solid traps, Value is the scaled distance of the point z to the center of the solid. The scaled distance is given as a percent of the distance from the trap center to the exterior of the trap. Values between 0 and 1 are trapped. Values greater than 1 are not trapped. Values are always positive. This is also known as the level set value of the shape. In truth, the center of the solid can be a line or curve and Value is the scaled distance to the closest point on the curve. In this case the distinction between curves and solids is blurred. Angle is the angle in radians between a horizontal line through the center of the trap and a vector from the center to z. Alternate definitions of the angle are possible. For closed curves you can define the Angle at z as the percent of the curve's path (scaled to 2*Math.PI) that must be traversed to arrive at the closest point on the curve to z. Traps composed of multiple curves/shapes can define the Angle relative to the center of each component shape rather than the center of the entire set. Traps can provide options to control which definition to use. Index and Delta are small integers between 0 and 32767 used by traps composed of several parts to identify each part or to convey other (discrete) information to the controller. Index and Delta are optional. Example: comment: These instructions implement a simple circle orbit trap with options to control the Center and Radius of the circle and the width of the line on either side of the curve (LineWidth). An alternate implementation is to use the builtin CurveTrap methods as shown below: comment: CurveTrap includes methods to add circles, lines, segments, shapes, polygons, and arbitrary curves. These methods are highly optimized and allow you to define complex traps using relatively little code. See CurveTrap Functions for details. Example: comment: These instructions implement a disk (filled circle) orbit trap with options to control the Center and Radius of the disk. Example: comment: This is identical to the previous example but uses the builtin CurveTrap methods. Example: comment: This example implements a trap composed of a pair of lines that form a cross about a center point. The trappedPoint's Value, Angle, and Index are set based on the point z. The Delta is always set to 0. Unlike the simple examples given here, some of the builtin orbit traps are very powerful. For example, the builtin trap Apollonian Gasket is a standalone fractal outside the context of the Mandelbrot framework. In these cases, you would normally set the Min Dwell and Max Dwell to 1 on the Orbit Trap Orbit Generation section of the Mandelbrot / Julia / Newton page, to simply view the base trap, unaltered by the Mandelbrot orbit processing. Of course, you can selectively apply areas of the Mandelbrot processing to the orbit trap to produce highly unusual designs. For example, applying different Complex Transformations to the fractal yields countless variations of the base orbit trap. Builtin VariablesSeveral builtin variables are available to your instructions:
The builtin variable trappedPoint is used to return the results computed by the program. The value z is the point to trap. For convenience, z can be changed but these changes have no effect outside the context of the specific orbit trap program where the change occurs; i.e., it does not affect the orbit or any future trap processing, it is simply a local variable set to the value of the point to trap before each invocation of the trap section. 
Copyright © 20042019 Ross Hilbert 