Crie um diagrama de resumo de assíntotas para uma função

Crie um diagrama de resumo de assíntotas para uma função

Gostaria que a figura se parecesse com o seguinte:

insira a descrição da imagem aqui

No entanto, a figura que produzi não corresponde a esta descrição T2 aqui estão minhas tentativas

\documentclass[]{article}
\usepackage[left=.5cm,right=.5cm,top=3cm,bottom=1cm]{geometry}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{esvect}
\usepackage{ifthen}
\usepackage{stmaryrd}
\usepackage{xspace}
\usepackage{mathtools}

\newcommand{\lm}[2]{\displaystyle{\lim_{{#1}\to {#2}}}}

\begin{document}

\begin{center}
\begin{tikzpicture}
\node[rectangle, draw=brown, fill=brown!75, minimum height=1cm, minimum width=5cm, rounded corners] (1) {$\lm{x}{\infty}f(x) = a$};
\node[rectangle, draw=brown, fill=brown!75, minimum height=1cm, minimum width=5cm, rounded corners, right= 1cm of 1] (2) {$\lm{x}{\infty}f(x) = \infty$};
\node[rectangle, draw=brown, fill=brown!75, minimum height=1cm, minimum width=5cm, rounded corners, right= 1cm of 2] (3) {$\lm{x}{a}f(x) = a$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=5cm, rounded corners, below left= 1cm and 0cm of 2] (4) {$\lm{x}{\infty}\left[f(x) - (ax - b)\right] = 0$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=4cm, rounded corners, right= 1mm of 4] (5) {$\lm{x}{\infty}\dfrac{f(x)}{x} = a \ ; \ a \neq 0$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, right= 1mm of 5] (6) {$\lm{x}{\infty}\dfrac{f(x)}{x} = \infty$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, right= 1mm of 6] (7) {$\lm{x}{\infty}\dfrac{f(x)}{x} = 0$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, below left= 1cm and -2cm of 5] (8) {$\lm{x}{\infty}\left[f(x) - ax\right] = b$};
\node[rectangle, draw=cyan, fill=cyan!50, minimum height=1cm, minimum width=3cm, rounded corners, right= 1mm of 8] (9) {$\lm{x}{\infty}\left[f(x) - ax\right] = \infty$};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, below left = 1cm and 2cm of 8] (10) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ asymptote horizontale \\ d'équation $y=a$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 10] (11) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ asymptote oblique \\ d'équation $y=ax+b$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 11] (12) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ branche parabolique \\ de direction la droite \\ d'équation $y=ax$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 12] (13) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ branche parabolique \\ de direction l'axe des ordonnées \\ d'équation $y=ax$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 13] (14) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ branche parabolique \\ de direction l'axe des abscisses \\ d'équation $y=ax$ \\ au voisinage de $\infty$
\end{minipage}};
\node[rectangle, draw=green, fill=green!50, minimum height=5cm, rounded corners, right = 1mm of 14] (15) {
\begin{minipage}{2.5cm}
$(C_f)$ admet une \\ asymptote verticale \\ d'équation $x=a$
\end{minipage}};
\draw[blue, very thick,-latex] ([xshift=-2cm]1.south) -- ([xshift=-1cm] 10.north);
\draw[blue, very thick,-latex] ([xshift=2cm]3.south) -- ([xshift=1cm] 15.north);
\draw[blue, very thick,-latex] ([xshift=-1mm]2.south) -- (4.north);
\draw[blue, very thick,-latex] (2.south) -- (5.north);
\draw[blue, very thick,-latex] ([xshift=1mm]2.south) -- (6.north);
\draw[blue, very thick,-latex] ([xshift=3mm]2.south) -- (7.north);
\draw[blue, very thick,-latex] (5.south) -- (8.north);
\draw[blue, very thick,-latex] (5.south) -- (9.north);
\draw[blue, very thick,-latex] (4.south) -- (11.north);
\draw[blue, very thick,-latex] (8.south) -- (11.north);
\draw[blue, very thick,-latex] (9.south) -- (12.north);
\draw[blue, very thick,-latex] (6.south) -- (13.north);
\draw[blue, very thick,-latex] (7.south) -- (14.north);
\end{tikzpicture}
\end{center}

\end{document}

Responder1

Aqui está uma maneira de fazer isso, reutilizando sua abordagem tanto quanto possível. Porém, para a colocação existem alternativas melhores e mais consistentes. Pelo menos é um melhor ponto de partida.

Por favor, siga o flow of changesmeu comentário:

% ~~~ REFACTORING ~~~~~~~~~~~~
% * commented out unsused packages
% * defining styles to simplify code (you can still remove or vary all those \\)
% * adjusted code indenting and formatting for better visibility of what's going on
% * tried \def vs. \newcommand, which seems to be a bit faster during compile
%   (Tikz seems to prefer TeX-notation here)
% * demonstrated refactoring for the connectors: (2) -- (4), (5) -- (8)

The stylesrelacionados a cores, tamanhos, etc. poderiam ser refatorados ainda mais, mas são bons o suficiente por enquanto. O mesmo vale para os turnos.

Please look uptodos esses detalhes em paralelo nopgfmanual.

For the brown rowAdotei a sua abordagem, simplificando a mudança, ou seja, substituindo o seu direito de opção (o que causou um erro conforme declarado).

For the other onesa abordagem é diferente:

  • coloque o primeiro (mais à esquerda) \nodeem uma posição absoluta
  • coloque-os de leste para oeste com algum deslocamento x entre eles, definido em XSBLetc.

The text in the green boxespode ser melhor controlado no Tikz via text width=e align=, vejapgfmanual. Eles \\não são mais necessários na minha abordagem, mas você ainda pode usá-los para controlar melhor o fluxo do texto.

The changes for the connectorsDemonstrei para linhas (2) -- (4)e (5) -- (8), deixando ajustes detalhados para vocês:

  • o primeiro é direto,
  • o segundo requer um ponto intermediário, dado em coordenadas relativas
  • ! o deslocamento para baixo E o raio do canto podem levar a artefatos!

The key syntax hereestá usando a coordenada polar <node name>.<angle>. Por exemplo, (2.185)pega o nó (2), irradia um feixe a partir do centro e do ângulo deste nó 185deg(ou um pouco além do oeste em termos náuticos), até cruzar com o limite do nó. Dessa forma, você pode mover os pontos inicial e final da maneira que desejar.

Lots is left for youem termos de ajustes, basicamente:

  • as mudanças em XSB, XSBLeXSG
  • os ângulos polares para cada nó
  • talvez as posições absolutas dos nós esquerdos

Putting an arrow midwayé possível, mas requer alguma decoração, o que aumenta o tempo de compilação na maioria das vezes. Você realmente precisa?

Finallyé sempre uma boa ideia fazer uma codificação limpa desde o início e refatorar sempre que possível.

resultado

% ~~~ REFACTORING ~~~~~~~~~~~~
% * commented out unsused packages
% * defining styles to simplify code (you can still remove or vary all those \\)
% * adjusted code indenting and formatting for better visibility of what's going on
% * tried \def vs. \newcommand, which seems to be a bit faster during compile
%   (Tikz seems to prefer TeX-notation here)
% * demonstrated refactoring for the connectors: (2) -- (4), (5) -- (8)

\documentclass[]{article}
\usepackage[left=.5cm,right=.5cm,top=3cm,bottom=1cm]{geometry}
\usepackage{tikz}
\usetikzlibrary{arrows.meta}    % <<<
%\usepackage{tkz-euclide}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsfonts}
%\usepackage{esvect}
%\usepackage{ifthen}
%\usepackage{stmaryrd}
%\usepackage{xspace}
%\usepackage{mathtools}

%\newcommand{\lm}[2]{\displaystyle{\lim_{{#1}\to {#2}}}}
\def\lm#1#2{\displaystyle{\lim_{{#1}\to {#2}}}}

\begin{document}

\begin{center}
 \begin{tikzpicture}[
    DIM/.style={ minimum height=1cm, minimum width=5cm, rounded corners},
    A/.style={draw=brown, fill=brown!75,DIM},
    B/.style={draw=cyan,  fill=cyan!50, DIM,minimum width=3cm},
    C/.style={draw=green, fill=green!50, minimum height=5cm, 
              rounded corners,align=center,text width=25mm},
    XSB/.style ={xshift=73mm},
    XSBL/.style={anchor=west,xshift=2mm},   
    XSG/.style ={anchor=west,xshift=4mm},
    ARR/.style ={blue, very thick,->,rounded corners=16pt},
    > = {Stealth},  
 ]
    % ~~~ brown row ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    \node[A,anchor=west] (1) at (0,0)         {$\lm{x}{\infty}f(x) = a$};
    \node[A] (2)             at ([XSB] 1)     {$\lm{x}{\infty}f(x) = \infty$};
    \node[A] (3)             at ([XSB] 2)     {$\lm{x}{a}f(x) = a$};
    
    % ~~~ 1st blue row ~~~~~~~~~~~~~~~~~~~~~~~~~
    \node[B,anchor=west]      (4) at (2,-3)   {$\lm{x}{\infty}\left[f(x) - (ax - b)\right] = 0$};
    \node[B,XSBL] (5) at (4.east) {$\lm{x}{\infty}\dfrac{f(x)}{x} = a \ ; \ a \neq 0$};
    \node[B,XSBL] (6) at (5.east) {$\lm{x}{\infty}\dfrac{f(x)}{x} = \infty$};
    \node[B,XSBL] (7) at (6.east) {$\lm{x}{\infty}\dfrac{f(x)}{x} = 0$};
    
    % ~~~ 2nd blue row ~~~~~~~~~~~~~
    \node[B,anchor=west]      (8) at (4,-6)   {$\lm{x}{\infty}\left[f(x) - ax\right] = b$};
    \node[B,XSBL] (9) at (8.east) {$\lm{x}{\infty}\left[f(x) - ax\right] = \infty$};
    
    % ~~~ green row ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    \node[C,anchor=west] (10) at (0,-12){
                                $(C_f)$ admet une  asymptote horizontale  
                                d'équation $y=a$ \\ au voisinage de $\infty$};
    \node[C,XSG] (11) at (10.east) {
                                $(C_f)$ admet une \\ asymptote oblique \\
                                d'équation $y=ax+b$ \\ au voisinage de $\infty$};
    \node[C,XSG] (12) at (11.east) {
                                $(C_f)$ admet une \\ branche parabolique \\ 
                                de direction la droite \\ d'équation $y=ax$ \\ 
                                au voisinage de $\infty$};
    \node[C,XSG] (13) at (12.east) {
                                $(C_f)$ admet une \\ branche parabolique \\ 
                                de direction l'axe des ordonnées \\ d'équation 
                                $y=ax$ \\ au voisinage de $\infty$};
    \node[C,XSG] (14) at (13.east) {
                                $(C_f)$ admet une \\ branche parabolique \\ 
                                de direction l'axe des abscisses \\
                                d'équation $y=ax$ \\ au voisinage de $\infty$};
    \node[C,XSG] (15) at (14.east) {
                                $(C_f)$ admet une \\ asymptote verticale 
                                \\ d'équation $x=a$};
    
%   % ~~~ connectors ~~~~~~~~~~~~~~~~
    \draw[ARR] ([xshift=-2cm]1.south) -- ([xshift=-1cm] 10.north);
    \draw[ARR] ([xshift=2cm]3.south) -- ([xshift=1cm] 15.north);
    
    % ~~~ TO DO: rework all other \draw's like this one: ~~~~~~~~~
    \draw[ARR] (2.185) -| (4.20);
    
    \draw[blue, very thick,-latex] (2.south) -- (5.north);
%   \draw[blue, very thick,-latex] ([xshift=1mm]2.south) -- (6.north);
%   \draw[blue, very thick,-latex] ([xshift=3mm]2.south) -- (7.north);

    \draw[ARR] (5.230) -- ++(0,-.6) -| (8.north);


%   \draw[blue, very thick,-latex] (5.south) -- (9.north);
%   \draw[blue, very thick,-latex] (4.south) -- (11.north);
%   \draw[blue, very thick,-latex] (8.south) -- (11.north);
%   \draw[blue, very thick,-latex] (9.south) -- (12.north);
%   \draw[blue, very thick,-latex] (6.south) -- (13.north);
%   \draw[blue, very thick,-latex] (7.south) -- (14.north);
 \end{tikzpicture}
\end{center}

\end{document}

informação relacionada