![绘制单位球的“厚”子集](https://linux22.com/image/394093/%E7%BB%98%E5%88%B6%E5%8D%95%E4%BD%8D%E7%90%83%E7%9A%84%E2%80%9C%E5%8E%9A%E2%80%9D%E5%AD%90%E9%9B%86.png)
\begin{tikzpicture}
\shade[ball color=blue, opacity=0.4] (0,0) circle (2);
\draw (0,0) circle (2);
\fill[fill=blue!80,rotate around={60:(1,1)}] (1,1) ellipse (0.3 and 0.5);
\draw[rotate around={60:(1,1)}] (1,1) ellipse (0.3 and 0.5);
\node at (1,1) {$A$};
\end{tikzpicture}
我想绘制$\{tx | x\in A,\: t\in (1-\epsilon,1+\epsilon)\}$
小 epsilon 的集合。这个集合就像 A 从薄区域“变换”到“稍厚”的区域。
从原点到 A 画一个“圆锥体”并超越它可能是不错的主意,这样观察者就能明白我们在做什么。
我们怎样才能做到这一点?
答案1
对于 3d 坐标,您可以使用它tikz-3dplot
来实现适当的正交投影。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\begin{document}
\begin{tikzpicture}[rotate=-30]
\draw[ball color=blue,fill opacity=0.4] (0,0) coordinate(O) circle (2);
\tdplotsetmaincoords{50}{00}
\begin{scope}[tdplot_main_coords]
\draw[fill=red,fill opacity=0.2] (O) --
plot[smooth,variable=\x,
domain={\tdplotmainphi-90/cot(\tdplotmaintheta)}:{\tdplotmainphi+90/cot(\tdplotmaintheta)}]
(xyz spherical cs:radius=2.5,latitude=70,longitude=\x) -- cycle;
\draw[fill=blue] plot[smooth,variable=\x,domain=0:360]
(xyz spherical cs:radius=2,latitude=70,longitude=\x);
\node at (0,0,2) {A};
\draw[fill=red,fill opacity=0.2] (O) --
plot[smooth,variable=\x,
domain={\tdplotmainphi+90/cot(\tdplotmaintheta)}:{\tdplotmainphi+360-90/cot(\tdplotmaintheta)}]
(xyz spherical cs:radius=2.5,latitude=70,longitude=\x) -- cycle;
\draw[fill=red,fill opacity=0.2] plot[smooth,variable=\x,domain=0:360]
(xyz spherical cs:radius=2.5,latitude=70,longitude=\x);
\end{scope}
\end{tikzpicture}
\end{document}
这使得蓝色区域变得“厚”。
\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\usetikzlibrary{3d}
\begin{document}
\begin{tikzpicture}[rotate=-30]
\draw[ball color=blue,fill opacity=0.4] (0,0) coordinate(O) circle (2);
\tdplotsetmaincoords{50}{00}
\begin{scope}[tdplot_main_coords]
\draw[dashed] (O) --
plot[smooth,variable=\x,
domain={\tdplotmainphi-90/cot(\tdplotmaintheta)}:{\tdplotmainphi+90/cot(\tdplotmaintheta)}]
(xyz spherical cs:radius=2.5,latitude=70,longitude=\x) -- cycle;
\draw[fill=blue] plot[smooth,variable=\x,domain=0:360]
(xyz spherical cs:radius=2.1,latitude=70,longitude=\x);
\draw[fill=blue!70]
plot[smooth,variable=\x,domain={\tdplotmainphi+90/cot(\tdplotmaintheta)}:{\tdplotmainphi+360-90/cot(\tdplotmaintheta)}]
(xyz spherical cs:radius=2,latitude=70,longitude=\x)
--
plot[smooth,variable=\x,domain={\tdplotmainphi+360-90/cot(\tdplotmaintheta)}:{\tdplotmainphi+90/cot(\tdplotmaintheta)}]
(xyz spherical cs:radius=2.1,latitude=70,longitude=\x) ;
\node at (0,0,2) {A};
\draw[dashed] (O) --
plot[smooth,variable=\x,
domain={\tdplotmainphi+90/cot(\tdplotmaintheta)}:{\tdplotmainphi+360-90/cot(\tdplotmaintheta)}]
(xyz spherical cs:radius=2.5,latitude=70,longitude=\x) -- cycle;
\end{scope}
\end{tikzpicture}
\end{document}