Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Figures de convexité par YetAnother_MT%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %Préambule plutot minimal.
- \documentclass[a4paper,11pt]{article}
- \usepackage[utf8]{inputenc}
- \usepackage[T1]{fontenc}
- \usepackage{lmodern}
- \usepackage[french]{babel}
- %Le package de maths de base
- \usepackage{amsmath}
- % Un paquet de symboles mathématiques
- \usepackage{amssymb}
- %Permet d'utiliser \mathscr{} pour les lettes calligraphiées
- \usepackage{mathrsfs}
- %Permet d'utiliser l'envirronnement \begin{comment} ...\end{comment} pour faire de longs commentaires
- %sans utiliser %
- \usepackage{verbatim}
- %Définition des marges du document
- \usepackage[top=1cm, bottom=1cm, right=1cm, left=1cm]{geometry}
- %Package de dessin avec ses sous-packages
- \usepackage{tikz}
- \usetikzlibrary{positioning}
- \usetikzlibrary{calc}
- \usetikzlibrary{babel}%compatibilité babel & pgf
- \usetikzlibrary{arrows,arrows.meta}
- %Pour des T non italiques en mode maths
- \DeclareMathSymbol{T}{\mathalpha}{operators}{`T}%
- \begin{document}
- %Figure 1
- {
- \begin{center}
- %Warning : declare function n'est pas compatible avec certains container genre parbox
- % ca provoque plein d'erreurs dures à déchiffrer.
- % Si c'est incontournable, il faut virer declare et mettre les expressions correspondantes
- %dans le reste du code.
- \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
- fprime(\x) = 2*0.4*.8*(.8*\x-1.6);}]
- \tikzstyle{every node}=[font=\footnotesize]
- \pgfmathsetmacro{\xmin}{-1}
- \pgfmathsetmacro{\ymin}{-1}
- \pgfmathsetmacro{\xmax}{7}
- \pgfmathsetmacro{\ymax}{5}
- \pgfmathsetmacro{\xA}{1}
- \pgfmathsetmacro{\xB}{4.5}
- \pgfmathsetmacro{\yA}{f(\xA)}
- \pgfmathsetmacro{\yB}{f(\xB)}
- \pgfmathsetmacro{\t}{.6}
- \pgfmathsetmacro{\xT}{\t*\xA+(1-\t)*\xB}
- \pgfmathsetmacro{\yT}{f(\xT)}
- \pgfmathsetmacro{\yTS}{\t*\yA+(1-\t)*\yB}
- \pgfmathsetmacro{\tA}{fprime(\xA)}
- \pgfmathsetmacro{\tT}{fprime(\xT)}
- \pgfmathsetmacro{\tB}{fprime(\xB)}
- %Axes
- \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
- \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
- \begin{scope}
- %Pour pas que la courbe deborde du cadre.
- \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
- \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
- %Malheureusement lui il faut le placer à la main :
- \node () at (5.4,4.7) {$\mathscr{C}_f$};
- \end{scope}
- %Les coches dans l'axe des abscisses et les labels.
- \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
- \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
- \draw[thick,shift={(\xT,0)},color=black] (0,0.05) -- (0,-0.05) node[below] {$ta+(1-t)b$};
- %Les sécantes
- \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS) {} (\xB,\yB);
- %Les pointillés pour les points barycentres
- \draw[thick,dashed,color=black] (\xT,0) -- (\xT,\yTS);
- \draw[thick,dashed,color=black] (\xT,\yT) -- (0,\yT) node[left] {$f(ta+(1-t)b)$};
- \draw[thick,dashed,color=black] (\xT,\yTS) -- (0,\yTS) node[left] {$tf(a)+(1-t)f(b)$};
- %Les 4 points
- \draw[fill,color=red] (\xA,\yA) circle (2pt);
- \draw[fill,color=red] (\xB,\yB) circle (2pt);
- \draw[fill,color=black] (\xT,\yT) circle (2pt);
- \draw[fill,color=black] (\xT,\yTS) circle (2pt);
- \end{tikzpicture}
- \end{center}
- }
- %Figure 2
- {
- \begin{center}
- %Warning : declare function n'est pas compatible avec certains container genre parbox
- % ca provoque plein d'erreurs dures à déchiffrer.
- % Si c'est incontournable, il faut virer declare et mettre les expressions correspondantes
- %dans le reste du code.
- \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
- fprime(\x) = 2*0.4*.8*(.8*\x-1.6);}]
- \tikzstyle{every node}=[font=\footnotesize]
- \pgfmathsetmacro{\xmin}{-1}
- \pgfmathsetmacro{\ymin}{-1}
- \pgfmathsetmacro{\xmax}{7}
- \pgfmathsetmacro{\ymax}{5}
- \pgfmathsetmacro{\xA}{1}
- \pgfmathsetmacro{\xB}{4}
- \pgfmathsetmacro{\yA}{f(\xA)}
- \pgfmathsetmacro{\yB}{f(\xB)}
- \pgfmathsetmacro{\tA}{fprime(\xA)}
- \pgfmathsetmacro{\tB}{fprime(\xB)}
- %Axes
- \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
- \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
- \begin{scope}
- %Pour pas que la courbe deborde du cadre.
- \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
- \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)}) ;
- \node () at (5.4,4.7) {$\mathscr{C}_f$};
- \end{scope}
- %Les coches dans l'axe des abscisses et les labels.
- \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
- \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
- %Les sécantes
- \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS) {} (\xB,\yB);
- %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2)
- \draw[>=stealth,thick, <-,color=red] ($(CS) + (90:.2)$) -- +(90:1.5) node[above] {Pente $\dfrac{f(b)-f(a)}{b-a}$};
- %Les tangentes
- \draw[thick] ($(\xA,\yA) - 1.5*(1,\tA)$) --node[pos=.1,below left] {$T_a$} node[pos=.8] (CA) {} ($(\xA,\yA) + (1,\tA)$);
- \draw[thick] ($(\xB,\yB) - (1,\tB)$) --node[pos=.1,below right] {$T_b$} node[pos=.8] (CB) {} ($(\xB,\yB) + (1,\tB)$);
- %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2)
- \draw[>=stealth,thick, <-] ($(CA) + (-90:.2)$) -- +(-90:1.5) node[below] {Pente $f'(a)$};
- \draw[>=stealth,thick, <-] ($(CB) + (20:.2)$) -- +(20:1.5) node[right] {Pente $f'(b)$};
- %Les points
- \draw[fill,color=red] (\xA,\yA) circle (2pt);
- \draw[fill,color=red] (\xB,\yB) circle (2pt);
- \end{tikzpicture}
- \end{center}
- }
- %Figure 3
- {
- \begin{center}
- %Warning : declare function n'est pas compatible avec certains container genre parbox
- % ca provoque plein d'erreurs dures à déchiffrer.
- % Si c'est incontournable, il faut virer declare et mettre les expressions correspondantes
- %dans le reste du code.
- \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
- fprime(\x) = 2*0.4*.8*(.8*\x-1.6);}]
- \tikzstyle{every node}=[font=\footnotesize]
- \pgfmathsetmacro{\xmin}{-1}
- \pgfmathsetmacro{\ymin}{-1}
- \pgfmathsetmacro{\xmax}{7}
- \pgfmathsetmacro{\ymax}{5}
- \pgfmathsetmacro{\xA}{2.5}
- \pgfmathsetmacro{\yA}{f(\xA)}
- \pgfmathsetmacro{\tA}{fprime(\xA)}
- %Axes
- \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
- \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
- \begin{scope}
- %Pour pas que la courbe deborde du cadre.
- \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
- \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
- %Malheureusement lui il faut le placer à la main :
- \node () at (5.4,4.7) {$\mathscr{C}_f$};
- \end{scope}
- %Les coches dans l'axe des abscisses et les labels.
- \draw[thick,shift={(\xA,0)},color=black] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
- %Les tangentes
- \draw[thick] ($(\xA,\yA) - 3*(1,\tA)$) --node[pos=.95,below] {$T_a$} node[pos=.8] (CA) {} ($(\xA,\yA) + 3*(1,\tA)$);
- %\draw[>=stealth,thick, <-] ($(CA) + (-90:.2)$) -- +(-90:1.5) node[below] {Pente $f'(a)$};
- %Le point
- \draw[fill,color=black] (\xA,\yA) circle (2pt);
- \end{tikzpicture}
- \end{center}
- }
- %Figure 4
- {
- \begin{center}
- %Warning : declare function n'est pas compatible avec certains container genre parbox
- % ca provoque plein d'erreurs dures à déchiffrer.
- % Si c'est incontournable, il faut virer declare et mettre les expressions correspondantes
- %dans le reste du code.
- \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
- fprime(\x) = 2*0.4*.8*(.8*\x-1.6);}]
- \tikzstyle{every node}=[font=\footnotesize]
- \pgfmathsetmacro{\xmin}{-1}
- \pgfmathsetmacro{\ymin}{-1}
- \pgfmathsetmacro{\xmax}{7}
- \pgfmathsetmacro{\ymax}{5}
- \pgfmathsetmacro{\xA}{1}
- \pgfmathsetmacro{\xB}{4.5}
- \pgfmathsetmacro{\yA}{f(\xA)}
- \pgfmathsetmacro{\yB}{f(\xB)}
- \pgfmathsetmacro{\t}{.6}
- \pgfmathsetmacro{\xT}{\t*\xA+(1-\t)*\xB}
- \pgfmathsetmacro{\yT}{f(\xT)}
- \pgfmathsetmacro{\tA}{fprime(\xA)}
- \pgfmathsetmacro{\tT}{fprime(\xT)}
- \pgfmathsetmacro{\tB}{fprime(\xB)}
- %Axes
- \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
- \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
- \begin{scope}
- %Pour pas que la courbe deborde du cadre.
- \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
- \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
- %Malheureusement lui il faut le placer à la main :
- \node () at (5.4,4.7) {$\mathscr{C}_f$};
- \end{scope}
- %Les coches dans l'axe des abscisses et les labels.
- \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
- \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
- \draw[thick,shift={(\xT,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}c$};
- %Les sécantes
- \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS1) {} (\xT,\yT) --node[pos=.5] (CS2) {} (\xB,\yB);
- %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2 ou .1)
- \draw[>=stealth,thick, <-,color=red] ($(CS1) + (90:.2)$) -- +(90:1.5) node[above] {Pente $\dfrac{f(c)-f(a)}{c-a}$};
- \draw[>=stealth,thick, <-,color=red] ($(CS2) + (-10:.1)$) -- +(-10:1.5) node[right] {Pente $\dfrac{f(b)-f(c)}{b-c}$};
- %Les tangentes
- \draw[thick] ($(\xT,\yT) - 2*(1,\tT)$) -- node[pos=.9,below right] {$T_c$} node[pos=.2] (CT) {} ($(\xT,\yT) + 2*(1,\tT)$);
- \draw[>=stealth,thick, <-] ($(CT) + (-70:.2)$) -- +(-70:2) node[below] {Pente $f'(c)$};
- %Les points
- \draw[fill,color=red] (\xA,\yA) circle (2pt);
- \draw[fill,color=red] (\xB,\yB) circle (2pt);
- \draw[fill,color=red] (\xT,\yT) circle (2pt);
- \end{tikzpicture}
- \end{center}
- }
- %La figure de référence qui contient un peu tout, en commentaire.
- \begin{comment}
- {
- \begin{center}
- %Warning : declare function n'est pas compatible avec certains container genre parbox
- % ca provoque plein d'erreurs dures à déchiffrer.
- % Si c'est incontournable, il faut virer declare et mettre les expressions correspondantes
- %dans le reste du code.
- \begin{tikzpicture}[x=1cm,y=1cm,declare function={ f(\x)= 0.4*(.8*\x-1.6)^2+1;
- fprime(\x) = 2*0.4*.8*(.8*\x-1.6);}]
- \tikzstyle{every node}=[font=\footnotesize]
- \pgfmathsetmacro{\xmin}{-1}
- \pgfmathsetmacro{\ymin}{-1}
- \pgfmathsetmacro{\xmax}{7}
- \pgfmathsetmacro{\ymax}{5}
- \pgfmathsetmacro{\xA}{1}
- \pgfmathsetmacro{\xB}{4.5}
- \pgfmathsetmacro{\yA}{f(\xA)}
- \pgfmathsetmacro{\yB}{f(\xB)}
- \pgfmathsetmacro{\t}{.6}
- \pgfmathsetmacro{\xT}{\t*\xA+(1-\t)*\xB}
- \pgfmathsetmacro{\yT}{f(\xT)}
- \pgfmathsetmacro{\yTS}{\t*\yA+(1-\t)*\yB}
- \pgfmathsetmacro{\tA}{fprime(\xA)}
- \pgfmathsetmacro{\tT}{fprime(\xT)}
- \pgfmathsetmacro{\tB}{fprime(\xB)}
- %Axes
- \draw[>={angle 60},thick,->,color=black] (\xmin,0) -- (\xmax,0) node[above] {$x$} node[below] {$\mathbb{R}$};
- \draw[>={angle 60},thick,->,color=black] (0,\ymin) -- (0,\ymax) node[right] {$y$} node[left] {$\mathbb{R}$};
- \begin{scope}
- %Pour pas que la courbe deborde du cadre.
- \clip(\xmin,\ymin) rectangle (\xmax,\ymax);
- \draw[thick,smooth,samples=100,domain=\xmin:\xmax] plot(\x,{f(\x)});
- %Malheureusement lui il faut le placer à la main :
- \node () at (5.4,4.7) {$\mathscr{C}_f$};
- \end{scope}
- %Les coches dans l'axe des abscisses et les labels.
- \draw[thick,shift={(\xA,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}a$};
- \draw[thick,shift={(\xB,0)},color=red] (0,0.05) -- (0,-0.05) node[below] {$\vphantom{(t)}b$};
- \draw[thick,shift={(\xT,0)},color=black] (0,0.05) -- (0,-0.05) node[below] {$ta+(1-t)b$};
- %Les sécantes
- \draw[thick,color=red] (\xA,\yA) --node[pos=.5] (CS) {} (\xB,\yB);
- \draw[thick,color=red] (\xA,\yA) -- (\xT,\yT) -- (\xB,\yB);
- \draw[>=stealth,thick, <-,color=red] ($(CS) + (90:.2)$) -- +(90:1.5) node[above] {Pente $\dfrac{f(b)-f(a)}{b-a}$};
- %Les pointillés pour les points barycentres
- \draw[thick,dashed,color=black] (\xT,0) -- (\xT,\yTS);
- \draw[thick,dashed,color=black] (\xT,\yT) -- (0,\yT) node[left] {$f(ta+(1-t)b)$};
- \draw[thick,dashed,color=black] (\xT,\yTS) -- (0,\yTS) node[left] {$tf(a)+(1-t)f(b)$};
- %Les tangentes
- \draw[thick] ($(\xA,\yA) - 1.5*(1,\tA)$) --node[pos=.1,below left] {$T_a$} node[pos=.8] (CA) {} ($(\xA,\yA) + (1,\tA)$);
- \draw[thick] ($(\xB,\yB) - (1,\tB)$) --node[pos=.1,below right] {$T_b$} node[pos=.8] (CB) {} ($(\xB,\yB) + (1,\tB)$);
- \draw[thick] ($(\xT,\yT) - 3*(1,\tT)$) -- node[pos=.9,below] {$T_t$} node[pos=.2] (CT) {} ($(\xT,\yT) + 3*(1,\tT)$);
- %Fleches donnant les pentes, orientation angulaire à partir du point de contact marqué, sans coller au point de contact (le .2)
- \draw[>=stealth,thick, <-] ($(CT) + (-70:.2)$) -- +(-70:2) node[below] {\shortstack{Pente\\ $\dfrac{f(b)-f(a)}{b-a}$}};
- \draw[>=stealth,thick, <-] ($(CA) + (-90:.2)$) -- +(-90:1.5) node[below] {Pente $f'(a)$};
- \draw[>=stealth,thick, <-] ($(CB) + (20:.2)$) -- +(20:1.5) node[right] {Pente $f'(b)$};
- %Les 4 points
- \draw[fill,color=red] (\xA,\yA) circle (2pt);
- \draw[fill,color=red] (\xB,\yB) circle (2pt);
- \draw[fill,color=black] (\xT,\yT) circle (2pt);
- \draw[fill,color=black] (\xT,\yTS) circle (2pt);
- \end{tikzpicture}
- \end{center}
- }
- \end{comment}
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement