previous

page 14

next
The Tree

Concentrate on the vee that I have coloured in red.

After each branch of the vee, we do another smaller vee and this process continues until the vee is too small.

The code will be easier to write with two new functions: lt(angle) and bk(d) to move back d steps.

add to my.js
function lt(angle) {
rt(-angle);
}
function bk(d) {
fd(-d);
}
function vee(d) {
if (d>10) {
var f=.8;
lt(30);
fd(d); vee(d*f);
bk(d); rt(60);
fd(d); vee(d*f);
bk(d); lt(30);
}
}
function test() {
vee(100);
}
previous
next