Koch curve

From JSXGraph Wiki
Revision as of 12:13, 10 February 2009 by A WASSERMANN (talk | contribs)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.


References

Source code

function koch(x,level) {
    if (level<1) {
        t.fd(x);
    } else {
        koch(x/3,level-1);
        t.lt(60);
        koch(x/3,level-1);
        t.rt(120);
        koch(x/3,level-1);
        t.lt(60);
        koch(x/3,level-1);
    }
}

t.cs();
t.hideTurtle();
t.setPos(-250,0);
t.rt(90);
koch(400,7);