//Cindy-2.0-beta build 569 (2005/12/04 08:54)
//Created on: Dec 5, 2005 11:19:50 PM
//For: richter
//DO NOT EDIT --- MACHINE GENERATED CODE
Geometry:=Euclidean;
("C"):=FreePoint([4.0+i*0.0,-0.558139534883721+i*0.0,1.1627906976744187+i*0.0]);
"C".setAppearance(2,4,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","4");
"C".setAttribute("pointborder","true");
"C".setLabelPos(3,3,1,false,0.0,0.2,1);
("E"):=FreePoint([-1.4516129032258065+i*-0.0,4.0+i*0.0,-0.8064516129032258+i*-0.0]);
"E".setAppearance(2,4,1,0,0,9,false,false);
"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","false");
"E".setAttribute("labeled","false");
"E".setAttribute("ptsize","4");
"E".setAttribute("pointborder","true");
"E".setLabelPos(3,3,1,false,0.0,0.2,1);
("G"):=FreePoint([2.168224299065421+i*0.0,4.0+i*0.0,-0.9345794392523364+i*-0.0]);
"G".setAppearance(2,4,1,0,0,9,false,false);
"G".setAttribute("color","2");
"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","4");
"G".setAttribute("pointborder","true");
"G".setLabelPos(3,3,1,false,0.0,0.2,1);
("M"):=FreePoint([0.5806451612903225+i*0.0,4.0+i*0.0,1.6129032258064515+i*0.0]);
"M".setAppearance(2,4,1,0,0,9,false,false);
"M".setAttribute("color","2");
"M".setAttribute("visibility","9");
"M".setAttribute("drawtrace","false");
"M".setAttribute("tracelength","100");
"M".setAttribute("traceskip","1");
"M".setAttribute("tracedim","1.0");
"M".setAttribute("render","false");
"M".setAttribute("pinning","false");
"M".setAttribute("labeled","false");
"M".setAttribute("ptsize","4");
"M".setAttribute("pointborder","true");
"M".setLabelPos(3,3,1,false,0.0,0.2,1);
("R"):=FreePoint([-2.0+i*-0.0,4.0+i*0.0,-1.8518518518518519+i*-0.0]);
"R".setAppearance(2,4,1,0,0,9,false,false);
"R".setAttribute("color","2");
"R".setAttribute("visibility","9");
"R".setAttribute("drawtrace","false");
"R".setAttribute("tracelength","100");
"R".setAttribute("traceskip","1");
"R".setAttribute("tracedim","1.0");
"R".setAttribute("render","false");
"R".setAttribute("pinning","false");
"R".setAttribute("labeled","false");
"R".setAttribute("ptsize","4");
"R".setAttribute("pointborder","true");
"R".setLabelPos(3,3,1,false,0.0,0.2,1);
("T"):=FreePoint([4.0+i*0.0,-2.0821917808219177+i*0.0,0.45662100456621+i*0.0]);
"T".setAppearance(2,4,1,0,0,9,false,false);
"T".setAttribute("color","2");
"T".setAttribute("visibility","9");
"T".setAttribute("drawtrace","false");
"T".setAttribute("tracelength","100");
"T".setAttribute("traceskip","1");
"T".setAttribute("tracedim","1.0");
"T".setAttribute("render","false");
"T".setAttribute("pinning","false");
"T".setAttribute("labeled","false");
"T".setAttribute("ptsize","4");
"T".setAttribute("pointborder","true");
"T".setLabelPos(3,3,1,false,0.0,0.2,1);
("X"):=FreePoint([-1.2968036529680365+i*-0.0,4.0+i*0.0,-0.45662100456621+i*-0.0]);
"X".setAppearance(2,4,1,0,0,9,false,false);
"X".setAttribute("color","2");
"X".setAttribute("visibility","9");
"X".setAttribute("drawtrace","false");
"X".setAttribute("tracelength","100");
"X".setAttribute("traceskip","1");
"X".setAttribute("tracedim","1.0");
"X".setAttribute("render","false");
"X".setAttribute("pinning","false");
"X".setAttribute("labeled","false");
"X".setAttribute("ptsize","4");
"X".setAttribute("pointborder","true");
"X".setLabelPos(3,3,1,false,0.0,0.2,1);
("F"):=FreePoint([4.0+i*0.0,-3.969230769230769+i*0.0,0.7692307692307692+i*0.0]);
"F".setAppearance(2,4,1,0,0,9,false,false);
"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","false");
"F".setAttribute("labeled","false");
"F".setAttribute("ptsize","4");
"F".setAttribute("pointborder","true");
"F".setLabelPos(3,3,1,false,0.0,0.2,1);
("H"):=FreePoint([4.0+i*0.0,-1.46583850931677+i*0.0,0.6211180124223602+i*0.0]);
"H".setAppearance(2,4,1,0,0,9,false,false);
"H".setAttribute("color","2");
"H".setAttribute("visibility","9");
"H".setAttribute("drawtrace","false");
"H".setAttribute("tracelength","100");
"H".setAttribute("traceskip","1");
"H".setAttribute("tracedim","1.0");
"H".setAttribute("render","false");
"H".setAttribute("pinning","false");
"H".setAttribute("labeled","false");
"H".setAttribute("ptsize","4");
"H".setAttribute("pointborder","true");
"H".setLabelPos(3,3,1,false,0.0,0.2,1);
("K"):=FreePoint([4.0+i*0.0,-3.8554216867469884+i*0.0,1.2048192771084338+i*0.0]);
"K".setAppearance(2,4,1,0,0,9,false,false);
"K".setAttribute("color","2");
"K".setAttribute("visibility","9");
"K".setAttribute("drawtrace","false");
"K".setAttribute("tracelength","100");
"K".setAttribute("traceskip","1");
"K".setAttribute("tracedim","1.0");
"K".setAttribute("render","false");
"K".setAttribute("pinning","false");
"K".setAttribute("labeled","false");
"K".setAttribute("ptsize","4");
"K".setAttribute("pointborder","true");
"K".setLabelPos(3,3,1,false,0.0,0.2,1);
("A"):=FreePoint([4.0+i*0.0,1.1724137931034482+i*0.0,0.5747126436781609+i*0.0]);
"A".setAppearance(2,4,1,0,0,9,false,false);
"A".setAttribute("color","2");
"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","4");
"A".setAttribute("pointborder","true");
"A".setLabelPos(3,3,1,false,0.0,0.2,1);
("Text0"):=Text();
"Text0".setAppearance(1,5,1,0,0,9,false,false);
"Text0".setAttribute("color","1");
"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 red points");
"Text0".setDocking(2,0.5,10.0,20.0,null);
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","draw");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("if(oldmover!=mover(),(");
kernel.appendScript("  pts=allpoints()--[mover()];");
kernel.appendScript("  ptsr=reverse(pts);");
kernel.appendScript("  segs=pairs(pts);");
kernel.appendScript("  segsr=pairs(ptsr);");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("  hull=concat(select(segs,extrem(#,pts)),select(segsr,extrem(#,pts)));");
kernel.appendScript("");
kernel.appendScript("  deloneys=[[pts_1,pts_2,pts_3]];");
kernel.appendScript("  deloneysext=[[pts_1,pts_2,pts_3]];");
kernel.appendScript("  ptlist=[pts_1,pts_2,pts_3];");
kernel.appendScript("  n=length(pts)-3;");
kernel.appendScript("  repeat(n,(");
kernel.appendScript("     inspt=pts_(#+3);");
kernel.appendScript("     violates=select(deloneys,incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("     violatesext=select(deloneysext,!incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("     violatepts=[inspt];");
kernel.appendScript("     forall(violates,violatepts=set(violatepts++#));");
kernel.appendScript("     forall(violatesext,violatepts=set(violatepts++#));");
kernel.appendScript("     final=deloneys--violates;");
kernel.appendScript("     finalext=deloneysext--violatesext;");
kernel.appendScript("     triang=triples(violatepts);");
kernel.appendScript("     add1=select(triang,empty(#,violatepts));");
kernel.appendScript("     add2=select(add1,contains(#,inspt));");
kernel.appendScript("     extadd1=select(triang,full(#,violatepts));");
kernel.appendScript("     extadd2=select(extadd1,contains(#,inspt));");
kernel.appendScript("     deloneys=final++add2;");
kernel.appendScript("     deloneysext=finalext++extadd2;");
kernel.appendScript("  ));");
kernel.appendScript("  oldmover=mover(); ");
kernel.appendScript("));");
kernel.appendScript("");
kernel.appendScript("    pts=allpoints();");
kernel.appendScript("    ptsr=reverse(pts);");
kernel.appendScript("    mates=apply(pts--[oldmover],[oldmover,#]);");
kernel.appendScript("    matesr=apply(pts--[oldmover],[#,oldmover]);");
kernel.appendScript("");
kernel.appendScript("    hulld=concat(select(hull++mates++matesr,extrem(#,pts)),[]);");
kernel.appendScript("    inspt=mover();");
kernel.appendScript("   ");
kernel.appendScript("   violates=select(deloneys,incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("   violatesext=select(deloneysext,!incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("   violatepts=[inspt];");
kernel.appendScript("   forall(violates,violatepts=set(violatepts++#));");
kernel.appendScript("   forall(violatesext,violatepts=set(violatepts++#));");
kernel.appendScript("   final=deloneys--violates;");
kernel.appendScript("   triang=triples(violatepts);");
kernel.appendScript("   add1=select(triang,empty(#,violatepts));");
kernel.appendScript("   add2=select(add1,contains(#,inspt));");
kernel.appendScript("   deloneysd=final++add2;");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("dp=pairs(deloneysd);");
kernel.appendScript("dp1=select(dp,length(common(#_1,#_2))==2);");
kernel.appendScript("");
kernel.appendScript("rays=apply(hulld,ss=#;(select(deloneysd,length(common(ss,#))==2)));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("linecolor((1,1,0));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("nn=length(hulld);");
kernel.appendScript("repeat(nn,i,");
kernel.appendScript("pp=(perp(hulld_i_1-hulld_i_2));");
kernel.appendScript("pp=pp/abs(pp)*100;");
kernel.appendScript("mm=(circctr(rays_i_1));");
kernel.appendScript("mm=(mm.x,mm.y)/mm.z;");
kernel.appendScript("draw(size->2,mm,mm-pp)");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("linecolor((0,0,1));");
kernel.appendScript("");
kernel.appendScript("forall(hulld,draw(#_1,#_2));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("linecolor((1,1,1));");
kernel.appendScript("");
kernel.appendScript("forall(dp1,e=common(#_1,#_2);draw(e_1,e_2));");
kernel.appendScript("");
kernel.appendScript("linecolor((1,1,0));");
kernel.appendScript("");
kernel.appendScript("forall(dp1,draw(size->2,circctr(#_1),circctr(#_2)));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.setCompiler("de.cinderella.geometry.formula.CindyScriptCompiler");
kernel.endScript();
kernel.newScript("Init","");
kernel.appendScript("incircle(a,b,c,d):=(");
kernel.appendScript("  da=(a.x,a.y,abs(a)^2);");
kernel.appendScript("  db=(b.x,b.y,abs(b)^2);");
kernel.appendScript("  dc=(c.x,c.y,abs(c)^2);");
kernel.appendScript("  dd=(d.x,d.y,abs(d)^2);");
kernel.appendScript("  ( det(da,db,dc)");
kernel.appendScript("   -det(da,db,dd)");
kernel.appendScript("   +det(da,dc,dd)");
kernel.appendScript("   -det(db,dc,dd))");
kernel.appendScript("*det((a.x,a.y,1),(b.x,b.y,1),(c.x,c.y,1))>0.000001");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("empty(trg,pset):=(length(select(pset,");
kernel.appendScript("   incircle(trg_1,trg_2,trg_3,#)))==0");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("full(trg,pset):=(length(select(pset,");
kernel.appendScript("   incircle(trg_1,trg_2,trg_3,#)))==length(pset)-3;");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("leftfrom(seg,ptlist):=select(ptlist,area(#,seg_1,seg_2)>=0.00001);");
kernel.appendScript("");
kernel.appendScript("extrem(seg,ptlist):=(length( leftfrom(seg,ptlist))==0);");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("circctr(x):=circctr(x_1,x_2,x_3);");
kernel.appendScript("");
kernel.appendScript("mid(a,b):=(a+b)/2;");
kernel.appendScript("");
kernel.appendScript("circctr(a,b,c):=cross(perp(cross(a,b),mid(a,b)),");
kernel.appendScript("                      perp(cross(a,c),mid(a,c)));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("  pts=allpoints()--[A];");
kernel.appendScript("  ptsr=reverse(pts);");
kernel.appendScript("  segs=pairs(pts);");
kernel.appendScript("  segsr=pairs(ptsr);");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("  hull=concat(select(segs,extrem(#,pts)),select(segsr,extrem(#,pts)));");
kernel.appendScript("");
kernel.appendScript("  deloneys=[[pts_1,pts_2,pts_3]];");
kernel.appendScript("  deloneysext=[[pts_1,pts_2,pts_3]];");
kernel.appendScript("  ptlist=[pts_1,pts_2,pts_3];");
kernel.appendScript("  n=length(pts)-3;");
kernel.appendScript("  repeat(n,(");
kernel.appendScript("     inspt=pts_(#+3);");
kernel.appendScript("     violates=select(deloneys,incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("     violatesext=select(deloneysext,!incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("     violatepts=[inspt];");
kernel.appendScript("     forall(violates,violatepts=set(violatepts++#));");
kernel.appendScript("     forall(violatesext,violatepts=set(violatepts++#));");
kernel.appendScript("     final=deloneys--violates;");
kernel.appendScript("     finalext=deloneysext--violatesext;");
kernel.appendScript("     triang=triples(violatepts);");
kernel.appendScript("     add1=select(triang,empty(#,violatepts));");
kernel.appendScript("     add2=select(add1,contains(#,inspt));");
kernel.appendScript("     extadd1=select(triang,full(#,violatepts));");
kernel.appendScript("     extadd2=select(extadd1,contains(#,inspt));");
kernel.appendScript("     deloneys=final++add2;");
kernel.appendScript("     deloneysext=finalext++extadd2;");
kernel.appendScript("  ));");
kernel.appendScript("  oldmover=A; ");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("    pts=allpoints();");
kernel.appendScript("    ptsr=reverse(pts);");
kernel.appendScript("    mates=apply(pts--[oldmover],[oldmover,#]);");
kernel.appendScript("    matesr=apply(pts--[oldmover],[#,oldmover]);");
kernel.appendScript("");
kernel.appendScript("    hulld=concat(select(hull++mates++matesr,extrem(#,pts)),[]);");
kernel.appendScript("    inspt=mover();");
kernel.appendScript("   ");
kernel.appendScript("   violates=select(deloneys,incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("   violatesext=select(deloneysext,!incircle(#_1,#_2,#_3,inspt));");
kernel.appendScript("   violatepts=[inspt];");
kernel.appendScript("   forall(violates,violatepts=set(violatepts++#));");
kernel.appendScript("   forall(violatesext,violatepts=set(violatepts++#));");
kernel.appendScript("   final=deloneys--violates;");
kernel.appendScript("   triang=triples(violatepts);");
kernel.appendScript("   add1=select(triang,empty(#,violatepts));");
kernel.appendScript("   add2=select(add1,contains(#,inspt));");
kernel.appendScript("   deloneysd=final++add2;");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("dp=pairs(deloneysd);");
kernel.appendScript("dp1=select(dp,length(common(#_1,#_2))==2);");
kernel.appendScript("");
kernel.appendScript("rays=apply(hulld,ss=#;(select(deloneysd,length(common(ss,#))==2)));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("linecolor((1,1,0));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("nn=length(hulld);");
kernel.appendScript("repeat(nn,i,");
kernel.appendScript("pp=(perp(hulld_i_1-hulld_i_2));");
kernel.appendScript("pp=pp/abs(pp)*100;");
kernel.appendScript("mm=(circctr(rays_i_1));");
kernel.appendScript("mm=(mm.x,mm.y)/mm.z;");
kernel.appendScript("draw(size->2,mm,mm-pp)");
kernel.appendScript(");");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("linecolor((0,0,1));");
kernel.appendScript("");
kernel.appendScript("forall(hulld,draw(#_1,#_2));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("linecolor((1,1,1));");
kernel.appendScript("");
kernel.appendScript("forall(dp1,e=common(#_1,#_2);draw(e_1,e_2));");
kernel.appendScript("");
kernel.appendScript("linecolor((1,1,0));");
kernel.appendScript("");
kernel.appendScript("forall(dp1,draw(size->2,circctr(#_1),circctr(#_2)));");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.appendScript("");
kernel.setCompiler("de.cinderella.geometry.formula.CindyScriptCompiler");
kernel.endScript();
//Start portinfo
kernel.setBackgroundColor(168,176,192);
kernel.setBlackColor(0,0,0);
kernel.setHighlightColor(255,255,255);
port EuclideanPort() {
   setAttribute("imagescalemode","Center");
   setAttribute("imagealpha","1.0");
   setAttribute("image.filename","");
   setAttribute("show.adjacencymatrix","1");
   setAttribute("show.vertexqueue","");
   setAttribute("mesh.rectangular","false");
   setAttribute("mesh.triangular","false");
   setAttribute("axes.show","false");
   setAttribute("snap","false");
   setAttribute("mesh.density","0");
   setPolar(false);
   setPortWidth(502);
   setPortHeight(394);
   setScale(25.0);
   setOriginY(150);
   setOriginX(274);
   setMesh(false);
   setAxes(false);
   setSnap(false);
}
//End portinfo
