Schéma avec tikz

Bonsoir
des idées sur comment je peux faire ce dessin avec tikz.89088

Réponses

  • Tu devrais peut-être lire TikZ pour l'impatient cité plusieurs fois ici par Math Coss ; c'est un bon document pour commencer avec TikZ en français. En attendant, voici une possibilité :
    \documentclass{article}
    \usepackage{tikz}
    \usetikzlibrary{calc, hobby}
    
    \begin{document}
    \begin{tikzpicture}[
        hachures/.style={line width=0.3pt,
                         /utils/exec=\tikzset{hachures/.cd, #1}},
        hachures/len/.initial=0.1]
    
      \coordinate (A) at (0,0);
      \coordinate (B) at (1,0);
      \draw ([xshift=-0.3cm]A) -- ([xshift=0.3cm]B);
    
      \foreach \point/\coord in {A/a, B/b} {
        \draw ([yshift=-0.1cm]\point)
              node[below, inner sep=2pt] {$\mathstrut\coord$} --
              ([yshift=0.1cm]\point);
      }
    
      \begin{scope}
        \clip ([yshift=-1cm]A) rectangle ([yshift=1cm]B);
        \def\nbDivisions{15}
        \foreach \i in {-1, ..., \nbDivisions} {
        % Variante (autre look)
        % \foreach \i in {1, ..., \numexpr \nbDivisions - 1 \relax} {
          \pgfmathsetmacro{\coord}{\i/\nbDivisions}
          \draw[hachures]
            ([shift={($\pgfkeysvalueof{/tikz/hachures/len}*(-0.5,-0.5)$)}]
              $(A) !\coord! (B)$) --
             +($\pgfkeysvalueof{/tikz/hachures/len}*(1,1)$);
      }
      \end{scope}
    
      \draw[rotate=30] (5,-2.5) ellipse (2.3cm and 1.2cm);
      \draw (4.3,-0.15) node[below] {$\varphi(a)$}
            to[out angle=70, curve through={(5.3,0.6) .. (6,0.5)}]
            ([in angle=260]6.7,1);% ne semble pas mettre à jour le point courant (?)
      \node[above] at (6.7,1) {$\varphi(b)$}; % d'où la redondance ici :-/
    
      \draw[->] (1,0.5) to[out=40, in=160] node[above, midway] {$\varphi$} (3.5,0.5);
    
    \end{tikzpicture}
    \end{document}
    
    (oui, hachures/len donne la longueur des hachures à un facteur $\sqrt{2}$ près)89096
  • Merci
    je veux mettre un point en $\varphi(a)$ et un autre en $\varphi(b)$

    j'ai essayé de mettre point dans node mais ça donne une erreur.
    comment faire?
  • Remplace
      \draw (4.3,-0.15) node[below] {$\varphi(a)$}
    
    par
      \fill (4.3,-0.15) circle(1.5pt) node[below] {$\varphi(a)$}
    
  • ca ne donne pas le résultat voulu
  • C'était pourtant rigolo. Bon, tu peux faire comme ça :
    \documentclass{article}
    \usepackage{tikz}
    \usetikzlibrary{calc, hobby}
    
    \begin{document}
    \begin{tikzpicture}[
        hachures/.style={line width=0.3pt,
                         /utils/exec=\tikzset{hachures/.cd, #1}},
        hachures/len/.initial=0.1]
    
      \coordinate (A) at (0,0);
      \coordinate (B) at (1,0);
      \draw ([xshift=-0.3cm]A) -- ([xshift=0.3cm]B);
    
      \foreach \point/\coord in {A/a, B/b} {
        \draw ([yshift=-0.075cm]\point)
              node[below, inner sep=2pt] {$\mathstrut\coord$} --
              ([yshift=0.075cm]\point);
      }
    
      \begin{scope}
        \clip ([yshift=-1cm]A) rectangle ([yshift=1cm]B);
        \def\nbDivisions{15}
        \foreach \i in {-1, ..., \nbDivisions} {
        % Variante (autre look)
        % \foreach \i in {1, ..., \numexpr \nbDivisions - 1 \relax} {
          \pgfmathsetmacro{\coord}{\i/\nbDivisions}
          \draw[hachures]
            ([shift={($\pgfkeysvalueof{/tikz/hachures/len}*(-0.5,-0.5)$)}]
              $(A) !\coord! (B)$) --
           +($\pgfkeysvalueof{/tikz/hachures/len}*(1,1)$);
      }
      \end{scope}
    
      \draw[rotate=30] (5,-2.5) ellipse (2.3cm and 1.2cm);
    
      \coordinate (debutCheminImage) at (4.3,-0.15);
      \coordinate (finCheminImage) at (6.7,1);
      \draw (debutCheminImage)
            to[out angle=70, curve through={(5.3,0.6) .. (6,0.5)}]
            ([in angle=260]finCheminImage);% ne semble pas mettre à jour le point courant (?)
      \fill (debutCheminImage) circle(1.2pt) node[below] {$\varphi(a)$};
      \fill (finCheminImage)   circle(1.2pt) node[above] {$\varphi(b)$};
    
      \draw[->] (1,0.5) to[out=40, in=160] node[above, midway] {$\varphi$} (3.5,0.5);
    
    \end{tikzpicture}
    \end{document}
    
    Je remets une capture d'écran car j'ai aussi raboté deux traits un peu longs que je ne trouvais pas très jolis.89134
  • Merci c'est top
  • En effet, je n'avais pas testé. Avec un peu plus de redondances.
      \fill (4.3,-0.15) circle(1.5pt) node[below] {$\varphi(a)$};
      \draw (4.3,-0.15) %node[below] {$\varphi(a)$}
            to[out angle=70, curve through={(5.3,0.6) .. (6,0.5)}]
            ([in angle=260]6.7,1);% ne semble pas mettre à jour le point courant (?)
      \fill (6.7,1) circle(1.5pt) node[above] {$\varphi(b)$}; % d'où la redondance ici :-/
    
Connectez-vous ou Inscrivez-vous pour répondre.