Subversion Repositories wimsdev

Rev

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

Rev 18317 Rev 18318
Line 653... Line 653...
653
}
653
}
654
/* hyperbolic geodesics from x1,y1 to x2,y2, x3,y3 to x4,y4 in Poincaré disk */
654
/* hyperbolic geodesics from x1,y1 to x2,y2, x3,y3 to x4,y4 in Poincaré disk */
655
 
655
 
656
void obj_hypgeods(objparm *pm)
656
void obj_hypgeods(objparm *pm)
657
{
657
{
658
 int i;
658
 int i, *qq = pm->p;
659
 for (i = 0; i < pm->pcnt; i+=4){
659
 for (i = 0; i < pm->pcnt; i+=4){
660
   double r, *q=pm->pd + i,
660
   double r, *q=pm->pd + i,
661
   nx = -q[0]*q[2]*q[2]+(q[0]*q[0]+q[1]*q[1]+1)*q[2]-q[0]*q[3]*q[3]-q[0],
661
   nx = -q[0]*q[2]*q[2]+(q[0]*q[0]+q[1]*q[1]+1)*q[2]-q[0]*q[3]*q[3]-q[0],
662
   ny = -q[1]*q[2]*q[2]-q[1]*q[3]*q[3]+(q[0]*q[0]+q[1]*q[1]+1)*q[3]-q[1],
662
   ny = -q[1]*q[2]*q[2]-q[1]*q[3]*q[3]+(q[0]*q[0]+q[1]*q[1]+1)*q[3]-q[1],
663
   dy = -2*q[1]*q[2]+2*q[0]*q[3];
663
   dy = -2*q[1]*q[2]+2*q[0]*q[3];
664
   if (dy*dy * 1e8 < nx*nx+ny*ny){
664
   if (dy*dy * 1e8 < nx*nx+ny*ny){
665
     int *qq = pm->p;
-
 
666
     scale(q,qq,2);
665
     scale(q,qq,2);
667
     gdImageLine(image,qq[0],qq[1],qq[2],qq[3],pm->color[0]);
666
     gdImageLine(image,qq[0],qq[1],qq[2],qq[3],pm->color[0]);
668
   }
667
   }
669
    else {
668
    else {
670
      double rx,ry;
669
      double rx,ry;
Line 740... Line 739...
740
 }
739
 }
741
 if(tikz_file) fprintf(tikz_file,";\n");
740
 if(tikz_file) fprintf(tikz_file,";\n");
742
}
741
}
743
 
742
 
744
/* arc */
743
/* arc */
745
 
-
 
746
/*trouble with gdImageArc as the angles are of type int */
744
/*trouble with gdImageArc as the angles are of type int */
747
void myGdImageArc(gdImagePtr im, int cx, int cy, int rx, int ry, double t1, double t2, int color)
745
void myGdImageArc(gdImagePtr im, int cx, int cy, int rx, int ry, double t1, double t2, int color)
748
{
746
{
749
  int i,nb;
747
  int i,nb;
750
  double dt, r=rx>ry?rx:ry;
748
  double dt, r=rx>ry?rx:ry;