From: Jean-Michel Sarlat Date: Tue, 13 Sep 2011 23:35:53 +0000 (+0200) Subject: Une nouvelle série d'exemples : des courbes paramétrées X-Git-Url: https://melusine.eu.org/syracuse/G/git/?a=commitdiff_plain;h=2518cfffb2598c5733eedf4907b61bc31ab2bd86;p=mp-gdd.git Une nouvelle série d'exemples : des courbes paramétrées --- diff --git a/exemples/courbes/LISTE.txt b/exemples/courbes/LISTE.txt new file mode 100644 index 0000000..ac8d409 --- /dev/null +++ b/exemples/courbes/LISTE.txt @@ -0,0 +1,26 @@ +cp01-1.png +cp02-1.png +cp03-1.png +cp04-1.png +cp05-1.png +cp06-1.png +cp07-1.png +cp08-1.png +== Les sources +cp01.mp +cp02.mp +cp03.mp +cp04.mp +cp05.mp +cp06.mp +cp07.mp +cp08.mp +== Les PDF +cp01-1.pdf +cp02-1.pdf +cp03-1.pdf +cp04-1.pdf +cp05-1.pdf +cp06-1.pdf +cp07-1.pdf +cp08-1.pdf diff --git a/exemples/courbes/Makefile b/exemples/courbes/Makefile new file mode 100644 index 0000000..97f2863 --- /dev/null +++ b/exemples/courbes/Makefile @@ -0,0 +1,14 @@ +MP = $(wildcard *.mp) +PDF = $(patsubst %.mp, %-1.pdf, $(MP)) + + +png: $(PDF) +$(PDF) : %-1.pdf : %.mp + ~/bin/mptopdf $< && wpdf -png -rs 50 $@ + +liste: + ls *.png > LISTE.txt + echo '== Les sources' >> LISTE.txt + ls *.mp >> LISTE.txt + echo '== Les PDF' >> LISTE.txt + ls *.pdf >> LISTE.txt \ No newline at end of file diff --git a/exemples/courbes/cp01-1.pdf b/exemples/courbes/cp01-1.pdf new file mode 100644 index 0000000..3766a28 Binary files /dev/null and b/exemples/courbes/cp01-1.pdf differ diff --git a/exemples/courbes/cp01-1.png b/exemples/courbes/cp01-1.png new file mode 100644 index 0000000..f5ec6b4 Binary files /dev/null and b/exemples/courbes/cp01-1.png differ diff --git a/exemples/courbes/cp01.mp b/exemples/courbes/cp01.mp new file mode 100644 index 0000000..47e84c8 --- /dev/null +++ b/exemples/courbes/cp01.mp @@ -0,0 +1,57 @@ +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 f(expr t) = 2*cos(t)*cos(t)*cos(t) enddef; +vardef g(expr t) = 2*sin(t)*sin(t)*sin(t) enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(8,8,4,4,1.8,1.8); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withpen pencircle scaled 0.5 withcolor LightSlateGrey); + trace ((-2,-2)--(-2,2)--(2,2)--(2,-2)--cycle); + + nb = 80; + pas = 2*Pi/nb; + for i=0 upto nb: trace (0,2*sin(i*pas))--(2*cos(i*pas),0); endfor; + + trace Vecteur((2,0),(1.2,0)) avecCrayon(1,RoyalBlue); + trace Vecteur((-2,0),(-1.2,0)) avecCrayon(1,RoyalBlue); + trace Vecteur((0,2),(0,1.2)) avecCrayon(1,RoyalBlue); + trace Vecteur((0,-2),(0,-1.2)) avecCrayon(1,RoyalBlue); + + trace Courbe(f,g,0,2*Pi,500) avecCrayon(1.5,DarkOrange); + + pointe Point(0,0); + pointe Point(2,0); + pointe Point(0,2); + pointe Point(0,-2); + pointe Point(-2,0); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/cp02-1.pdf b/exemples/courbes/cp02-1.pdf new file mode 100644 index 0000000..66dfda0 Binary files /dev/null and b/exemples/courbes/cp02-1.pdf differ diff --git a/exemples/courbes/cp02-1.png b/exemples/courbes/cp02-1.png new file mode 100644 index 0000000..6f0f271 Binary files /dev/null and b/exemples/courbes/cp02-1.png differ diff --git a/exemples/courbes/cp02.mp b/exemples/courbes/cp02.mp new file mode 100644 index 0000000..70626f4 --- /dev/null +++ b/exemples/courbes/cp02.mp @@ -0,0 +1,55 @@ +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 f(expr t) = sin(2*t+Pi/3) enddef; +vardef g(expr t) = sin(3*t) enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(8,8,4,4,3,3); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace ((-1,-1)--(-1,1)--(1,1)--(1,-1)--cycle); + trace ((-1,-1)--(1,1)); + trace (1,-1)--(-1,1); + trace Cercle(origine,1); + trace ((-1,0.5)--(1,0.5)); + trace ((-1,-0.5)--(1,-0.5)); + trace ((0.5,-1)--(0.5,1)); + trace ((-0.5,-1)--(-0.5,1)); + trace ((-1,sqrt(3)/2)--(1,sqrt(3)/2)); + trace ((-1,-sqrt(3)/2)--(1,-sqrt(3)/2)); + trace ((sqrt(3)/2,-1)--(sqrt(3)/2,1)); + trace ((-sqrt(3)/2,-1)--(-sqrt(3)/2,1)); + + trace Courbe(f,g,0,2*Pi,500) avecCrayon(1.5,Orchid); + + pointe Point(0,0); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/cp03-1.pdf b/exemples/courbes/cp03-1.pdf new file mode 100644 index 0000000..37d9454 Binary files /dev/null and b/exemples/courbes/cp03-1.pdf differ diff --git a/exemples/courbes/cp03-1.png b/exemples/courbes/cp03-1.png new file mode 100644 index 0000000..5e02a7d Binary files /dev/null and b/exemples/courbes/cp03-1.png differ diff --git a/exemples/courbes/cp03.mp b/exemples/courbes/cp03.mp new file mode 100644 index 0000000..d5bcd8c --- /dev/null +++ b/exemples/courbes/cp03.mp @@ -0,0 +1,44 @@ +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:=1cm; + +vardef f(expr t) = t*t enddef; +vardef g(expr t) = t*t*t enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(8,12,2,6,1,1); + Axes; + Debut; + Graduations; Unites(1); + + + trace Vecteur((0,0),(2,0)) avecCrayon(1,Crimson); + + trace Courbe(f,g,-3,3,300) avecCrayon(1.5,DarkTurquoise); + + pointe Point(0,0); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/cp04-1.pdf b/exemples/courbes/cp04-1.pdf new file mode 100644 index 0000000..107c42e Binary files /dev/null and b/exemples/courbes/cp04-1.pdf differ diff --git a/exemples/courbes/cp04-1.png b/exemples/courbes/cp04-1.png new file mode 100644 index 0000000..8801c11 Binary files /dev/null and b/exemples/courbes/cp04-1.png differ diff --git a/exemples/courbes/cp04.mp b/exemples/courbes/cp04.mp new file mode 100644 index 0000000..ee712c2 --- /dev/null +++ b/exemples/courbes/cp04.mp @@ -0,0 +1,56 @@ +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 f(expr t) = t*t+2/t enddef; +vardef g(expr t) = t+1/t enddef; +vardef fp(expr t) = t*t enddef; +vardef gp(expr t) = t enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(12,10,5,4,0.7,0.7); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace Droite(Point(-4,-2),Point(4,2)); + trace (3,0)--(3,2)--(0,2) dashed evenly; + trace (-1,0)--(-1,-2)--(0,-2) dashed evenly; + trace Courbe(fp,gp,-4,4,500); + + trace Vecteur((3,2),(5,8/3)) avecCrayon(1,DeepPink); + trace Vecteur((-1,-2),(-2.8,-2)) avecCrayon(1,DeepPink); + trace Vecteur((-1,-2),(0.8,-2)) avecCrayon(1,DeepPink); + + trace Courbe(f,g,-5,-0.1,100) avecCrayon(1.5,DarkCyan); + trace Courbe(f,g,0.1,5,100) avecCrayon(1.5,DarkCyan); + + pointe Point(0,0); + pointe Point(3,2); + pointe Point(-1,-2); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/cp05-1.pdf b/exemples/courbes/cp05-1.pdf new file mode 100644 index 0000000..987561e Binary files /dev/null and b/exemples/courbes/cp05-1.pdf differ diff --git a/exemples/courbes/cp05-1.png b/exemples/courbes/cp05-1.png new file mode 100644 index 0000000..1dc3518 Binary files /dev/null and b/exemples/courbes/cp05-1.png differ diff --git a/exemples/courbes/cp05.mp b/exemples/courbes/cp05.mp new file mode 100644 index 0000000..9eaf112 --- /dev/null +++ b/exemples/courbes/cp05.mp @@ -0,0 +1,56 @@ +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 f(expr t) = t*t-2*t enddef; +vardef g(expr t) = t*t + 1/(t*t) enddef; +vardef fp(expr t) = 2*t+t*t enddef; +vardef gp(expr t) = t*t enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(10,10,2,1,1,1); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace (3,0)--(3,2)--(-1,2)--(-1,0) dashed evenly; + trace (1,0)--(1,6)--(0,6) dashed evenly; + trace Courbe(fp,gp,-5,5,500); + + trace Vecteur((-1,2),(-1,2)+(0.5,2)) avecCrayon(1,Crimson); + trace Vecteur((3,2),(4,2)) avecCrayon(1,Crimson); + trace Vecteur((3,2),(2,2)) avecCrayon(1,Crimson); + + trace Courbe(f,g,-10,-0.05,300) avecCrayon(1.5,DarkGoldenrod); + trace Courbe(f,g,0.05,10,300) avecCrayon(1.5,DarkGoldenrod); + + pointe Point(0,0); + pointe Point(-1,2); + pointe Point(3,2); + pointe Point(1,6); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/cp06-1.pdf b/exemples/courbes/cp06-1.pdf new file mode 100644 index 0000000..5a289f9 Binary files /dev/null and b/exemples/courbes/cp06-1.pdf differ diff --git a/exemples/courbes/cp06-1.png b/exemples/courbes/cp06-1.png new file mode 100644 index 0000000..bf020b9 Binary files /dev/null and b/exemples/courbes/cp06-1.png differ diff --git a/exemples/courbes/cp06.mp b/exemples/courbes/cp06.mp new file mode 100644 index 0000000..be5fba9 --- /dev/null +++ b/exemples/courbes/cp06.mp @@ -0,0 +1,50 @@ +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 f(expr t) = 1/t + 1/(t+1) enddef; +vardef g(expr t) = 1/t + 1/(1+2*t+t**2) enddef; +vardef p(expr x) = x*(x+2)+2 enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(10,10,5,5,1,1); + Axes; + Debut; + Graduations; Unites(1); + + drawoptions(withcolor LightSlateGrey); + trace Droite(origine,Point(1,1)); + trace Representation(p,-3,1,20); + + trace Courbe(f,g,-20,-1.1,300) avecCrayon(1.5,Teal); + trace Courbe(f,g,-0.9,-0.1,300) avecCrayon(1.5,Teal); + trace Courbe(f,g,0.1,20,300) avecCrayon(1.5,Teal); + + pointe Point(0,0); + pointe Point(-1,0); + pointe Point(-0.526,-0.140); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/cp07-1.pdf b/exemples/courbes/cp07-1.pdf new file mode 100644 index 0000000..ca8c3f6 Binary files /dev/null and b/exemples/courbes/cp07-1.pdf differ diff --git a/exemples/courbes/cp07-1.png b/exemples/courbes/cp07-1.png new file mode 100644 index 0000000..e8778ed Binary files /dev/null and b/exemples/courbes/cp07-1.png differ diff --git a/exemples/courbes/cp07.mp b/exemples/courbes/cp07.mp new file mode 100644 index 0000000..582d1b4 --- /dev/null +++ b/exemples/courbes/cp07.mp @@ -0,0 +1,45 @@ +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 f(expr t) = t/sqrt(1+t*t) enddef; +vardef g(expr t) = t*(1+f(t)) enddef; +vardef h(expr t) = -t*(1+f(t)) enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + + + +beginfig(1); + + + Repere(6,10,3,5,2,2); + Axes; + Debut; + Graduations; Unites(1); + + trace Droite((1,-2),(1,2)) withcolor MidnightBlue; + + trace (-1,0)..Courbe(f,g,-18,18,200) avecCrayon(1.5,DarkSalmon); + trace (-1,0)..Courbe(f,h,-18,18,200) avecCrayon(1.5,DarkSalmon); + + pointe Point(0,0); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/cp08-1.pdf b/exemples/courbes/cp08-1.pdf new file mode 100644 index 0000000..fae155d Binary files /dev/null and b/exemples/courbes/cp08-1.pdf differ diff --git a/exemples/courbes/cp08-1.png b/exemples/courbes/cp08-1.png new file mode 100644 index 0000000..184064f Binary files /dev/null and b/exemples/courbes/cp08-1.png differ diff --git a/exemples/courbes/cp08.mp b/exemples/courbes/cp08.mp new file mode 100644 index 0000000..54b4fd7 --- /dev/null +++ b/exemples/courbes/cp08.mp @@ -0,0 +1,57 @@ +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 f(expr t) = 2*sin(t) enddef; +vardef g(expr t) = 2*cos(t)*cos(t)/(2-cos(t)) enddef; +vardef h(expr t) = -t*(1+f(t)) enddef; + +def avecCrayon(expr t,c) = withpen pencircle scaled t withcolor c enddef; + +def traceDoubleVecteur(expr o,d)= drawdblarrow ((o-d)--(o+d)) gddEnPlace enddef; + +path bicorne; +bicorne = Courbe(f,g,-Pi,Pi,200)--cycle; + + + +beginfig(1); + + + Repere(9,6,4.5,1,2,2); + Axes; + Debut; + Axes; + Graduations; Unites(1); + + ColorieAvecTransparence(bicorne,CadetBlue,0.2); + + traceDoubleVecteur((0,2),(0.5,0)) avecCrayon(1,Crimson); + traceDoubleVecteur((0,2/3),(0.5,0)) avecCrayon(1,Crimson); + trace Vecteur((2,0),(1.6,0.4)) avecCrayon(1,Crimson); + trace Vecteur((-2,0),(-1.6,0.4)) avecCrayon(1,Crimson); + + trace bicorne avecCrayon(1.5,CadetBlue); + + pointe Point(0,0); + pointe Point(2,0); + pointe Point(-2,0); + + Fin; + + +endfig; + +end \ No newline at end of file diff --git a/exemples/courbes/index.xml b/exemples/courbes/index.xml new file mode 100644 index 0000000..adf66dc --- /dev/null +++ b/exemples/courbes/index.xml @@ -0,0 +1,3 @@ + + mp-gdd – Courbes paramétrées + diff --git a/exemples/courbes/vue.xml b/exemples/courbes/vue.xml new file mode 100644 index 0000000..b08ca69 --- /dev/null +++ b/exemples/courbes/vue.xml @@ -0,0 +1 @@ + \ No newline at end of file