https://rosettacode.org/wiki/Fractal_treeThe task is described as follows:
'=================================================
Generate and draw a fractal tree.
Draw the trunk
At the end of the trunk, split by some angle and draw two branches
Repeat at the end of each branch until a sufficient level of branching is reached
'=================================================
Call tree
(sw \
2, sh
- 10, _Pi * 1.5, _Pi / 180 * 29, 112, 15)
iL = length: iX = x: iY = y: iD = depth
newX
= Cos(initAngle
) * length
+ iX
newY
= Sin(initAngle
) * length
+ iY
Line (iX
, iY
)-(newX
, newY
) iL = length * .78
iD = iD - 1
Call tree
(newX
, newY
, initAngle
- theta
, theta
, iL
, iD
) Call tree
(newX
, newY
, initAngle
+ theta
, theta
, iL
, iD
)