9

I want to first draw a shaded region on a xy-plane:

0≤x

0≤y≤π

and then the image of the above region mapped onto a uv-plane by the transformation f=exp(z), i.e. the shaded region:

exp(0)≤ρ

0≤θ≤π

However, I don't even know where to start as I am new to LaTeX plotting. Any idea involving tools such as TikZ, pgfplots, and even GNUplot is welcome.

More about the question:

Basically what I want is graphs that looks like these enter image description here

except that in my case A will be (0,0) and D will be (0,π) and B, C will be at infinity (so, two rays) for the left graph; for the right one A' will be (e,0) and D' will be (-e,0) and A' D' are connected by a semicircle.

Francis
  • 6,183

2 Answers2

11

Remarks

The paths with the arrows inside needed some extra attention, but on this great site I found a way to do it, of course :-). For more see this post: TikZ: How to draw an arrow in the middle of the line?


The picture in your post

I recreated the picture in your post with TikZ.

Implementation

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.markings}
\tikzset{
    arrow inside/.style = {
        postaction = {
            decorate,
            decoration={
                markings,
                mark=at position 0.5 with {\arrow{>}}
            }
        }
    }
}
\begin{document}
\begin{tikzpicture}[>=latex,scale=1.5]
    \begin{scope}
        % Axes
        \draw (0,0) node[below left] {$O$}
            (-0.5,0) -- (4,0) node[below] {$x$}
            (0,-0.5) -- (0,3) node[left] {$y$};
        % Ticks
        \draw (1,0) -- (1,-0.1) node[below] {$a$}
            (3,0) -- (3,-0.1) node[below] {$b$}
            (0,1) -- (-0.1,1) node[left] {$c$}
            (0,2) -- (-0.1,2) node[left] {$d$};
        % Square
        \draw[thick] (1,1) node[below left] {$A$} --
            (3,1) node[below right] {$B$} --
            (3,2) node[above right] {$C$} --
            (1,2) node[above left] {$D$} -- cycle;
        \draw[arrow inside] (1.5,1) -- (1.5,2);
    \end{scope}

    \begin{scope}[xshift=6cm]
        % Axes
        \draw (0,0) node[below left] {$O$}
            (-0.5,0) -- (4,0) node[below] {$u$}
            (0,-0.5) -- (0,3) node[left] {$v$};
        %Help Lines
        \draw (0,0) -- (30:3) (0,0) -- (70:3);
        % Angles 
        \draw[->] (0.6,0) arc[start angle=0, end angle=70, radius=0.6] node[above right] {\small $\phi = d$};
        \draw[->] (0.8,0) node[above right] {\small$\phi = c$} arc[start angle=0, end angle=30, radius=0.8];
        % Transformation
        \draw[thick] (30:1.5) node[right] {$A'$} --
            (30:3) node[below right] {$B'$} arc[start angle=30, end angle=70, radius=3]
            (70:3) node[above right] {$C'$} --
            (70:1.5) node[above left] {$D'$} arc[start angle=70, end angle=30, radius=1.5];
            \draw[arrow inside] (30:1.9) arc[start angle=30, end angle=70, radius=1.9];
    \end{scope}
\end{tikzpicture}
\end{document}

Output

I hope, you are satisfied.

transform


From your description

I don't know, if I got your description right, but based on it I did the following

Implementation

\documentclass[tikz]{standalone}
\usetikzlibrary{decorations.markings}
\tikzset{
    arrow inside/.style = {
        postaction = {
            decorate,
            decoration={
                markings,
                mark=at position #1 with {\arrow{>}}
            }
        }
    },
    arrow inside/.default = 0.5
}
\begin{document}
\begin{tikzpicture}[>=latex]
    \begin{scope}
        % Axes
        \draw (0,0) node[below left] {$O$}
            (-0.5,0) -- (5,0) node[below] {$x$}
            (0,-0.5) -- (0,4) node[left] {$y$};
        % Ticks
        \draw (0,pi) -- (-0.1,pi) node[left] {$\pi$};
        % Square
        \draw[thick] (4.5,0) --
            (0,0) node[above left] {$A$} --
            (0,pi) node[above right] {$D$} --
            (4.5,pi);
        \draw[arrow inside] (1.5,0) -- (1.5,pi);
    \end{scope}

    \begin{scope}[xshift=10cm]
        % Axes
        \draw (0,0) node[below left] {$O$}
            (-4,0) -- (4,0) node[below] {$u$}
            (0,-0.5) -- (0,3.5) node[left] {$v$};
        % Ticks
        \draw (e,0) -- (e,-0.1) node[below] {$\mathrm{e}$}
            (-e,0) -- (-e,-0.1) node[below] {$-\mathrm{e}$};
        % Transformation
        \draw[thick] (3.8,0) --
            (e,0) node[above left] {$A'$}
            arc[start angle=0, end angle=180, radius=e]
            (-e,0) node[above right] {$D'$} --
            (-3.8,0);
        \draw[arrow inside=0.4] (3.2,0) arc[start angle=0, end angle=180, radius=3.2];
    \end{scope}
\end{tikzpicture}
\end{document}

Output

your one

Henri Menke
  • 109,596
4

With PSTricks: Just for fun!

Figure 1:

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add,pst-eucl}
\begin{document}
% canvas
\begin{pspicture}(-1,-1)(5,4)
    % axes without ticks and tick labels
    \psaxes[ticks=none,labels=none](0,0)(-1,-1)(5,4)[$x$,-90][$y$,180]
    % rectangle with labels
    \pstGeonode[PointSymbol=none,PosAngle={-135,-45,45,135},CurveType=polygon]
        (1,1){A}(4,1){B}(4,3){C}(1,3){D}
    % a line with arrow head at the middle part
    \psline[ArrowInside=->](2,1)(2,3)
    % ticks in x axis
    \psset{ticksize=0pt -3pt}
    \psxTick(1){a}
    \psxTick(4){b}
    % ticks in y axis
    \psset{ticksize=0pt -3pt}
    \psyTick(1){c}
    \psyTick(3){d}
    % origin label
    \uput[-135](0,0){$O$}
\end{pspicture}
\end{document}

enter image description here

Figure 2:

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pstricks-add,pst-eucl}
\everypsbox{\scriptsize}
\begin{document}
% canvas
\begin{pspicture}(-1,-1)(4,4)
    % axes without ticks and tick labels
    \psaxes[ticks=none,labels=none](0,0)(-1,-1)(4,4)[$u$,-90][$v$,180]
    % rectangle with labels
    \pstGeonode[PointSymbol=none,PosAngle={-45,-45,135,135}]
        (2;30){A'}(4;30){B'}(4;60){C'}(2;60){D'}
    \pscustom
    {
        \psline(A')(B')
        \psarc(0,0){4}{(B')}{(C')}
        \psline(C')(D')
        \psarcn(0,0){2}{(D')}{(A')}
        \closepath
    }
    % arc with middle arrow head
    \psarc(0,0){2.5}{(A')}{(D')}
    \psarc{->}(0,0){2.5}{(A')}{46.5}% trial and error approach!
    % line D'OA'
    \psline[linejoin=2](D')(0,0)(A')
    % arc and angle label
    \psset{arcsep=\pslinewidth,arrows=->,arrowscale=.75}
    \psarc(0,0){.5}{0}{(D')}
    \psarc(0,0){.75}{0}{(A')}
    \uput{.9}[15](0,0){$\phi=c$}
    \uput{.8}[51](0,0){$\phi=d$}
    % origin label
    \uput[-135](0,0){$O$}
\end{pspicture}
\end{document}

enter image description here