X-Git-Url: https://melusine.eu.org/syracuse/G/git/?p=mp-gdd.git;a=blobdiff_plain;f=exemples%2Fpolaires%2Fpol02.mp;fp=exemples%2Fpolaires%2Fpol02.mp;h=d75dd5bcc054e66c8f96dbbb21b5a5560edd3d37;hp=0000000000000000000000000000000000000000;hb=1f9d2f4036645554c46f92209d5b4d417c5fd678;hpb=2518cfffb2598c5733eedf4907b61bc31ab2bd86 diff --git a/exemples/polaires/pol02.mp b/exemples/polaires/pol02.mp new file mode 100644 index 0000000..d75dd5b --- /dev/null +++ b/exemples/polaires/pol02.mp @@ -0,0 +1,74 @@ +input gdd; +input gdd-rep; +input gdd-lbl; +input gdd-tra; +input svgnames; + +lblPreambule := "\usepackage[frenchb]{babel}" & + "\usepackage[garamond]{mathdesign}" & + "\usepackage{amsmath}"; + +input gdd-fct; +input gdd-plt; + +labeloffset := 6; +gddU:=1.2cm; + +vardef r(expr t) = 1+cos(t) enddef; + +vardef rp(expr t) = (r(t)*cos(t),r(t)*sin(t)) enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(10,10,2,5,3.5,3.5); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + + draw fullcircle shifted (0.5,0) gddEnPlace avecCrayon(1,Gold); + + nb = 80; + pas = 2Pi / nb; + for i=0 upto nb: + theta := i * pas; + draw (fullcircle scaled 2cos(theta) + shifted (cos(theta)*cos(theta),cos(theta)*sin(theta))) gddEnPlace; + endfor; + + + traceDoubleVecteur(rp(0),(0,0.3)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(Pi/3),(0.3,0)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(Pi/2),(0.2,0.2)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(2Pi/3),(0,0.3)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(-Pi/3),(0.3,0)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(-Pi/2),(0.2,-0.2)) avecCrayon(1,LightPink); + traceDoubleVecteur(rp(-2Pi/3),(0,0.3)) avecCrayon(1,LightPink); + + trace Vecteur(origine,(-0.3,0)) avecCrayon(1,LightPink); + trace CourbeEnPolaires(r,-Pi,Pi,100) avecCrayon(1.5,Indigo); + + pointe Point(0,0); + pointe Point(2,0); + pointe PairTOPoint(rp(Pi/3)); + pointe PairTOPoint(rp(-Pi/3)); + pointe PairTOPoint(rp(2Pi/3)); + pointe PairTOPoint(rp(-2Pi/3)); + pointe Point(0,1); + pointe Point(0,-1); + + label.urt(TEX("\(\mathcal{C}\)"),PtR(Point(1,0))) withcolor Magenta; + Fin; + + +endfig; + +end \ No newline at end of file