2

How to recreate this conformal map with TikZ? enter image description here

Oipl909
  • 147
  • 4

1 Answers1

6

A similar question has already been answered here. You should at least specify the transformation. The following may be a start.

\documentclass[tikz, border=0.5cm]{standalone}
\usepgfmodule{nonlineartransformations} 
\usetikzlibrary{fpu}
\makeatletter
\newcommand{\PgfmathsetmacroFPU}[2]{\begingroup% https://tex.stackexchange.com/a/503835
\pgfkeys{/pgf/fpu,/pgf/fpu/output format=fixed}%
\pgfmathsetmacro{#1}{#2}%
\pgfmathsmuggle#1\endgroup}%
\def\conformaltransformation{% similar to the pgfmanual section 103.4.2
\PgfmathsetmacroFPU{\myphase}{-45+atan2(\the\pgf@y,\the\pgf@x)}
\PgfmathsetmacroFPU{\myradius}{veclen(\pgf@y,\pgf@x)/1cm}
\PgfmathsetmacroFPU{\myx}{\myradius*\myradius*cos(2*\myphase)*0.15cm}%
\PgfmathsetmacroFPU{\myy}{\myradius*\myradius*sin(2*\myphase)*0.15cm}%
\pgf@x=\myx pt%
\pgf@y=\myy pt%
} 
\makeatother
\begin{document}

\begin{tikzpicture}[>=stealth] \begin{scope}[xshift=-8cm] \draw[red] foreach \y in {0.5,1,...,4} {(-2.3,\y) -- (2.3,\y)}; \draw[blue] foreach \x in {-2,-1.5,...,2} {(\x,0) -- (\x,4.3)}; \draw[<->] (-2.5,0) -- +(5,0); \draw[->] (0,0) -- +(0,5); \end{scope} \begin{scope} \pgftransformnonlinear{\conformaltransformation} \draw[red] foreach \y in {0.5,1,...,4} {(-2.3,\y) -- (2.3,\y)}; \draw[blue] foreach \x in {-2,-1.5,...,2} {(\x,0) -- (\x,4.3)}; \draw[<->] (-2.5,0) -- +(5,0); \draw[->] (0,0) -- +(0,5); \end{scope} \end{tikzpicture} \end{document}

enter image description here