Subversion Repositories wimsdev

Rev

Rev 18401 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18401 Rev 18542
Line 36... Line 36...
36
\
36
\
37
\\ Sous l'hypothese 1/p+1/q+1/r=1\
37
\\ Sous l'hypothese 1/p+1/q+1/r=1\
38
\\ imprime le source tikz d'un pavage d'une partie\
38
\\ imprime le source tikz d'un pavage d'une partie\
39
\\ du plan avec des triangles d'angles Pi/p, etc.\
39
\\ du plan avec des triangles d'angles Pi/p, etc.\
40
aff3(p,q,r,limite)={\
40
aff3(p,q,r,limite)={\
41
  my(g,t=matrix(3,3),u,v,acc,cb=cox_base([1,p,q;p,1,r;q,r,1]),\
41
  my(g,t=matrix(3,3),u,v,acc,cb=cox_base([1,p/2,q/2;p/2,1,r/2;q/2,r/2,1]),\
42
  sh=Set(),cr=Set(matid(3)),tmp,h,res,xmin,xmax,ymin,ymax,xm,ym);\
42
  sh=Set(),cr=Set(matid(3)),tmp,h,res,xmin,xmax,ymin,ymax,xm,ym);\
43
  for(i=1,3,\
43
  for(i=1,3,\
44
    g=subst(cb[i]*cb[1+(i%3)],x,racine);\
44
    g=subst(cb[i]*cb[1+(i%3)],x,racine);\
45
    \\point fixe de g, moyenne des iteres : intersection de la droite de points fixes, puis z=1\
45
    \\point fixe de g, moyenne des iteres : intersection de la droite de points fixes, puis z=1\
46
    u=if(i==1,p,if(i==2,r,q));\
46
    u=if(i==1,p/2,if(i==2,r/2,q/2));\
47
    v=[0,0,1];\
47
    v=[0,0,1];\
48
    acc=vector(3);\
48
    acc=vector(3);\
49
    for(i=1,u,acc+=v;v=v*g);\
49
    for(i=1,u,acc+=v;v=v*g);\
50
    t[i,]=acc/u);\
50
    t[i,]=acc/u);\
51
  \\printf("p: %d, q: %d, r: %d\n",p, q, r);\
51
  \\printf("p: %d, q: %d, r: %d\n",p, q, r);\
52
  res=matrix(0,7);\
52
  res=matrix(0,7);\
53
  \\printf("\\begin{tikzpicture}[scale=%.3f]\n",7/limite);\
53
  \\printf("\\begin{tikzpicture}[scale=%.3f]\n",7/limite);\
54
  for(i=1,limite, tmp=longer(sh,cr,cb); sh=cr; cr=tmp;\
54
  for(i=1,limite, tmp=longer(sh,cr,cb); sh=cr; cr=tmp;\
55
    foreach(sh,g,h=t*subst(g,x,racine)*[1,0;cos(Pi/p),sin(Pi/p);0,0];\
55
    foreach(sh,g,h=t*subst(g,x,racine)*[1,0;cos(2*Pi/p),sin(2*Pi/p);0,0];\
56
      \\printf("\\%s(%.4f,%.4f)--(%.4f,%.4f)--(%.4f,%.4f)--cycle;\n",\
56
      \\printf("\\%s(%.4f,%.4f)--(%.4f,%.4f)--(%.4f,%.4f)--cycle;\n",\
57
        \\if(i%2,"fill","draw"),h[1,1],h[1,2],h[2,1],h[2,2],h[3,1],h[3,2]);\
57
        \\if(i%2,"fill","draw"),h[1,1],h[1,2],h[2,1],h[2,2],h[3,1],h[3,2]);\
58
        res=matconcat([res,[h[1,1],h[1,2],h[2,1],h[2,2],h[3,1],h[3,2],i%2]]~)\
58
        res=matconcat([res,[h[1,1],h[1,2],h[2,1],h[2,2],h[3,1],h[3,2],i%2]]~)\
59
	));\
59
	));\
60
  \\print("\\end{tikzpicture}\n");\
60
  \\print("\\end{tikzpicture}\n");\
Line 66... Line 66...
66
  [[xmin,xmax,ymin,ymax],res];\
66
  [[xmin,xmax,ymin,ymax],res];\
67
};\
67
};\
68
/*\
68
/*\
69
\p3\
69
\p3\
70
print("\nAffines\n");\
70
print("\nAffines\n");\
71
aff3(2,4,4,20);\
71
aff3(4,8,8,20);\
72
aff3(3,3,3,20);\
72
aff3(6,6,6,20);\
73
aff3(2,3,6,20);\
73
aff3(4,6,12,20);\
74
*/\
74
*/\
75
\
75
\