//Cindy-2.0-beta build 590 (2006/01/02 19:14)
//Created on: Jan 6, 2006 1:27:32 AM
//For: richter
//DO NOT EDIT --- MACHINE GENERATED CODE
Geometry:=Euclidean;
("C"):=FreePoint([2.5050505050505047+i*0.0,4.0+i*0.0,-0.33670033670033667+i*-0.0]);
"C".setAppearance(2,5,1,0,0,9,false,false);
"C".setAttribute("color","2");
"C".setAttribute("visibility","9");
"C".setAttribute("drawtrace","false");
"C".setAttribute("tracelength","100");
"C".setAttribute("traceskip","1");
"C".setAttribute("tracedim","1.0");
"C".setAttribute("render","false");
"C".setAttribute("pinning","false");
"C".setAttribute("labeled","false");
"C".setAttribute("ptsize","5");
"C".setAttribute("pointborder","true");
"C".setLabelPos(3,3,1,false,0.0,0.2,1);
("D"):=FreePoint([0.0+i*0.0,0.0+i*0.0,4.0+i*0.0]);
"D".setAppearance(2,2,1,0,0,9,false,true);
"D".setAttribute("color","2");
"D".setAttribute("visibility","9");
"D".setAttribute("drawtrace","false");
"D".setAttribute("tracelength","100");
"D".setAttribute("traceskip","1");
"D".setAttribute("tracedim","1.0");
"D".setAttribute("render","false");
"D".setAttribute("pinning","true");
"D".setAttribute("labeled","false");
"D".setAttribute("ptsize","2");
"D".setAttribute("pointborder","true");
"D".setLabelPos(3,3,1,false,0.0,0.2,1);
("C0"):=CircleByRadius("D",3.2912+i*0.0);
"C0".setAppearance(3,5,1,0,0,2,false,false);
"C0".setAttribute("color","3");
"C0".setAttribute("visibility","2");
"C0".setAttribute("drawtrace","false");
"C0".setAttribute("tracelength","100");
"C0".setAttribute("traceskip","1");
"C0".setAttribute("tracedim","1.0");
"C0".setAttribute("render","false");
"C0".setAttribute("pinning","false");
"C0".setAttribute("linesize","1");
"C0".setAttribute("colorfill","5");
"C0".setAttribute("visibilityfill","0");
"C0".setAttribute("linkvisibility","false");
"C0".setAttribute("pinning","false");
{"A",null,[1.0+i*0.0,0.0+i*0.0,1.0+i*0.0]}:=PointOnCircle("C0",[1.7000000000000004+i*0.0,4.0+i*0.0,0.0+i*0.0]);
"A".setAppearance(8,3,1,0,0,9,false,false);
"A".setAttribute("color","8");
"A".setAttribute("visibility","9");
"A".setAttribute("drawtrace","false");
"A".setAttribute("tracelength","100");
"A".setAttribute("traceskip","1");
"A".setAttribute("tracedim","1.0");
"A".setAttribute("render","false");
"A".setAttribute("pinning","false");
"A".setAttribute("labeled","false");
"A".setAttribute("ptsize","3");
"A".setAttribute("pointborder","true");
"A".setLabelPos(3,3,1,false,0.0,0.2,1);
{"B",null,[1.0+i*0.0,0.0+i*0.0,1.0+i*0.0]}:=PointOnCircle("C0",[4.0+i*0.0,-1.1282051282051282+i*0.0,0.0+i*0.0]);
"B".setAppearance(8,3,1,0,0,9,false,false);
"B".setAttribute("color","8");
"B".setAttribute("visibility","9");
"B".setAttribute("drawtrace","false");
"B".setAttribute("tracelength","100");
"B".setAttribute("traceskip","1");
"B".setAttribute("tracedim","1.0");
"B".setAttribute("render","false");
"B".setAttribute("pinning","false");
"B".setAttribute("labeled","false");
"B".setAttribute("ptsize","3");
"B".setAttribute("pointborder","true");
"B".setLabelPos(3,3,1,false,0.0,0.2,1);
("E"):=FreePoint([4.0+i*0.0,0.0+i*0.0,0.4+i*0.0]);
"E".setAppearance(2,2,1,0,0,9,false,true);
"E".setAttribute("color","2");
"E".setAttribute("visibility","9");
"E".setAttribute("drawtrace","false");
"E".setAttribute("tracelength","100");
"E".setAttribute("traceskip","1");
"E".setAttribute("tracedim","1.0");
"E".setAttribute("render","false");
"E".setAttribute("pinning","true");
"E".setAttribute("labeled","false");
"E".setAttribute("ptsize","2");
"E".setAttribute("pointborder","true");
"E".setLabelPos(3,3,1,false,0.0,0.2,1);
("F"):=FreePoint([4.0+i*0.0,-1.6+i*0.0,0.4+i*0.0]);
"F".setAppearance(2,2,1,0,0,9,false,true);
"F".setAttribute("color","2");
"F".setAttribute("visibility","9");
"F".setAttribute("drawtrace","false");
"F".setAttribute("tracelength","100");
"F".setAttribute("traceskip","1");
"F".setAttribute("tracedim","1.0");
"F".setAttribute("render","false");
"F".setAttribute("pinning","true");
"F".setAttribute("labeled","false");
"F".setAttribute("ptsize","2");
"F".setAttribute("pointborder","true");
"F".setLabelPos(3,3,1,false,0.0,0.2,1);
("a"):=Segment("E","F");
"a".setAppearance(3,5,1,0,0,9,false,false);
"a".setArrowType(0,3,100,8);
"a".setAttribute("color","3");
"a".setAttribute("visibility","9");
"a".setAttribute("drawtrace","false");
"a".setAttribute("tracelength","100");
"a".setAttribute("traceskip","1");
"a".setAttribute("tracedim","1.0");
"a".setAttribute("render","false");
"a".setAttribute("labeled","false");
"a".setAttribute("linesize","1");
"a".setAttribute("overlap","0");
"a".setAttribute("clipline","0");
"a".setAttribute("linedashing","false");
"a".setAttribute("lineborder","false");
"a".setLabelPos(3,3,1,false,0.0,0.2,1);
"a".setArrowType(0,3,100,8);
("G"):=PointOnLine("a",[4.0+i*0.0,-1.1039999999999999+i*0.0,0.39999999999999997+i*0.0]);
"G".setAppearance(8,3,1,0,0,9,false,false);
"G".setAttribute("color","8");
"G".setAttribute("visibility","9");
"G".setAttribute("drawtrace","false");
"G".setAttribute("tracelength","100");
"G".setAttribute("traceskip","1");
"G".setAttribute("tracedim","1.0");
"G".setAttribute("render","false");
"G".setAttribute("pinning","false");
"G".setAttribute("labeled","false");
"G".setAttribute("ptsize","3");
"G".setAttribute("pointborder","true");
"G".setLabelPos(3,3,1,false,0.0,0.2,1);
"G".setAlgData("TYPE",1);
"G".setAlgData("RATIO",0.69+i*-8.326673E-17);
("Text0"):=Text();
"Text0".setAppearance(0,5,1,0,0,9,false,false);
"Text0".setAttribute("color","0");
"Text0".setAttribute("visibility","9");
"Text0".setAttribute("drawtrace","false");
"Text0".setAttribute("tracelength","100");
"Text0".setAttribute("traceskip","1");
"Text0".setAttribute("tracedim","1.0");
"Text0".setAttribute("render","false");
"Text0".setAttribute("linesize","1");
"Text0".setAttribute("colorfill","0");
"Text0".setAttribute("visibilityfill","0");
"Text0".setAttribute("linkvisibility","false");
"Text0".setText("Move the yellow points");
"Text0".setFloating([4.0+i*0.0,2.718954248366013+i*0.0,0.6535947712418301+i*0.0]);
Geometry:=Euclidean;
behavior {Environment();
          setParams(1.0,0.0,0.0);
          addToLevel(1);
         }
behavior {Motor();
          setParams(1.0,0.1,0.0);
          addToLevel(1);
         }
kernel.setAcc(2);
kernel.setFrames(1);
kernel.setSpeed(1.0);
kernel.newScript("Draw","");
kernel.appendScript("");
kernel.appendScript("col1=[1,0,0];");
kernel.appendScript("col2=[0,1,0];");
kernel.appendScript("col3=[0,0,1];");
kernel.appendScript("");
kernel.appendScript("amb=.2;");
kernel.appendScript("");
kernel.appendScript("lights=[");
kernel.appendScript("   [[-cos(30°),-sin(30°),-.5],col1],");
kernel.appendScript("   [[-cos(150°),-sin(150°),-.5],col2],");
kernel.appendScript("   [[-cos(270°),-sin(270°),-.5],col3]");
kernel.appendScript("];");
kernel.appendScript("ambient=(1,1,1)*amb;");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("color((0,0,0.8));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("l=G.y/8;");
kernel.appendScript("l=max([min([l,0.499]),0.001]);");
kernel.appendScript("facescut=apply(faces,cut(#_1,#_2,#_3,#_4,l));");
kernel.appendScript("facescuto=apply(faceso,cut3(#_1,#_2,#_3,#_4,l));");
kernel.appendScript("");
kernel.appendScript("forall(facescut++facescuto,renderPoly(#));");
kernel.appendScript("forall(facescut++facescuto,renderPolyShade(#,[1,1,1]));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.setCompiler("de.cinderella.geometry.formula.CindyScriptCompiler");
kernel.endScript();
kernel.newScript("Draw","");
kernel.appendScript("matx=[[A.y,A.x,0,0],[-A.x,A.y,0,0],[0,0,abs(A),0],[0,0,0,1]];");
kernel.appendScript("maty=[[abs(B),0,0,0],[0,B.y,B.x,0],[0,-B.x,B.y,0],[0,0,0,1]];");
kernel.appendScript("");
kernel.appendScript("");
kernel.setCompiler("de.cinderella.geometry.formula.CindyScriptCompiler");
kernel.endScript();
kernel.newScript("Init","");
kernel.appendScript("//  p 1,2,3,4");
kernel.appendScript("//  g 12,13,14,23,24,34");
kernel.appendScript("//  h 123,124,134,234");
kernel.appendScript("");
kernel.appendScript("jpp(p1,p2):=(p1_1*p2_2-p1_2*p2_1,");
kernel.appendScript("             p1_1*p2_3-p1_3*p2_1,");
kernel.appendScript("             p1_1*p2_4-p1_4*p2_1,");
kernel.appendScript("             p1_2*p2_3-p1_3*p2_2,");
kernel.appendScript("             p1_2*p2_4-p1_4*p2_2,");
kernel.appendScript("             p1_3*p2_4-p1_4*p2_3);");
kernel.appendScript("");
kernel.appendScript("jpg(p,g):=( p_1*g_4-p_2*g_2+p_3*g_1,");
kernel.appendScript("            p_1*g_5-p_2*g_3+p_4*g_1,");
kernel.appendScript("            p_1*g_6-p_3*g_3+p_4*g_2,");
kernel.appendScript("            p_2*g_6-p_3*g_5+p_4*g_4");
kernel.appendScript("          );");
kernel.appendScript("");
kernel.appendScript("mhh(h1,h2):=(h1_1*h2_2-h1_2*h2_1,//3.4-4.3");
kernel.appendScript("             h1_1*h2_3-h1_3*h2_1,//2.4-4.2");
kernel.appendScript("             h1_2*h2_3-h1_3*h2_2,//2.3-3.2");
kernel.appendScript("             h1_1*h2_4-h1_4*h2_1,//1.4-4.1");
kernel.appendScript("             h1_2*h2_4-h1_4*h2_2,//1.3-3.1");
kernel.appendScript("             h1_3*h2_4-h1_4*h2_3);//1.2-2.1");
kernel.appendScript("");
kernel.appendScript("//  p 1,2,3,4");
kernel.appendScript("//  g 12,13,14,23,24,34");
kernel.appendScript("//  h 123,124,134,234");
kernel.appendScript("mgh(g,h):=(g_1*h_3-g_2*h_2+g_3*h_1,//2.34-3.24+4.23");
kernel.appendScript("           g_1*h_4-g_4*h_2+g_5*h_1,//1.34-3.14+4.13");
kernel.appendScript("           g_2*h_4-g_4*h_3+g_6*h_1,//1.24-2.14+4.12");
kernel.appendScript("           g_3*h_4-g_5*h_3+g_6*h_2);//1.23-2.13+3.12");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("sph(p,h):=(p_1*h_4-p_2*h_3+p_3*h_2-p_4*h_1);");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.setCompiler("de.cinderella.geometry.formula.CindyScriptCompiler");
kernel.endScript();
kernel.newScript("Init","");
kernel.appendScript("w1=[-1,-1,-1,1];");
kernel.appendScript("w2=[ 1,-1,-1,1];");
kernel.appendScript("w3=[-1, 1,-1,1];");
kernel.appendScript("w4=[ 1, 1,-1,1];");
kernel.appendScript("w5=[-1,-1, 1,1];");
kernel.appendScript("w6=[ 1,-1, 1,1];");
kernel.appendScript("w7=[-1, 1, 1,1];");
kernel.appendScript("w8=[ 1, 1, 1,1];");
kernel.appendScript("");
kernel.appendScript("pts=[w1,w2,w3,w4,w5,w6,w7,w8];");
kernel.appendScript("segs=[[w1,w2],[w1,w3],[w1,w5],[w2,w4],");
kernel.appendScript("      [w2,w6],[w3,w4],[w3,w7],[w4,w8],");
kernel.appendScript("  [w5,w6],[w5,w7],[w6,w8],[w7,w8]");
kernel.appendScript("];");
kernel.appendScript("faces=[[w1,w2,w4,w3],");
kernel.appendScript("[w5,w7,w8,w6],");
kernel.appendScript("[w1,w3,w7,w5],");
kernel.appendScript("[w2,w1,w5,w6],");
kernel.appendScript("[w4,w2,w6,w8],");
kernel.appendScript("[w3,w4,w8,w7]];");
kernel.appendScript("");
kernel.appendScript("faceso=[");
kernel.appendScript("[w1,w2,w5,w3],");
kernel.appendScript("[w2,w1,w4,w6],");
kernel.appendScript("[w3,w1,w7,w4],");
kernel.appendScript("[w4,w3,w8,w2],");
kernel.appendScript("[w5,w7,w1,w6],");
kernel.appendScript("[w6,w5,w2,w8],");
kernel.appendScript("[w7,w5,w8,w3],");
kernel.appendScript("[w8,w7,w6,w4]");
kernel.appendScript("];");
kernel.appendScript("");
kernel.appendScript("cut(a,b,c,d,l):=[");
kernel.appendScript("  (1-l)*a+l*b,l*a+(1-l)*b,");
kernel.appendScript("  (1-l)*b+l*c,l*b+(1-l)*c,");
kernel.appendScript("  (1-l)*c+l*d,l*c+(1-l)*d,");
kernel.appendScript("  (1-l)*d+l*a,l*d+(1-l)*a");
kernel.appendScript("];");
kernel.appendScript("");
kernel.appendScript("cut3(a,b,c,d,l):=[");
kernel.appendScript("  (1-l)*a+l*b,");
kernel.appendScript("  (1-l)*a+l*d,");
kernel.appendScript("  (1-l)*a+l*c,");
kernel.appendScript("];");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.setCompiler("de.cinderella.geometry.formula.CindyScriptCompiler");
kernel.endScript();
kernel.newScript("Init","");
kernel.appendScript("matx=[[A.y,A.x,0,0],[-A.x,A.y,0,0],[0,0,abs(A),0],[0,0,0,1]];");
kernel.appendScript("maty=[[abs(B),0,0,0],[0,B.y,B.x,0],[0,-B.x,B.y,0],[0,0,0,1]];");
kernel.appendScript("");
kernel.appendScript("renderPoint(p):=(");
kernel.appendScript("  pp=maty*(matx*p);");
kernel.appendScript("  draw((pp_1/pp_4,pp_2/pp_4))");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("renderLine(p,q):=(");
kernel.appendScript("  pp=maty*(matx*p);");
kernel.appendScript("  qq=maty*(matx*q);");
kernel.appendScript("  draw((pp_1/pp_4,pp_2/pp_4),(qq_1/qq_4,qq_2/qq_4));");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("norm(p):=(p_1/p_4,p_2/p_4,p_3/p_4);");
kernel.appendScript("ambient=(1,1,1);");
kernel.appendScript("");
kernel.appendScript("lights=[");
kernel.appendScript("   [[1,-1,-1],[1,0.2,0.2]],");
kernel.appendScript("   [[-1,-1,-1],[0.2,0.2,1]],");
kernel.appendScript("   [[0,0,-1],[0.2,.3,.2]]");
kernel.appendScript("];");
kernel.appendScript("");
kernel.appendScript("renderPolygon(pol,col):=(");
kernel.appendScript("  pp=apply(pol,maty*(matx*#));");
kernel.appendScript("  aa=norm(pp_1);bb=norm(pp_2),cc=norm(pp_3);");
kernel.appendScript("  nn=cross(bb-aa,bb-cc);");
kernel.appendScript("  nn=nn/abs(nn);");
kernel.appendScript("  rgb=ambient;");
kernel.appendScript(" ");
kernel.appendScript("  forall(lights,(");
kernel.appendScript("      shade=-sin(nn*#_1);");
kernel.appendScript("      if(nn*#_1>0,shade=0);");
kernel.appendScript("      rgb=rgb+#_2*shade;");
kernel.appendScript("    )");
kernel.appendScript("  );");
kernel.appendScript("  pp=apply(pp,(#_1/#_4,#_2/#_4));");
kernel.appendScript("  aa=pol_1;bb=pol_2,cc=pol_3;");
kernel.appendScript("  drawpoly(pp,color->(rgb_1*col_1,rgb_2*col_2,rgb_3*col_3),alpha->0.7);");
kernel.appendScript("");
kernel.appendScript("connect(pp++[pp_1],color->(0,0,0),size->2);");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("rot(m,v):=apply(v,m*#);");
kernel.appendScript("");
kernel.appendScript("renderPoly(pol):=(");
kernel.appendScript(" // repeat(length(pol),i,");
kernel.appendScript("//  renderPoint(pol_i));");
kernel.appendScript("  aa=maty*(matx*pol_1);");
kernel.appendScript("  bb=maty*(matx*pol_2);");
kernel.appendScript("  cc=maty*(matx*pol_3);");
kernel.appendScript("  aaa=(aa_1/aa_4,aa_2/aa_4);");
kernel.appendScript("  bbb=(bb_1/bb_4,bb_2/bb_4);");
kernel.appendScript("  ccc=(cc_1/cc_4,cc_2/cc_4);");
kernel.appendScript("  if(area(aaa,bbb,ccc)<0,linesize(3);linecolor((0,0,0)),linesize(1);linecolor((0.3,0.3,0.3)));");
kernel.appendScript("  repeat(length(pol)-1,i,");
kernel.appendScript("  renderLine(pol_i,pol_(i+1)));");
kernel.appendScript("  renderLine(pol_1,pol_length(pol));");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("renderPolyShade(pol,col):=(");
kernel.appendScript(" // repeat(length(pol),i,");
kernel.appendScript("//  renderPoint(pol_i));");
kernel.appendScript("  aa=maty*(matx*pol_1);");
kernel.appendScript("  bb=maty*(matx*pol_2);");
kernel.appendScript("  cc=maty*(matx*pol_3);");
kernel.appendScript("  aaa=(aa_1/aa_4,aa_2/aa_4);");
kernel.appendScript("  bbb=(bb_1/bb_4,bb_2/bb_4);");
kernel.appendScript("  ccc=(cc_1/cc_4,cc_2/cc_4);");
kernel.appendScript("  linecolor((0,0,0));");
kernel.appendScript("  if(area(aaa,bbb,ccc)<0,(");
kernel.appendScript("    linesize(1);");
kernel.appendScript("    renderPolygon(pol,col);");
kernel.appendScript("    repeat(length(pol)-1,i,");
kernel.appendScript("    renderLine(pol_i,pol_(i+1)));");
kernel.appendScript("    renderLine(pol_1,pol_length(pol));");
kernel.appendScript("    )");
kernel.appendScript("  );");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.setCompiler("de.cinderella.geometry.formula.CindyScriptCompiler");
kernel.endScript();
//Start portinfo
kernel.setBackgroundColor(0,0,0);
kernel.setBlackColor(0,0,0);
kernel.setHighlightColor(255,255,255);
port EuclideanPort() {
   setAttribute("imagescalemode","scalemode.center");
   setAttribute("imagealpha","0.5");
   setAttribute("image.filename","");
   setAttribute("show.adjacencymatrix","1");
   setAttribute("show.vertexqueue","");
   setAttribute("mesh.rectangular","true");
   setAttribute("mesh.triangular","false");
   setAttribute("axes.show","true");
   setAttribute("snap","true");
   setAttribute("mesh.density","0");
   setPolar(false);
   setPortWidth(630);
   setPortHeight(350);
   setScale(25.0);
   setOriginY(232);
   setOriginX(182);
   setMesh(true);
   setAxes(true);
   setSnap(true);
}
//End portinfo
