Advertisement
Guest User

Figures convexité

a guest
Sep 14th, 2019
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 12.47 KB | None | 0 0
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % Figures de convexité par YetAnother_MT%
  3. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  4.  
  5. %Préambule plutot  minimal.
  6. \documentclass[a4paper,11pt]{article}
  7.  
  8. \usepackage[utf8]{inputenc}
  9. \usepackage[T1]{fontenc}
  10. \usepackage{lmodern}
  11. \usepackage[french]{babel}
  12.  
  13. %Le package de maths de base
  14. \usepackage{amsmath}
  15. % Un paquet de symboles mathématiques
  16. \usepackage{amssymb}
  17. %Permet d'utiliser \mathscr{} pour les lettes calligraphiées
  18. \usepackage{mathrsfs}
  19.  
  20. %Permet d'utiliser l'envirronnement \begin{comment} ...\end{comment} pour faire de longs commentaires
  21. %sans utiliser %
  22. \usepackage{verbatim}
  23.  
  24. %Définition des marges du document
  25. \usepackage[top=1cm, bottom=1cm, right=1cm, left=1cm]{geometry}
  26.  
  27.  
  28. %Package de dessin avec ses sous-packages
  29. \usepackage{tikz}
  30. \usetikzlibrary{positioning}
  31. \usetikzlibrary{calc}
  32. \usetikzlibrary{babel}%compatibilité babel & pgf
  33.  
  34. \usetikzlibrary{arrows,arrows.meta}
  35. %Pour des T non italiques en mode maths
  36. \DeclareMathSymbol{T}{\mathalpha}{operators}{`T}%
  37.  
  38. \begin{document}
  39.  
  40.  
  41. %Figure 1
  42. {
  43. \begin{center}
  44.  
  45. \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
  46.                   fprime(\x)     = 2*0.4*.8*(.8*\x-1.6);}]
  47.  
  48. \tikzstyle{every node}=[font=\footnotesize]
  49.  
  50. \pgfmathsetmacro{\xmin}{-1}
  51. \pgfmathsetmacro{\ymin}{-1}
  52. \pgfmathsetmacro{\xmax}{7}
  53. \pgfmathsetmacro{\ymax}{5}
  54.  
  55.  
  56. \pgfmathsetmacro{\xA}{1}
  57. \pgfmathsetmacro{\xB}{4.5}
  58. \pgfmathsetmacro{\yA}{f(\xA)}
  59. \pgfmathsetmacro{\yB}{f(\xB)}
  60. \pgfmathsetmacro{\t}{.6}
  61. \pgfmathsetmacro{\xT}{\t*\xA+(1-\t)*\xB}
  62. \pgfmathsetmacro{\yT}{f(\xT)}
  63. \pgfmathsetmacro{\yTS}{\t*\yA+(1-\t)*\yB}
  64.  
  65. \pgfmathsetmacro{\tA}{fprime(\xA)}
  66. \pgfmathsetmacro{\tT}{fprime(\xT)}
  67. \pgfmathsetmacro{\tB}{fprime(\xB)}
  68.  
  69. %Axes
  70. \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
  71. \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
  72.  
  73.  
  74.  
  75. \begin{scope}
  76. %Pour pas que la courbe deborde du cadre.
  77. \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
  78. \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
  79. %Malheureusement lui il faut le placer à la main :
  80. \node () at (5.4,4.7) {$\mathscr{C}_f$};
  81. \end{scope}
  82.  
  83.  
  84. %Les coches dans l'axe des abscisses et les labels.
  85. \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
  86. \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
  87. \draw[thick,shift={(\xT,0)},color=black] (0,0.05) -- (0,-0.05) node[below] {$ta+(1-t)b$};
  88.  
  89.  
  90.  
  91. %Les sécantes
  92. \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS) {}  (\xB,\yB);
  93.  
  94.  
  95. %Les pointillés pour les points barycentres
  96. \draw[thick,dashed,color=black] (\xT,0) -- (\xT,\yTS);
  97. \draw[thick,dashed,color=black]  (\xT,\yT) -- (0,\yT) node[left] {$f(ta+(1-t)b)$};
  98. \draw[thick,dashed,color=black] (\xT,\yTS)  -- (0,\yTS) node[left] {$tf(a)+(1-t)f(b)$};
  99.  
  100.  
  101.  
  102. %Les 4 points
  103. \draw[fill,color=red] (\xA,\yA) circle (2pt);
  104. \draw[fill,color=red] (\xB,\yB) circle (2pt);
  105. \draw[fill,color=black] (\xT,\yT) circle (2pt);
  106. \draw[fill,color=black] (\xT,\yTS) circle (2pt);
  107.  
  108.  
  109.  
  110. \end{tikzpicture}
  111.  
  112. \end{center}
  113. }
  114.  
  115.  
  116. %Figure 2
  117. {
  118. \begin{center}
  119.  
  120. \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
  121.                   fprime(\x)     = 2*0.4*.8*(.8*\x-1.6);}]
  122.  
  123. \tikzstyle{every node}=[font=\footnotesize]
  124.  
  125. \pgfmathsetmacro{\xmin}{-1}
  126. \pgfmathsetmacro{\ymin}{-1}
  127. \pgfmathsetmacro{\xmax}{7}
  128. \pgfmathsetmacro{\ymax}{5}
  129.  
  130.  
  131. \pgfmathsetmacro{\xA}{1}
  132. \pgfmathsetmacro{\xB}{4}
  133. \pgfmathsetmacro{\yA}{f(\xA)}
  134. \pgfmathsetmacro{\yB}{f(\xB)}
  135.  
  136. \pgfmathsetmacro{\tA}{fprime(\xA)}
  137. \pgfmathsetmacro{\tB}{fprime(\xB)}
  138.  
  139. %Axes
  140. \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
  141. \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
  142.  
  143.  
  144.  
  145. \begin{scope}
  146. %Pour pas que la courbe deborde du cadre.
  147. \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
  148. \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)}) ;
  149. \node () at (5.4,4.7) {$\mathscr{C}_f$};
  150. \end{scope}
  151.  
  152.  
  153. %Les coches dans l'axe des abscisses et les labels.
  154. \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
  155. \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
  156.  
  157.  
  158.  
  159. %Les sécantes
  160. \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS) {} (\xB,\yB);
  161.  
  162.  
  163. %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2)
  164. \draw[>=stealth,thick, <-,color=red] ($(CS) + (90:.2)$) -- +(90:1.5) node[above] {Pente $\dfrac{f(b)-f(a)}{b-a}$};
  165.  
  166.  
  167. %Les tangentes
  168.  
  169. \draw[thick] ($(\xA,\yA) - 1.5*(1,\tA)$) --node[pos=.1,below left] {$T_a$} node[pos=.8] (CA) {} ($(\xA,\yA) + (1,\tA)$);
  170. \draw[thick] ($(\xB,\yB) - (1,\tB)$) --node[pos=.1,below right] {$T_b$} node[pos=.8] (CB) {} ($(\xB,\yB) + (1,\tB)$);
  171.  
  172.  
  173. %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2)
  174. \draw[>=stealth,thick, <-] ($(CA) + (-90:.2)$) -- +(-90:1.5) node[below] {Pente $f'(a)$};
  175. \draw[>=stealth,thick, <-] ($(CB) + (20:.2)$) -- +(20:1.5) node[right] {Pente $f'(b)$};
  176.  
  177.  
  178. %Les points
  179. \draw[fill,color=red] (\xA,\yA) circle (2pt);
  180. \draw[fill,color=red] (\xB,\yB) circle (2pt);
  181.  
  182.  
  183.  
  184. \end{tikzpicture}
  185.  
  186. \end{center}
  187. }
  188.  
  189. %Figure 3
  190. {
  191. \begin{center}
  192.  
  193. \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
  194.                   fprime(\x)     = 2*0.4*.8*(.8*\x-1.6);}]
  195.  
  196. \tikzstyle{every node}=[font=\footnotesize]
  197.  
  198. \pgfmathsetmacro{\xmin}{-1}
  199. \pgfmathsetmacro{\ymin}{-1}
  200. \pgfmathsetmacro{\xmax}{7}
  201. \pgfmathsetmacro{\ymax}{5}
  202.  
  203.  
  204. \pgfmathsetmacro{\xA}{2.5}
  205. \pgfmathsetmacro{\yA}{f(\xA)}
  206.  
  207. \pgfmathsetmacro{\tA}{fprime(\xA)}
  208.  
  209. %Axes
  210. \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
  211. \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
  212.  
  213.  
  214.  
  215. \begin{scope}
  216. %Pour pas que la courbe deborde du cadre.
  217. \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
  218. \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
  219. %Malheureusement lui il faut le placer à la main :
  220. \node () at (5.4,4.7) {$\mathscr{C}_f$};
  221. \end{scope}
  222.  
  223.  
  224. %Les coches dans l'axe des abscisses et les labels.
  225. \draw[thick,shift={(\xA,0)},color=black] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
  226.  
  227. %Les tangentes
  228.  
  229. \draw[thick] ($(\xA,\yA) - 3*(1,\tA)$) --node[pos=.95,below] {$T_a$} node[pos=.8] (CA) {} ($(\xA,\yA) + 3*(1,\tA)$);
  230.  
  231. %\draw[>=stealth,thick, <-] ($(CA) + (-90:.2)$) -- +(-90:1.5) node[below] {Pente $f'(a)$};
  232.  
  233. %Le point
  234. \draw[fill,color=black] (\xA,\yA) circle (2pt);
  235.  
  236. \end{tikzpicture}
  237.  
  238. \end{center}
  239. }
  240.  
  241. %Figure 4
  242. {
  243. \begin{center}
  244.  
  245. \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
  246.                   fprime(\x)     = 2*0.4*.8*(.8*\x-1.6);}]
  247.  
  248. \tikzstyle{every node}=[font=\footnotesize]
  249.  
  250. \pgfmathsetmacro{\xmin}{-1}
  251. \pgfmathsetmacro{\ymin}{-1}
  252. \pgfmathsetmacro{\xmax}{7}
  253. \pgfmathsetmacro{\ymax}{5}
  254.  
  255.  
  256. \pgfmathsetmacro{\xA}{1}
  257. \pgfmathsetmacro{\xB}{4.5}
  258. \pgfmathsetmacro{\yA}{f(\xA)}
  259. \pgfmathsetmacro{\yB}{f(\xB)}
  260. \pgfmathsetmacro{\t}{.6}
  261. \pgfmathsetmacro{\xT}{\t*\xA+(1-\t)*\xB}
  262. \pgfmathsetmacro{\yT}{f(\xT)}
  263.  
  264. \pgfmathsetmacro{\tA}{fprime(\xA)}
  265. \pgfmathsetmacro{\tT}{fprime(\xT)}
  266. \pgfmathsetmacro{\tB}{fprime(\xB)}
  267.  
  268. %Axes
  269. \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
  270. \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
  271.  
  272.  
  273.  
  274. \begin{scope}
  275. %Pour pas que la courbe deborde du cadre.
  276. \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
  277. \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
  278. %Malheureusement lui il faut le placer à la main :
  279. \node () at (5.4,4.7) {$\mathscr{C}_f$};
  280. \end{scope}
  281.  
  282.  
  283. %Les coches dans l'axe des abscisses et les labels.
  284. \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
  285. \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
  286. \draw[thick,shift={(\xT,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}c$};
  287.  
  288.  
  289.  
  290. %Les sécantes
  291. \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS1) {} (\xT,\yT) --node[pos=.5] (CS2) {} (\xB,\yB);
  292.  
  293.  
  294. %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2 ou .1)
  295. \draw[>=stealth,thick, <-,color=red] ($(CS1) + (90:.2)$) -- +(90:1.5) node[above] {Pente $\dfrac{f(c)-f(a)}{c-a}$};
  296. \draw[>=stealth,thick, <-,color=red] ($(CS2) + (-10:.1)$) -- +(-10:1.5) node[right] {Pente $\dfrac{f(b)-f(c)}{b-c}$};
  297.  
  298.  
  299. %Les tangentes
  300. \draw[thick] ($(\xT,\yT) - 2*(1,\tT)$) -- node[pos=.9,below right] {$T_c$} node[pos=.2] (CT) {} ($(\xT,\yT) + 2*(1,\tT)$);
  301. \draw[>=stealth,thick, <-] ($(CT) + (-70:.2)$) -- +(-70:2) node[below] {Pente $f'(c)$};
  302.  
  303.  
  304. %Les points
  305. \draw[fill,color=red] (\xA,\yA) circle (2pt);
  306. \draw[fill,color=red] (\xB,\yB) circle (2pt);
  307. \draw[fill,color=red] (\xT,\yT) circle (2pt);
  308.  
  309. \end{tikzpicture}
  310.  
  311. \end{center}
  312. }
  313.  
  314. %La figure de référence qui contient un peu tout.
  315. \begin{comment}
  316. {
  317. \begin{center}
  318.  
  319. \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
  320.                   fprime(\x)     = 2*0.4*.8*(.8*\x-1.6);}]
  321.  
  322. \tikzstyle{every node}=[font=\footnotesize]
  323.  
  324. \pgfmathsetmacro{\xmin}{-1}
  325. \pgfmathsetmacro{\ymin}{-1}
  326. \pgfmathsetmacro{\xmax}{7}
  327. \pgfmathsetmacro{\ymax}{5}
  328.  
  329.  
  330. \pgfmathsetmacro{\xA}{1}
  331. \pgfmathsetmacro{\xB}{4.5}
  332. \pgfmathsetmacro{\yA}{f(\xA)}
  333. \pgfmathsetmacro{\yB}{f(\xB)}
  334. \pgfmathsetmacro{\t}{.6}
  335. \pgfmathsetmacro{\xT}{\t*\xA+(1-\t)*\xB}
  336. \pgfmathsetmacro{\yT}{f(\xT)}
  337. \pgfmathsetmacro{\yTS}{\t*\yA+(1-\t)*\yB}
  338.  
  339. \pgfmathsetmacro{\tA}{fprime(\xA)}
  340. \pgfmathsetmacro{\tT}{fprime(\xT)}
  341. \pgfmathsetmacro{\tB}{fprime(\xB)}
  342.  
  343. %Axes
  344. \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
  345. \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
  346.  
  347.  
  348.  
  349. \begin{scope}
  350. %Pour pas que la courbe deborde du cadre.
  351. \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
  352. \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
  353. %Malheureusement lui il faut le placer à la main :
  354. \node () at (5.4,4.7) {$\mathscr{C}_f$};
  355. \end{scope}
  356.  
  357.  
  358. %Les coches dans l'axe des abscisses et les labels.
  359. \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
  360. \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
  361. \draw[thick,shift={(\xT,0)},color=black] (0,0.05) -- (0,-0.05) node[below] {$ta+(1-t)b$};
  362.  
  363.  
  364.  
  365. %Les sécantes
  366. \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS) {}  (\xB,\yB);
  367. \draw[thick,color=red] (\xA,\yA) -- (\xT,\yT) -- (\xB,\yB);
  368. \draw[>=stealth,thick, <-,color=red] ($(CS) + (90:.2)$) -- +(90:1.5) node[above] {Pente $\dfrac{f(b)-f(a)}{b-a}$};
  369.  
  370.  
  371. %Les pointillés pour les points barycentres
  372. \draw[thick,dashed,color=black] (\xT,0) -- (\xT,\yTS);
  373. \draw[thick,dashed,color=black]  (\xT,\yT) -- (0,\yT) node[left] {$f(ta+(1-t)b)$};
  374. \draw[thick,dashed,color=black] (\xT,\yTS)  -- (0,\yTS) node[left] {$tf(a)+(1-t)f(b)$};
  375.  
  376. %Les tangentes
  377.  
  378. \draw[thick] ($(\xA,\yA) - 1.5*(1,\tA)$) --node[pos=.1,below left] {$T_a$} node[pos=.8] (CA) {} ($(\xA,\yA) + (1,\tA)$);
  379. \draw[thick] ($(\xB,\yB) - (1,\tB)$) --node[pos=.1,below right] {$T_b$} node[pos=.8] (CB) {} ($(\xB,\yB) + (1,\tB)$);
  380. \draw[thick] ($(\xT,\yT) - 3*(1,\tT)$) -- node[pos=.9,below] {$T_t$} node[pos=.2] (CT) {} ($(\xT,\yT) + 3*(1,\tT)$);
  381.  
  382. %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2)
  383. \draw[>=stealth,thick, <-] ($(CT) + (-70:.2)$) -- +(-70:2) node[below] {\shortstack{Pente\\ $\dfrac{f(b)-f(a)}{b-a}$}};
  384. \draw[>=stealth,thick, <-] ($(CA) + (-90:.2)$) -- +(-90:1.5) node[below] {Pente $f'(a)$};
  385. \draw[>=stealth,thick, <-] ($(CB) + (20:.2)$) -- +(20:1.5) node[right] {Pente $f'(b)$};
  386.  
  387.  
  388.  
  389. %Les 4 points
  390. \draw[fill,color=red] (\xA,\yA) circle (2pt);
  391. \draw[fill,color=red] (\xB,\yB) circle (2pt);
  392. \draw[fill,color=black] (\xT,\yT) circle (2pt);
  393. \draw[fill,color=black] (\xT,\yTS) circle (2pt);
  394.  
  395. \end{tikzpicture}
  396.  
  397. \end{center}
  398. }
  399. \end{comment}
  400.  
  401. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement