tikz 繪製複對數

tikz 繪製複對數

我想繪製複對數(虛部),定義如下:

ln(z) = ln(r) + i * arg(z)

這應該看起來像。但是,我沒有 3 維/複雜 tikz 圖的經驗,並且不知道正確繪製此函數的符號。

答案1

pgfplots無法處理開箱即用的複雜座標。然而,在這種情況下,我認為也沒有必要。您希望描繪一個映射 \mathds{C}\to\mathds{C},這對於 3d 圖來說是不可能的,但您的目標結果似乎是一個 3d 圖。要產生類似的東西,您可以使用自己的座標

({x*cos(y)},{x*sin(y)},{ln(x)+y})

其中x是半徑,y是相位。現在有一個問題,我們只有 3 個座標可供使用。在域中使用了兩個之後,我們需要使用投影。我不知道您在使用的圖像中使用什麼投影,但以下似乎很接近:

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16,width=10cm,height=14cm}
\begin{document}
\begin{tikzpicture}
\begin{axis}[trig format plots=rad,view={-50}{12},
    colormap={adopted}{rgb255(0cm)=(151,0,250);
    rgb255(1cm)=(219,0,70);rgb255(2cm)=(186,255,60)},
    z buffer=sort,zmin=-3.5*pi]
\addplot3 [surf,domain=0.001:4,domain y=-3*pi:3*pi,samples=25,samples y=109]
({x*cos(y)},{x*sin(y)},{ln(x)+y});
\end{axis}
\end{tikzpicture}
\end{document}

在此輸入影像描述

或使用不同的角度。

\documentclass[tikz,border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16,width=10cm,height=14cm}
\begin{document}
\begin{tikzpicture}
\begin{axis}[trig format plots=rad,view={70}{20},
    colormap={adopted}{rgb255(0cm)=(151,0,250);
    rgb255(1cm)=(219,0,70);rgb255(2cm)=(186,255,60)},
    z buffer=sort,zmin=-3.5*pi]
\addplot3 [surf,domain=0.001:4,domain y=-3*pi:3*pi,samples=25,samples y=109]
({x*cos(y)},{x*sin(y)},{ln(x)+y});
\end{axis}
\end{tikzpicture}
\end{document}

在此輸入影像描述

如果您想使用另一個投影,您也可以內建它。

相關內容