Skip to Content

TD 06 : Graphisme avec Maple


TD 6.1

Corrigé TD 6.1

Écrire une procédure polygone_regulier ( n:: posint) permettant de représenter un polygône

régulier à n côtés, de centre (0,0) et de rayon 1:

> polygone_regulier(8);

[Maple Plot]

 


TD 6.2

Corrigé TD 6.2

1° Paramétrer en coordonnées sphériques une sphère de centre (x,y,z) de rayon R en créant

une fonction sphere des 4 variables x,y,z,R .

 

2° Représenter sur un même graphique les sphères S[1], S[2], S[3] de centres respectifs (3,0,0) ,

(0,3,0) et (0,0,0) et de rayons respectifs 2,2,1.

 


 

Corrigé du Travail dirigé 6:

TD 6.1

Énoncé TD 6.1

Le polygône régulier à n côtés inscrit dans (C), le cercle de centre O de rayon 1,

a des sommets dont les coordonnées sont:
x[k] = cos(k*2*Pi/n) , y[k] = sin(k*2*Pi/n)

 

> polygone_regulier:=proc(n::posint)
        local Pn,k,x,y;
        for k from 0 to n do
            x[k]:=evalf(cos(k*2*Pi/n)):y[k]:=evalf(sin(k*2*Pi/n))
        end do;
         plot([seq([x[k],y[k]],k=0..n)],color=black,scaling=constrained,axes=normal);
    end proc;

polygone_regulier := proc (n::posint) local Pn, k, ...
polygone_regulier := proc (n::posint) local Pn, k, ...
polygone_regulier := proc (n::posint) local Pn, k, ...
polygone_regulier := proc (n::posint) local Pn, k, ...
polygone_regulier := proc (n::posint) local Pn, k, ...

 

> polygone_regulier(8);

[Maple Plot]

 


 

TD 6.2

Énoncé TD 6.2

> sphere:=(x,y,z,R)->[x+R*cos(phi)*cos(theta),y+R*cos(phi)*sin(theta),z+R*sin(phi)];

sphere := proc (x, y, z, R) options operator, arrow...

 

> with(plots);

[animate, animate3d, animatecurve, arrow, changecoo...
[animate, animate3d, animatecurve, arrow, changecoo...
[animate, animate3d, animatecurve, arrow, changecoo...
[animate, animate3d, animatecurve, arrow, changecoo...
[animate, animate3d, animatecurve, arrow, changecoo...
[animate, animate3d, animatecurve, arrow, changecoo...

 

> S1:=plot3d(sphere(3,0,0,2),phi=-Pi/2..Pi/2,theta=0..2*Pi):

> S2:=plot3d(sphere(0,3,0,2),phi=-Pi/2..Pi/2,theta=0..2*Pi):

> S3:=plot3d(sphere(0,0,0,1),phi=-Pi/2..Pi/2,theta=0..2*Pi):

 

> display3d({S1,S2,S3},scaling=constrained,axes=NORMAL);

[Maple Plot]
 

 

 


haut de cette page



MicroMaths - Abderrahim Bourguig - Tous droits réservés