Subversion Repositories wimsdev

Rev

Rev 18358 | Rev 18447 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18358 Rev 18432
Line 1965... Line 1965...
1965
      patchgdImageFillToBorder(image,qq[0],qq[1],pm->color[0],pm->color[0]);
1965
      patchgdImageFillToBorder(image,qq[0],qq[1],pm->color[0],pm->color[0]);
1966
      if(tikz_file) tikz_fill(qq[0],qq[1],1,1,0,pm->color[0],grid);
1966
      if(tikz_file) tikz_fill(qq[0],qq[1],1,1,0,pm->color[0],grid);
1967
    }
1967
    }
1968
}
1968
}
1969
 
1969
 
-
 
1970
/* polygon */
-
 
1971
void obj_hyppoly(objparm *pm)
-
 
1972
{
-
 
1973
  double rx,ry,data[1000],res[7];
-
 
1974
  int i,*qq=pm->p;
-
 
1975
  int cnt=(pm->pcnt)/2;
-
 
1976
  scale(pm->pd,pm->p,cnt);
-
 
1977
  for(i=0; i<pm->pcnt+2; i++) data[i]=pm->pd[i%pm->pcnt];
-
 
1978
  if (tikz_file) fprintf(tikz_file, "\\draw[%s]",tikz_options(pm->color[0],0));
-
 
1979
  for(i=0; i<cnt; i++){
-
 
1980
    if(hypgeodaux(data+2*i,res)){
-
 
1981
      scale2(res[2],res[2],&rx,&ry);
-
 
1982
      scale(res,qq,1);
-
 
1983
      myGdImageArc(image,qq[0],qq[1],rx,ry,res[3]/DEG,res[4]/DEG,pm->color[0]);
-
 
1984
      if(tikz_file)
-
 
1985
        fprintf(tikz_file, "(%i,%i) arc (%f:%f:%i and %i)",
-
 
1986
          (int)rint(qq[0]+rx*cos(res[3])),
-
 
1987
          flip((int)rint(qq[1]+ry*sin(res[3]))),
-
 
1988
          res[3]/DEG,res[4]/DEG,(int)rint(rx),-(int)rint(ry));
-
 
1989
    }
-
 
1990
    else {
-
 
1991
      scale(data+2*i,qq,2);
-
 
1992
      gdImageLine(image,qq[0],qq[1],qq[2],qq[3],pm->color[0]);
-
 
1993
      if(tikz_file) fprintf(tikz_file,"(%i,%i)--(%i,%i)",
-
 
1994
            qq[0],flip(qq[1]),qq[2],flip(qq[3]));
-
 
1995
    }
-
 
1996
  }
-
 
1997
  if(tikz_file) fprintf(tikz_file,";\n");
-
 
1998
  if(pm->fill){
-
 
1999
    data[0]=res[5];
-
 
2000
    data[1]=res[6];
-
 
2001
    hypgeodaux(data,res);
-
 
2002
    scale(res+5,qq,1);
-
 
2003
    //patchgdImageFill(image,qq[0],qq[1],pm->color[0]);
-
 
2004
    patchgdImageFillToBorder(image,qq[0],qq[1],pm->color[0],pm->color[0]);
-
 
2005
    if(tikz_file) tikz_fill(qq[0],qq[1],1,1,0,pm->color[0],grid);
-
 
2006
  }
-
 
2007
}
1970
/* complete hyperbolic geodesic through the two first points, then the following two points, etc */
2008
/* complete hyperbolic geodesic through the two first points, then the following two points, etc */
1971
 
2009
 
1972
void obj_hyplines(objparm *pm)
2010
void obj_hyplines(objparm *pm)
1973
{
2011
{
1974
  double rx,ry,res[7],*pd = pm->pd;
2012
  double rx,ry,res[7],*pd = pm->pd;