Changeset b14053 in git
- Timestamp:
- Jul 9, 2009, 2:20:30 PM (14 years ago)
- Branches:
- (u'spielwiese', 'f6c3dc58b0df4bd712574325fe76d0626174ad97')
- Children:
- c6971ddc4d46c0a2cec7912a6de31e2a748146da
- Parents:
- 0a78c3b07600e6691a158387d392658721cf6619
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/tropical.lib
r0a78c3 rb14053 1 version="$Id: tropical.lib,v 1.1 7 2009-05-13 14:51:55keilen Exp $";1 version="$Id: tropical.lib,v 1.18 2009-07-09 12:20:30 keilen Exp $"; 2 2 category="Tropical Geometry"; 3 3 info=" … … 2660 2660 maxdiffy=1; 2661 2661 } 2662 int nachkomma=2; // number of decimals for the scalefactor 2663 number sf=1; // correction factor for scalefactor 2662 2664 if (size(#)!=2) 2663 2665 { 2664 2666 poly scalefactor=minOfPolys(list(12/leadcoef(maxdiffx),16/leadcoef(maxdiffy))); 2667 // if the scalefactor is less than 1/100, then we need more than 2 decimals 2668 if (leadcoef(scalefactor) < 1/100) 2669 { 2670 number scf=leadcoef(scalefactor); 2671 while (scf < 1/100) 2672 { 2673 scf=scf * 10; 2674 nachkomma++; 2675 } 2676 } 2677 // if the scalefactor is < 1/100, then we should rather scale the 2678 // coordinates directly, since otherwise texdraw gets into trouble 2679 if (nachkomma > 2) 2680 { 2681 for (i=3;i<=nachkomma;i++) 2682 { 2683 scalefactor=scalefactor * 10; 2684 sf=sf*10; 2685 } 2686 } 2665 2687 texdrawtp=texdrawtp+" 2666 \\relunitscale "+ decimal(scalefactor );2688 \\relunitscale "+ decimal(scalefactor,nachkomma); 2667 2689 } 2668 2690 else … … 2678 2700 { 2679 2701 texdrawtp=texdrawtp+" 2680 \\move ("+decimal( graph[i][1]-centerx)+" "+decimal(graph[i][2]-centery)+") \\fcir f:0 r:"+decimal(2/(leadcoef(scalefactor)*10),size(string(int(scalefactor)))+1);2702 \\move ("+decimal((graph[i][1]-centerx)/sf)+" "+decimal((graph[i][2]-centery)/sf)+") \\fcir f:0 r:"+decimal(2/(leadcoef(scalefactor)*10),size(string(int(scalefactor)))+1); 2681 2703 } 2682 2704 // draw the bounded edges emerging from the ith vertex … … 2688 2710 { 2689 2711 texdrawtp=texdrawtp+" 2690 \\move ("+decimal( graph[i][1]-centerx)+" "+decimal(graph[i][2]-centery)+") \\lvec ("+decimal(graph[graph[i][3][1,j]][1]-centerx)+" "+decimal(graph[graph[i][3][1,j]][2]-centery)+")";2712 \\move ("+decimal((graph[i][1]-centerx)/sf)+" "+decimal((graph[i][2]-centery)/sf)+") \\lvec ("+decimal((graph[graph[i][3][1,j]][1]-centerx)/sf)+" "+decimal((graph[graph[i][3][1,j]][2]-centery)/sf)+")"; 2691 2713 // if the multiplicity is more than one, denote it in the picture 2692 2714 if (graph[i][3][2,j]>1) 2693 2715 { 2694 2716 texdrawtp=texdrawtp+" 2695 \\htext ("+decimal((graph[i][1]-centerx+graph[graph[i][3][1,j]][1])/ 2)+" "+decimal((graph[i][2]-centery+graph[graph[i][3][1,j]][2])/2)+"){$"+string(graph[i][3][2,j])+"$}";2717 \\htext ("+decimal((graph[i][1]-centerx+graph[graph[i][3][1,j]][1])/(2*sf))+" "+decimal((graph[i][2]-centery+graph[graph[i][3][1,j]][2])/(2*sf))+"){$"+string(graph[i][3][2,j])+"$}"; 2696 2718 } 2697 2719 } … … 2701 2723 for (j=1;j<=size(graph[i][4]);j++) 2702 2724 { 2703 relxy=shorten(list(decimal( 3*graph[i][4][j][1][1]/scalefactor),decimal(3*graph[i][4][j][1][2]/scalefactor),"2.5"));2725 relxy=shorten(list(decimal((3*graph[i][4][j][1][1]/scalefactor)*sf),decimal((3*graph[i][4][j][1][2]/scalefactor)*sf),string(5*sf/2))); 2704 2726 texdrawtp=texdrawtp+" 2705 \\move ("+decimal( graph[i][1]-centerx)+" "+decimal(graph[i][2]-centery)+") \\rlvec ("+relxy[1]+" "+relxy[2]+")";2727 \\move ("+decimal((graph[i][1]-centerx)/sf)+" "+decimal((graph[i][2]-centery)/sf)+") \\rlvec ("+relxy[1]+" "+relxy[2]+")"; 2706 2728 // if the multiplicity is more than one, denote it in the picture 2707 2729 if (graph[i][4][j][2]>1) 2708 2730 { 2709 2731 texdrawtp=texdrawtp+" 2710 \\htext ("+decimal(graph[i][1] -centerx+graph[i][4][j][1][1]/scalefactor)+" "+decimal(graph[i][2]-centery+graph[i][4][j][1][2]/scalefactor)+"){$"+string(graph[i][4][j][2])+"$}";2732 \\htext ("+decimal(graph[i][1]/sf-centerx/sf+graph[i][4][j][1][1]/scalefactor)+" "+decimal(graph[i][2]/sf-centery/sf+graph[i][4][j][1][2]/scalefactor)+"){$"+string(graph[i][4][j][2])+"$}"; 2711 2733 } 2712 2734 }
Note: See TracChangeset
for help on using the changeset viewer.