Antenna Tree

- XLogo

Antenna Tree curve. Similar to TreeAnim at 90 degrees. Increase the order for more detail.

To New
  # set default screen, pen and turtle values
  ResetAll SetScreenSize [400 400] HideTurtle
  SetSC Black SetPC Green SetPS 1 PenUp

To Init :Order
  Make "Size 96  # make Size and RootHalf global values
  Make "RootHalf 1/Sqrt 2

To Display :Order
  # write header title and curve level
  SetPC White SetPos [-190 184]
  Label Sentence [Antenna Tree Level] :Order

To Tree :Order :Size
  If :Order < 1 [Stop]  # ie if = 0
  SetPW :Order Forward :Size Left 90
 Tree :Order-1 :RootHalf*:Size
  SetPW :Order Left 90 Forward 2*:Size Left 90
 Tree :Order-1 :RootHalf*:Size
  SetPW :Order Left 90 Forward :Size

To Go :Order
  New Init :Order Display :Order
  Home Right 90 SetPC Green PenDown
  Tree :Order :Size

Type Go order for example Go 7 to run.

Antenna Tree
Antenna Tree

Procedures blue
Variables pink
Comments green
Library gray