答案1
我认为隐式曲面可以在 Ti 中绘制钾当可以绘制水平曲线(或其他超平面截面)时,Z。对于表面xyz-x-y-z + 2 = 0(实际上对于任何值西塔(在问题中),水平曲线是双曲线,绘制起来并不困难。
一些评论
我改变了坐标,使奇点位于原点,即我考虑了由以下定义的表面xyz + xy + yz + zx = 0。这只是前一个的翻译。
看看给出的例子,我只表示了表面的“一片”;明确地,我考虑了立方体中表面的部分[-1, 5]^3并且只被每条树枝的一个分支扫过z=h双曲线。
为了z=0双曲线退化为两条线的并集。对于z=-1它又退化为两条线,但其中一条在无穷远处。出于这些原因,水平曲线的绘制取决于是. 在附近-1事情变得更加微妙,因为 Ti 的限制钾Z 很容易达到。例如,如果对或
\foreach
执行第一个操作,则获得的曲线不是“真实的”(或至少不是预期的)。\i=1
\i=2
代码可能看起来很长,但重要的是
\foreach
绘制z=h水平曲线。之后,只需复制和修改即可获得x=h和y=h等高曲线。双曲线的每个分支都绘制为参数化曲线;计算参数的界限以仅获取立方体内部的部分。
代码
\documentclass[margin=.5cm]{standalone}
\usepackage{tikz}
\usetikzlibrary{math}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\usetikzlibrary{arrows.meta}
\begin{document}
\xdefinecolor{Cy}{RGB}{17, 170, 187}
\xdefinecolor{VB}{RGB}{102, 25, 240}
\tikzmath{
integer \N-, \N+;
\N- = 12;
\N+ = 50;
real \a;
\a = 5;
}
\tikzset{
pics/level curve+/.style args={height=#1, varbound=#2, color=#3}{%
code={%
\draw[#3, variable=\t, domain=-#2:#2, samples=40]
plot ({#1/(#1 +1)*(exp(\t) -1)}, {#1/(#1 +1)*(exp(-\t) -1)});
}
},
pics/level curve-/.style args={height=#1, varbound=#2, color=#3}{%
code={%
\draw[#3, variable=\t, domain=-#2:#2, samples=40]
plot ({-#1/(#1 +1)*(exp(\t) +1)}, {-#1/(#1 +1)*(exp(-\t) +1)});
}
}
}
\begin{tikzpicture}
\tdplotsetmaincoords{76}{67}
\begin{scope}[tdplot_main_coords]
% axes first part
\draw (-1, 0, 0) -- (\a +.2, 0, 0);
\draw (0, -1, 0) -- (0, \a +.2, 0);
\draw (0, 0, -1) -- (0, 0, \a +.2);
%%% $z=h$ level curves
% close to $0^-$
\foreach \i
[evaluate=\i as \h using {-(\N- +1 -\i)/(\N- +1))*\a/(\a +1)},
evaluate=\i as \b using {ln(-(\h +1)*\a/\h -1)}]
in {1, 2, 3, 4, ..., \N-}{
\path[canvas is xy plane at z=\h, transform shape] (0, 0)
pic {level curve-={height=\h, varbound=\b, color=Cy}};
}
% $h=0$
\draw[Cy, canvas is xy plane at z=0] (0, \a) |- (\a, 0);
% $h>0$
\foreach \i
[evaluate=\i as \h using {(\i/\N+)*\a},
evaluate=\i as \b using {ln((\h +1)*\a/\h +1)}]
in {1, 2, ..., \N+}{
\path[canvas is xy plane at z=\h, transform shape] (0, 0)
pic {level curve+={height=\h, varbound=\b, color=Cy}};
}
%%% $y=h$ level curves
% close to $0^-$
\foreach \i
[evaluate=\i as \h using {-(\N- +1 -\i)/(\N- +1))*\a/(\a +1)},
evaluate=\i as \b using {ln(-(\h +1)*\a/\h -1)}]
in {3, 4, ..., \N-}{
\path[canvas is xz plane at y=\h, transform shape] (0, 0)
pic {level curve-={height=\h, varbound=\b, color=Cy}};
}
% $h=0$
\draw[Cy, thin, canvas is xz plane at y=0] (0, \a) |- (\a, 0);
% $h>0$
\foreach \i
[evaluate=\i as \h using {(\i/\N+)*\a},
evaluate=\i as \b using {ln((\h +1)*\a/\h +1)}]
in {1, 2, ..., \N+}{
\path[canvas is xz plane at y=\h, transform shape] (0, 0)
pic {level curve+={height=\h, varbound=\b, color=Cy}};
}
%%% $x=h$ level curves
% close to $0^-$
\foreach \i
[evaluate=\i as \h using {-(\N- +1 -\i)/(\N- +1))*\a/(\a +1)},
evaluate=\i as \b using {ln(-(\h +1)*\a/\h -1)}]
in {3, 4, ..., \N-}{
\path[canvas is yz plane at x=\h, transform shape] (0, 0)
pic {level curve-={height=\h, varbound=\b, color=Cy}};
}
% $h=0$
\draw[VB, canvas is yz plane at x=0] (0, \a) |- (\a, 0);
% $h>0$
\foreach \i
[evaluate=\i as \h using {(\i/\N+)*\a},
evaluate=\i as \b using {ln((\h +1)*\a/\h +1)}]
in {1, 2, ..., \N+}{
\path[canvas is yz plane at x=\h, transform shape] (0, 0)
pic {level curve+={height=\h, varbound=\b, color=VB}};
}
%%% axes second part
\begin{scope}[arrows={->[length=1ex, width=1.5ex]}]
\draw (\a, 0, 0) -- (\a +2, 0, 0) node[pos=1.2] {$x$};
\draw (0, \a, 0) -- (0, \a +2, 0) node[pos=1.2] {$y$};
\draw (0, 0, \a) -- (0, 0, \a +2) node[pos=1.2] {$z$};
\end{scope}
\end{scope}
\end{tikzpicture}
\end{document}