Projektion auf Zylinder und  Kugel

===================================================
Zylinder
===================================================

ScriptBegin
var Grafik="Script Escher";

var a=10;     // 15 Quadrat
    f=60;     // Abstand Ebene Zylinderachse
    v=70;     // 80
    PenC ="black";    
    Fill ="red";
    Fill1 ="lightgray";
    Fill2 ="black";//"yellow";

    maxi = 25;
    maxj = 45;

function init() //Initialisierungen
{ t.setBrush(Fill2);
  t.setPage(14);
  t.setAntiAliasing();
} 

function draw() //Zeichenbefehle
{ //t.drawKoordSystem();
  //t.drawRaster();

  
  defBasis();
  t.goTo(0,0); t.turnTo(0); 
  t.setRotate(35);  

  for(i=-maxi; i<=maxi; i++)
  { for(j=-maxj; j<=maxj; j++)
    { t.goTo(i*a,j*a);
      n=(i*i+j*j)%2;
      t.morphDraw("Quadrat"+n);
    }
  }
}


function defBasis()
{ t.setNoStyle();
  t.goTo(-a/2,-a/2)
  t.rectPolygon(a,a)
  t.setPen(PenC); t.setBrush(Fill); 
  t.defDraw("Quadrat0");
  t.refineDraw("Quadrat0");
  t.setBrush(Fill1); 
  t.defDraw("Quadrat1");
  t.refineDraw("Quadrat1");
}



function morphX(x,y)
{// return x;
 return v*Math.atan(x/f);
}

function morphY(x,y)
{// return y;
 return v*y/Math.sqrt(x*x+f*f);
}

ScriptEnd

===================================================
Kugel
===================================================
ScriptBegin
var Grafik="Script Escher";

var a=16;
    f=50;     // Abstand Ebene Zylinderachse
    v=95;
    PenC ="black";    
    Fill ="black";
    Fill1 ="lightgray";
    Fill2 ="crimson";//"yellow";

    maxi = 20;
    maxj = 20;

function init() //Initialisierungen
{ t.setBrush(Fill2);
  t.setPage();
  t.setAntiAliasing();
} 

function draw() //Zeichenbefehle
{ //t.drawKoordSystem();
  //t.drawRaster();

  
  defBasis();
  t.goTo(0,0); t.turnTo(10); 
  //t.setRotate(45);  

  for(i=-maxi; i<=maxi; i++)
  { for(j=-maxj; j<=maxj; j++)
    { t.goTo(i*a,j*a);
      n=(i*i+j*j)%2;
      t.morphDraw("Quadrat"+n);
    }
  }
}


function defBasis()
{ t.setNoStyle();
  t.goTo(-a/2,-a/2)
  t.rectPolygon(a,a)
  t.setPen(PenC); t.setBrush(Fill); 
  t.defDraw("Quadrat0");
  t.refineDraw("Quadrat0");
  t.setBrush(Fill1); 
  t.defDraw("Quadrat1");
  t.refineDraw("Quadrat1");
}



function morphX(x,y)
{// return x;
 d=Math.sqrt(x*x+y*y+f*f);
 return v*x/d
 return v*(x/d+x/2500)
}

function morphY(x,y)
{// return y;
 d=Math.sqrt(x*x+y*y+f*f);
 return v*y/d
 return v*(y/d+y/2500)
}

ScriptEnd
