﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<Fractal OverSampling="Sample3x3" ViewCenter.X="-0.177272727272727" ViewCenter.Y="0.624242424242424" PixelSize="0.00101683501683502" Pixels.X="1200" Pixels.Y="900" ClassicProcessing="None" OrbitTrapProcessing="ActivateControllers" OrbitTrapMinDwell="10" OrbitTrapMaxDwell="12">
  <FractalNotes><![CDATA[]]></FractalNotes>
  <FractalEquation Id="0caf94a3-ad1e-4b77-b1a9-5b5a0ebccd1d" Title="Mandelbrot">
    <Instructions><![CDATA[
comment:
  
  The classic Mandelbrot fractal discovered 
  in 1979 by Benoit B. Mandelbrot.
  
  For details see the book:
    "The Science of Fractal Images"
  by M.F. Barnsley, R.L. Devaney, B.B. Mandelbrot, 
  H.-O. Peitgen, D. Saupe, R.F. Voss, with contributions
  by Y. Fisher, M. McGuire.
  
  Also see:
    http://mathworld.wolfram.com/MandelbrotSet.html
    http://en.wikipedia.org/wiki/Mandelbrot_set
    http://classes.yale.edu/fractals/
  
iterate:
  
  z = z^2 + c
]]></Instructions>
    <PropertyValueOverrides />
  </FractalEquation>
  <TransformationArray>
    <Transformation Id="7fc4bc2c-b961-4431-b074-277d7b29842b" Title="Identity">
      <Instructions><![CDATA[]]></Instructions>
      <PropertyValueOverrides />
    </Transformation>
  </TransformationArray>
  <TransformationArray>
    <Transformation Id="7fc4bc2c-b961-4431-b074-277d7b29842b" Title="Identity">
      <Instructions><![CDATA[]]></Instructions>
      <PropertyValueOverrides />
    </Transformation>
  </TransformationArray>
  <AlternateValueInfo />
  <AlternateValueInfo />
  <OrbitTrapInfo Directive="TrapMatchingPoint">
    <OrbitTrapArray>
      <OrbitTransform />
      <OrbitTransform />
      <TransformationArray>
        <Transformation Id="7fc4bc2c-b961-4431-b074-277d7b29842b" Title="Identity">
          <Instructions><![CDATA[]]></Instructions>
          <PropertyValueOverrides />
        </Transformation>
      </TransformationArray>
      <TransformationArray>
        <Transformation Id="7fc4bc2c-b961-4431-b074-277d7b29842b" Title="Identity">
          <Instructions><![CDATA[]]></Instructions>
          <PropertyValueOverrides />
        </Transformation>
      </TransformationArray>
      <SymmetryTransformation Id="8301dc6c-2273-4fb9-ada8-2ded2833031f" Title="Identity">
        <Instructions><![CDATA[]]></Instructions>
        <PropertyValueOverrides />
      </SymmetryTransformation>
      <OrbitTrapValueBlend />
      <OrbitTrapItem>
        <OrbitTrap Id="cfc67a06-0f5f-4dd8-8f84-a9f0fe6c984c" Title="String Art">
          <Instructions ForceExecution="True"><![CDATA[
comment:
  
  Simple string art pattern. Nice when used with 
  a complex transformation to warp the pattern.
  
global:
  
  CurveTrap.Initialize(0, 0, 1, False, 1, False, LineWidth)
  '
  ' Compute the rate required to rotate base triangle
  ' 60 degrees in Count iterations.
  '
  a = Math.PI/3 / Count
  rate = 2*Tan(a)/(3*Tan(a)+Sqrt(3))

  Complex patterns[4,6] = \
    0, 1, 0, 1, 0, 1, \
    0, 0, 1, 0, 0, 1, \
    0, 0, 0, 1, 1, 1, \
    0, 0, 0, 0, 0, 0  \
  
  Complex p[6]
  Complex t[3]
  
  Geometry.GeneratePointsOnCircle(p[], 6, 0, Radius, DegreeToRadian(Angle))
  
  for (i = 0, i < 6, i += 1) {
    j = IIf(i=5, 0, i+1)
    
    t[] = 0, p[i], p[j]
    
    if (patterns[Pattern,i] = 1) {
      Array.Reverse(t[])
    }
    for (k = 0, k < Count, k += 1) {
      CurveTrap.AddCurve( \
        t[], 3, True, 1, 1, 0, 0, 0, k, 0  \
      )
      Geometry.PolygonSpin(t[], t[], 3, rate)
    }
  }

trap:
  
  trappedPoint = CurveTrap.Apply(z)

properties:
  
  option Pattern {
    type = IntegerEnum(0,3)
    caption = "Pattern"
    details = "Pattern for design"
    default = 0
  }
  option Count {
    type = Integer
    caption = "Count"
    details = "Number of times to rotate triangle"
    default = 12
    range = (1,)
  }
  option Radius {
    type = Float
    caption = "Radius"
    details = "Radius of design"
    default = 2
    range = (0,)
  }
  option Angle {
    type = Float
    caption = "Angle"
    details = "Angle of rotation"
    default = 0
    range = [-360,360]
  }
  option LineWidth {
    type = Float
    caption = "Line Width"
    details = "Extent of trap on either side of curve (> 0)"
    range = (0,)
    default = 0.01
  }
]]></Instructions>
          <PropertyValueOverrides />
        </OrbitTrap>
      </OrbitTrapItem>
    </OrbitTrapArray>
    <OrbitTrapMasterController Id="c0ee11e5-31b4-4317-aa68-94f9da6964c6" Title="Pass Thru">
      <Instructions><![CDATA[
comment:
  
  Return color computed by 1st controller.
  
color:
  
  color = Controller.Color(0)
]]></Instructions>
      <PropertyValueOverrides />
    </OrbitTrapMasterController>
    <OrbitTrapControllerArray>
      <OrbitTrapController Id="ec874b8f-04db-4a07-97ff-1830535c70f7" Title="Gradient Map - Value">
        <GradientArray>
          <Gradient Title="6 Colors - Spectrum (Vibrant)">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear" BaseSaturationAdjustment="100" BaseLightnessAdjustment="10">
                <ReferencePoint Color="DF2020" />
                <ReferencePoint Color="DFDF20" />
                <ReferencePoint Color="1AB21A" />
                <ReferencePoint Color="20DFDF" />
                <ReferencePoint Color="2020DF" />
                <ReferencePoint Color="B21AB2" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="FF1A1A" />
              <GradientPoint X="0.1666667" Color="FFFF1A" />
              <GradientPoint X="0.3333333" Color="00EB00" />
              <GradientPoint X="0.5" Color="1AFFFF" />
              <GradientPoint X="0.6666667" Color="1A1AFF" />
              <GradientPoint X="0.8333334" Color="EB00EB" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="6 Colors - Spectrum (Subdued)">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="DF2020" />
                <ReferencePoint Color="DFDF20" />
                <ReferencePoint Color="1AB21A" />
                <ReferencePoint Color="20DFDF" />
                <ReferencePoint Color="2020DF" />
                <ReferencePoint Color="B21AB2" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="DF2020" />
              <GradientPoint X="0.1666667" Color="DFDF20" />
              <GradientPoint X="0.3333333" Color="1AB21A" />
              <GradientPoint X="0.5" Color="20DFDF" />
              <GradientPoint X="0.6666667" Color="2020DF" />
              <GradientPoint X="0.8333334" Color="B21AB2" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="6 Colors - Spectrum (Pastels)">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear" BaseLightnessAdjustment="60">
                <ReferencePoint Color="DF2020" />
                <ReferencePoint Color="DFDF20" />
                <ReferencePoint Color="1AB21A" />
                <ReferencePoint Color="20DFDF" />
                <ReferencePoint Color="2020DF" />
                <ReferencePoint Color="B21AB2" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="F2A6A6" />
              <GradientPoint X="0.1666667" Color="F2F2A6" />
              <GradientPoint X="0.3333333" Color="94EF94" />
              <GradientPoint X="0.5" Color="A6F2F2" />
              <GradientPoint X="0.6666667" Color="A6A6F2" />
              <GradientPoint X="0.8333334" Color="EF94EF" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Red, Blue, White, Yellow">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="FF0000" />
                <ReferencePoint Color="0000FF" />
                <ReferencePoint Color="FFFFFF" />
                <ReferencePoint Color="FFFF00" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="FF0000" />
              <GradientPoint X="0.25" Color="0000FF" />
              <GradientPoint X="0.5" Color="FFFFFF" />
              <GradientPoint X="0.75" Color="FFFF00" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Fire Brick, Purple, Lavender Blush, Indian Red">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="B22222" />
                <ReferencePoint Color="800080" />
                <ReferencePoint Color="FFF0F5" />
                <ReferencePoint Color="CD5C5C" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="B22222" />
              <GradientPoint X="0.25" Color="800080" />
              <GradientPoint X="0.5" Color="FFF0F5" />
              <GradientPoint X="0.75" Color="CD5C5C" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Maroon, Thistle, Linen, Dark Goldenrod">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="800000" />
                <ReferencePoint Color="D8BFD8" />
                <ReferencePoint Color="FAF0E6" />
                <ReferencePoint Color="B8860B" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="800000" />
              <GradientPoint X="0.25" Color="D8BFD8" />
              <GradientPoint X="0.5" Color="FAF0E6" />
              <GradientPoint X="0.75" Color="B8860B" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Copper, Gold, Silver, Bronze">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="BF8040" />
                <ReferencePoint Color="E6C319" />
                <ReferencePoint Color="F0F0F5" />
                <ReferencePoint Color="B8A37A" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="BF8040" />
              <GradientPoint X="0.25" Color="E6C319" />
              <GradientPoint X="0.5" Color="F0F0F5" />
              <GradientPoint X="0.75" Color="B8A37A" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Green, Beige, Tan, Khaki">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="008000" />
                <ReferencePoint Color="F5F5DC" />
                <ReferencePoint Color="D2B48C" />
                <ReferencePoint Color="F0E68C" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="008000" />
              <GradientPoint X="0.25" Color="F5F5DC" />
              <GradientPoint X="0.5" Color="D2B48C" />
              <GradientPoint X="0.75" Color="F0E68C" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Forest Green, Cadet Blue, Alice Blue, Slate Gray">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="228B22" />
                <ReferencePoint Color="5F9EA0" />
                <ReferencePoint Color="F0F8FF" />
                <ReferencePoint Color="708090" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="228B22" />
              <GradientPoint X="0.25" Color="5F9EA0" />
              <GradientPoint X="0.5" Color="F0F8FF" />
              <GradientPoint X="0.75" Color="708090" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Cornflower Blue, Steel Blue, Alice Blue, Slate Blue">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="6495ED" />
                <ReferencePoint Color="4682B4" />
                <ReferencePoint Color="F0F8FF" />
                <ReferencePoint Color="6A5ACD" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="6495ED" />
              <GradientPoint X="0.25" Color="4682B4" />
              <GradientPoint X="0.5" Color="F0F8FF" />
              <GradientPoint X="0.75" Color="6A5ACD" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
          <Gradient Title="4 Colors - Dark Orchid, Slate Blue, Alice Blue, Medium Violet Red">
            <GradientController Smooth="True" DescriptorEnabled="True">
              <GradientDescriptor Style="Linear">
                <ReferencePoint Color="9932CC" />
                <ReferencePoint Color="6A5ACD" />
                <ReferencePoint Color="F0F8FF" />
                <ReferencePoint Color="C71585" />
              </GradientDescriptor>
              <GradientPoint X="0" Color="9932CC" />
              <GradientPoint X="0.25" Color="6A5ACD" />
              <GradientPoint X="0.5" Color="F0F8FF" />
              <GradientPoint X="0.75" Color="C71585" />
            </GradientController>
            <GradientController Type="Opacity" />
          </Gradient>
        </GradientArray>
        <TextureArray />
        <Instructions><![CDATA[
comment:
  
  Maps a sample point value to a gradient index.
  
  Different settings for 'Value' can be used to create
  very different effects. For example:
  
  - 'Trap Angle'/'Trap Angle (Bounce)' color the trap 
    based on the angle set by the orbit trap instructions. 
  
  - 'Trap Dwell (Raw)' colors each point based on the
    dwell value of the orbit point when trapped. 
    You should set 'Factor' to 1/N where N is the number of 
    distinct colors you want in the result. For example, 
    to use 4 colors from the gradient, set 'Factor'=0.25.
    To use 6 colors from the gradient, set 'Factor'=0.17.
  
  - 'Trap Count' colors each point based on the number of 
    times the point was trapped during its orbit.
  
  - For those traps that set the trap index, you can 
    use 'Trap Index' to color the fractal based on the 
    index values. The 'Circle Inversion', Apollonian Gasket
    'Schottky Group', and 'Kleinian Group' orbit traps look
    especially nice when colored by 'Trap Index'.
  
  - 'Magnitude' paints the trap with a magnitude based 
    coloring. In order to access the magnitude, you will 
    need to set the following properties on the 
    Mandelbrot/Julia/Newton properties page:
  
                    Type: Both
         Process Classic: Generate Data
      Process Orbit Trap: Activate Controllers
  
    This will generate the normalized magnitude so your
    program can use it.
  
  - 'Alternate 1 Value' or 'Alternate 1 Angle' paint the 
    trap with either of these data values. You will need 
    to activate 'Alternate Mapping 1' to use them.
  
  'Power', 'Factor', and 'Offset' are used to shift/scale
  the data values before indexing into the gradient.
  
  Other things to try:
  
  - Check 'Apply Depth' in the '3D Mapping' section to
    add a metallic quality to the color. Increase the 
    'Ambient Light' to brighten the image.
    
color:
  
  color = Gradient.Color(ColorScheme, Offset + Factor*Value^Power)
  
properties:
  
  option ColorScheme {
    type = GradientIndex
    caption = "Color Scheme"
    default = 0
    size = Large
  }
  option Value {
    type = SamplePointValue
    caption = "Value"
    default = Sample.TrapAngle
  }
  option Power {
    type = Float
    caption = "Power"
    details = "Set value = value ^ Power (0.125 to 8)"
    default = 1
    range = [0.125,8]
  }
  option Factor {
    type = Float
    caption = "Factor"
    details = "Set value = value * Factor (-8 to 8)"
    default = 1
    range = [-8,8]
  }
  option Offset {
    type = Float
    caption = "Offset"
    details = "Set value = value + Offset (-1 to 1)"
    default = 0
    range = [-1,1]
  }
]]></Instructions>
        <PropertyValueOverrides>
          <Option Name="ColorScheme" Type="GradientIndexOption" Value="1" />
        </PropertyValueOverrides>
      </OrbitTrapController>
    </OrbitTrapControllerArray>
    <SampleDataNormalizer>
      <NormalizerDescriptor />
    </SampleDataNormalizer>
    <SampleDataNormalizer>
      <NormalizerDescriptor />
    </SampleDataNormalizer>
    <SampleDataNormalizer>
      <NormalizerDescriptor />
    </SampleDataNormalizer>
  </OrbitTrapInfo>
  <TransformationArray>
    <Transformation Id="7fc4bc2c-b961-4431-b074-277d7b29842b" Title="Identity">
      <Instructions><![CDATA[]]></Instructions>
      <PropertyValueOverrides />
    </Transformation>
  </TransformationArray>
  <TriangleMetricSet>
    <Instructions><![CDATA[metric = p1]]></Instructions>
    <TriangleMetric />
    <TriangleMetric />
    <TriangleMetric />
  </TriangleMetricSet>
</Fractal>