romanticide
Inscrit le: 13 Mar 2005 Messages: 47
|
Posté le: 15 Mai 2005 10:10 Sujet du message: probléme d'affichage |
|
|
bonjour
j'ai résolu mes problème de point singulier pour la cardioide
mais quand je compile il m'affiche la liste des points qu'il va tracer or je n'en vuex pas j'ai essayer de mettre : et même rien après Listx dans la procédure Rectcourb2 mais il les affiche quands même
voici le code
[code]> Singulier2:=proc(Expr,Int,nbpoints,epsilon)
> local a,b,g1,g2,d1,d2,x,y,List,i;
> g1:=op(1,Expr);g2:=op(2,Expr);
> d1:=diff(g1,t);d2:=diff(g2,t);
> a:=evalf(op(1,Int));b:=evalf(op(2,Int));
> List:=[];
> for i from a to b by (b-a)/nbpoints do
> x:=evalf(subs(t=i,d1));
> y:=evalf(subs(t=i,d2));
> if abs(x^2+y^2)<epsilon then List:=true;
> fi;
> od;
> List;
> end:
> Rectcourb2:=proc(Expr,Int,n)
> local a,b,g1,g2,h0,x,Listx,i,Go,Cc,h,d;
> a:=evalf(op(1,Int));b:=evalf(op(2,Int));
> g1:=op(1,Expr);g2:=op(2,Expr);
> Listx:=[[subs(t=a,op(1,Expr)),subs(t=a,op(2,Expr))]];
> h0:=evalf((b-a)/n);
> x:=a;
> i:=0;
> Go:=true;
> while Go do
> i:=i+1;
> if Singulier2(Expr,Int,100,10^(-5)) then x:=x+h0;
> fi;
> d:=Courbure(w,x);
> Cc:=abs(d);
> if Cc<1 then h:=h0;
> else h:=h0/Cc;
> fi;
> x:=evalf(x+h);
> Listx:=[op(Listx),[subs(t=x,op(1,Expr)),subs(t=x,op(2,Expr))]];
> Go:=evalb(x<b+h0);
> od;
> Listx;
> end:
> Singulier2(w,Intdef,100,10^(-5));
true
> Rectcourb2(w,Intdef,70);
> print(`Discrétisation et courbure :`);
> print(` `);
> Ligne:=plot(Rectcourb2(w,Intdef,70),color=green,style=line):
> Point:=plot(Rectcourb2(w,Intdef,70),color=red,style=point):
> display({Ligne,Point});
> print(` `);
[/code]
merci |
|