Namespaces
Variants
Actions

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

From Encyclopedia of Mathematics
Jump to: navigation, search
Line 2: Line 2:
 
size(100,100);
 
size(100,100);
  
// recursive procedure, draws the fractal within the rectangle [x0,x1]×[y0,y1]
+
import math;
void f(real x0, real x1, real y0, real y1, int n) {
+
 
  if (n!=0) {
+
int kmax=40;
    real dx = (x1-x0)/3;
+
 
    real dy = (y1-y0)/2;
+
guide g;
    draw( (x0+dx,y0+dy)--(x0+2*dx,y0+dy), defaultpen+1 );
+
for (int k=-kmax; k<=kmax; ++k) {
    f(x0,x0+dx,y0,y0+dy,n-1);
+
  real phi = 0.2*k*pi;
     f(x0+2*dx,x1,y0+dy,y1,n-1);
+
  real rho = 1;
 +
  if (k!=0) {
 +
     rho = sin(phi)/phi;
 
   }
 
   }
 +
  pair z=rho*expi(phi);
 +
  g=g..z;
 
}
 
}
 +
 
 +
draw (g);
 +
 +
defaultpen(0.5);
 +
draw ( (0,0)--(1.3,0), dotted, Arrow );
 +
dot ( (1,0) );
 +
label ( "$a$", (1,0), NE );
  
f(0,1,0,1,9);
 
draw( (0,0)--(1,0), arrow=Arrow );
 
draw( (0,0)--(0,1), arrow=Arrow );
 
 
</asy></center>
 
</asy></center>

Revision as of 19:36, 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