如何用 TikZ 重新创建此保角地图?

如何用 TikZ 重新创建此保角地图?

如何用 TikZ 重新创建此保角地图?在此处输入图片描述

答案1

类似的问题已经回答过了这里。您至少应该指定转换。以下内容可能是一个开始。

\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}

在此处输入图片描述

相关内容