DADiSP Worksheet Functions > Function Categories > Display and Manipulation > CTREE

 

CTREE

Purpose:

Creates a binary fractal.

Syntax:

CTREE(stages, cangle, cindex)

stages

-

Optional. An integer, the depth of fractal recursion. Defaults to 6.

cangle

-

Optional. A real, the angle increment per radians. Defaults to 4.

cindex

-

Optional. An integer, the starting color index. Defaults to 15, white.

Returns:

Multiple overplotted XY series.

Example:

ctree

 

displays a depth 6 binary C-Tree.

Example:

ctree(9)

 

image\ctreepic.gif

 

displays a depth 9 binary C-Tree.

Remarks:

CTREE draws a binary fractal called the Pythagorean Tree created by A. E. Bosman. The fractal is produced by starting with a square of width W. Two smaller squares of width W * sqrt(2)/2 are connected to one side of the first square to form a 45-45-90 triangle. The process is repeated with each of the smaller squares over and over again. Because each new stage creates twice as many squares as the preceding stage, the Pythagorean Tree is considered a binary fractal.

 

The SPL code is based on an algorithm by Hans Lauwerier.

See Also:

OVERPLOT

XY

References:

Hans Lauwerier

Fractals: Endlessly Repeated Geometrical Figures.

Princeton University Press, 1991

p111-112