Namespaces
Variants
Actions

Difference between revisions of "User:Boris Tsirelson/sandbox1"

From Encyclopedia of Mathematics
Jump to: navigation, search
(Blanked the page)
Line 1: Line 1:
 +
<center><asy>
 +
size(100,100);
  
 +
// recursive procedure, draws the fractal within the rectangle [x0,x1]×[y0,y1]
 +
void f(real x0, real x1, real y0, real y1, int n) {
 +
  if (n!=0) {
 +
    real dx = (x1-x0)/3;
 +
    real dy = (y1-y0)/2;
 +
    draw( (x0+dx,y0+dy)--(x0+2*dx,y0+dy), defaultpen+1 );
 +
    f(x0,x0+dx,y0,y0+dy,n-1);
 +
    f(x0+2*dx,x1,y0+dy,y1,n-1);
 +
  }
 +
}
 +
 +
f(0,1,0,1,9);
 +
draw( (0,0)--(1,0), arrow=Arrow );
 +
draw( (0,0)--(0,1), arrow=Arrow );
 +
</asy></center>

Revision as of 19:33, 14 February 2013

How to Cite This Entry:
Boris Tsirelson/sandbox1. Encyclopedia of Mathematics. URL: http://encyclopediaofmath.org/index.php?title=Boris_Tsirelson/sandbox1&oldid=29432