//Cindy-2.0-beta build 567 (2005/12/02 14:43)
//Created on: Dec 2, 2005 6:37:52 PM
//For: richter
//DO NOT EDIT --- MACHINE GENERATED CODE
Geometry:=Euclidean;
("A"):=FreePoint([4.0+i*0.0,-1.8666666666666667+i*0.0,0.26666666666666666+i*0.0]);
"A".setAppearance(2,5,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","5");
"A".setAttribute("pointborder","true");
"A".setLabelPos(3,3,1,false,0.0,0.2,1);
("B"):=FreePoint([4.0+i*0.0,-1.0909090909090908+i*0.0,0.36363636363636365+i*0.0]);
"B".setAppearance(2,5,1,0,0,9,false,false);
"B".setAttribute("color","2");
"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","5");
"B".setAttribute("pointborder","true");
"B".setLabelPos(3,3,1,false,0.0,0.2,1);
("C"):=FreePoint([4.0+i*0.0,0.21052631578947367+i*-0.0,0.21052631578947367+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);
("Poly0"):=Poly("A","B","C");
"Poly0".setAppearance(1,5,1,0,0,2,false,false);
"Poly0".setColorFill(18);
"Poly0".setVisibilityFill(2);
"Poly0".setAttribute("color","1");
"Poly0".setAttribute("visibility","2");
"Poly0".setAttribute("drawtrace","false");
"Poly0".setAttribute("tracelength","100");
"Poly0".setAttribute("traceskip","1");
"Poly0".setAttribute("tracedim","1.0");
"Poly0".setAttribute("render","false");
"Poly0".setAttribute("linesize","1");
"Poly0".setAttribute("colorfill","18");
"Poly0".setAttribute("visibilityfill","2");
"Poly0".setAttribute("linkvisibility","false");
("a"):=Segment("A","B");
"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);
("b"):=Segment("B","C");
"b".setAppearance(3,5,1,0,0,9,false,false);
"b".setArrowType(0,3,100,8);
"b".setAttribute("color","3");
"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("labeled","false");
"b".setAttribute("linesize","1");
"b".setAttribute("overlap","0");
"b".setAttribute("clipline","0");
"b".setAttribute("linedashing","false");
"b".setAttribute("lineborder","false");
"b".setLabelPos(3,3,1,false,0.0,0.2,1);
"b".setArrowType(0,3,100,8);
("c"):=Segment("C","A");
"c".setAppearance(3,5,1,0,0,9,false,false);
"c".setArrowType(0,3,100,8);
"c".setAttribute("color","3");
"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("labeled","false");
"c".setAttribute("linesize","1");
"c".setAttribute("overlap","0");
"c".setAttribute("clipline","0");
"c".setAttribute("linedashing","false");
"c".setAttribute("lineborder","false");
"c".setLabelPos(3,3,1,false,0.0,0.2,1);
"c".setArrowType(0,3,100,8);
("Text0"):=Text("A");
"Text0".setAppearance(1,5,1,0,0,9,true,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","5");
"Text0".setAttribute("visibilityfill","0");
"Text0".setAttribute("linkvisibility","false");
"Text0".setText("@$\"A\"");
"Text0".setDocking(1,0.5,10.0,-10.0,"A");
("Text1"):=Text("B");
"Text1".setAppearance(1,5,1,0,0,9,true,false);
"Text1".setAttribute("color","1");
"Text1".setAttribute("visibility","9");
"Text1".setAttribute("drawtrace","false");
"Text1".setAttribute("tracelength","100");
"Text1".setAttribute("traceskip","1");
"Text1".setAttribute("tracedim","1.0");
"Text1".setAttribute("render","false");
"Text1".setAttribute("linesize","1");
"Text1".setAttribute("colorfill","5");
"Text1".setAttribute("visibilityfill","0");
"Text1".setAttribute("linkvisibility","false");
"Text1".setText("@$\"B\"");
"Text1".setDocking(1,0.5,10.0,-10.0,"B");
("Text2"):=Text("C");
"Text2".setAppearance(1,5,1,0,0,9,true,false);
"Text2".setAttribute("color","1");
"Text2".setAttribute("visibility","9");
"Text2".setAttribute("drawtrace","false");
"Text2".setAttribute("tracelength","100");
"Text2".setAttribute("traceskip","1");
"Text2".setAttribute("tracedim","1.0");
"Text2".setAttribute("render","false");
"Text2".setAttribute("linesize","1");
"Text2".setAttribute("colorfill","5");
"Text2".setAttribute("visibilityfill","0");
"Text2".setAttribute("linkvisibility","false");
"Text2".setText("@$\"C\"");
"Text2".setDocking(1,0.5,10.0,-10.0,"C");
Geometry:=Euclidean;
behavior {Environment();
          setParams(0.2,0.0,0.1);
          addToLevel(1);
         }
behavior {Motor();
          setParams(1.0,0.02,0.0);
          addToLevel(1);
         }
kernel.setAcc(1);
kernel.setFrames(1);
kernel.setSpeed(1.0);
kernel.newScript("Draw","draw");
kernel.appendScript("eps=0.00000001;");
kernel.appendScript("sign(x):=if(x<-eps,-1,if(x>eps,1,0));");
kernel.appendScript("A.xy=round(A);");
kernel.appendScript("B.xy=round(B);");
kernel.appendScript("C.xy=round(C);");
kernel.appendScript("");
kernel.appendScript("showp(v):=(");
kernel.appendScript("pointcolor([0,1,0]);");
kernel.appendScript("pointsize(3);");
kernel.appendScript("sgs=apply([area(A,B,v),area(B,C,v),area(C,A,v)],");
kernel.appendScript("          sign(#));");
kernel.appendScript("if(length(select(sgs,#==-1))==0,");
kernel.appendScript("  if(length(select(sgs,#==0))!=0,");
kernel.appendScript("      (draw(v,color->[1,1,0],size->5);");
kernel.appendScript("       r=r+1),");
kernel.appendScript("   (draw(v);");
kernel.appendScript("    t=t+1))");
kernel.appendScript("  )");
kernel.appendScript(");");
kernel.appendScript("textsize(16);");
kernel.appendScript("r=0;");
kernel.appendScript("t=0;");
kernel.appendScript("xs=[A.x,B.x,C.x];");
kernel.appendScript("ys=[A.y,B.y,C.y];");
kernel.appendScript("lu=floor([min(xs),min(ys)]);");
kernel.appendScript("ro=ceil([max(xs),max(ys)]);");
kernel.appendScript("");
kernel.appendScript("is=lu.x..ro.x;");
kernel.appendScript("js=lu.y..ro.y;");
kernel.appendScript("forall(is,i,");
kernel.appendScript("  forall(js,j,");
kernel.appendScript("    showp([i,j])");
kernel.appendScript("  )");
kernel.appendScript(");");
kernel.appendScript("drawtext([0,7],\"The area of a polygon\");");
kernel.appendScript("drawtext([0,6],\"with integer vertices equals\");");
kernel.appendScript("drawtext([0,5],\"#innerpts+#boundarypts/2-1\",color->(0,0.4,0));");
kernel.appendScript("drawtext([0,1],t+\" inner point\"+if(t==1,\"\",\"s\"));");
kernel.appendScript("drawtext([0,0],r+\" boundary point\"+if(r==1,\"\",\"s\"));");
kernel.appendScript("drawtext([0,-1],\"area is \"+area(A,B,C)+");
kernel.appendScript("                \" this is \"+t+\" + \"+r+\"/2 - \"+1);");
kernel.appendScript("");
kernel.appendScript("textsize(24);");
kernel.appendScript("drawtext([0,8],\"Pick's Theorem\",color->[0.8,0,0]);");
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","true");
   setAttribute("mesh.triangular","false");
   setAttribute("axes.show","false");
   setAttribute("snap","false");
   setAttribute("mesh.density","0");
   setPolar(false);
   setPortWidth(630);
   setPortHeight(350);
   setScale(25.0);
   setOriginY(60);
   setOriginX(253);
   setMesh(true);
   setAxes(false);
   setSnap(false);
}
//End portinfo
