TikZ:非線性正切曲線

TikZ:非線性正切曲線

我想畫一條從點到點的切線(a)(b)相交點(c)(正方形的中心)。曲線應根據灰線(對數刻度)進行拉伸。我已經玩過controls,但我沒有走太遠。還有比使用更好的方法嗎controls

到目前為止我的程式碼:

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[every node/.style = {draw, circle, fill=white, inner sep=.01cm}]

\draw (0, 1) -- (10, 1) -- (10, -1) -- (0, -1) -- cycle;
\node (a) at (0, -1) {a};   % south-west corner
\node (b) at (10, 1) {b};   % north-east corner
\node (c) at (5, 0) {c};    % center
\foreach \n in {1,...,50} \draw[gray, very thin]
        ({10/pow(2, \n/12)}, 1)
    --  ({10/pow(2, \n/12)}, -1);

\draw[cyan] (a) -- (b);

\end{tikzpicture}
\end{document}

結果: 在此輸入影像描述

我想要實現的目標如下(儘管曲線的左半部應該會下降得更快): 在此輸入影像描述

答案1

也許這更接近一些?

\documentclass{standalone}
\usepackage{tikz}
\usetikzlibrary{calc}
\begin{document}
\begin{tikzpicture}[every node/.style = {draw, circle, fill=white, inner sep=.01cm}]

\draw (0, 1) -- (10, 1) -- (10, -1) -- (0, -1) -- cycle;
\node (a) at (0, -1) {a};   % south-west corner
\node (b) at (10, 1) {b};   % north-east corner
\node (c) at (5, 0) {c};    % center
\foreach \n in {1,...,50} \draw[gray, very thin]
        ({10/pow(2, \n/12)}, 1)
    --  ({10/pow(2, \n/12)}, -1);

\draw[thick,cyan] (a) to[out=0,in=270,looseness=0.55] (c.center) to[out=65,in=180,looseness=0.5] (b);

\end{tikzpicture}
\end{document}

在此輸入影像描述

答案2

這是我從您的評論中的描述中得到的資訊。我接近你的想法嗎?如果沒有,也許你可以提供一個手繪模型。

這?

\usetikzlibrary{calc}
\begin{tikzpicture}[every node/.style = {draw, circle, fill=white, inner sep=.01cm}]

\draw (0, 1) -- (10, 1) -- (10, -1) -- (0, -1) -- cycle;
\node (a) at (0, -1) {a};   % south-west corner
\node (b) at (10, 1) {b};   % north-east corner
\node (c) at (5, 0) {c};    % center
\foreach \n in {1,...,50} \draw[gray, very thin]
        ({10/pow(2, \n/12)}, 1)
    --  ({10/pow(2, \n/12)}, -1);

\draw[cyan] (a) .. controls +(5, 0) and +(-.5, -.5) .. (c.center) .. controls +(.5,.5) and +(-1,0) .. (b);
\end{tikzpicture}

相關內容