![Tikz:曾经被刺穿的圆环?](https://linux22.com/image/315200/Tikz%EF%BC%9A%E6%9B%BE%E7%BB%8F%E8%A2%AB%E5%88%BA%E7%A9%BF%E7%9A%84%E5%9C%86%E7%8E%AF%EF%BC%9F.png)
我想要绘制一个曾经被刺破的圆环,看起来像这样:
我已经画出了图表的某些部分:
\documentclass[10.5pt,a4paper]{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
%Hole
\begin{scope}[scale=0.8]
\path[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0) (-.9,0)--(0,-.56)-- (.9,0);
\draw[rounded corners=28pt] (-1.1,.1)--(0,-.6)--(1.1,.1);
\draw[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0);
\end{scope}
%Cut 1
\draw[densely dashed,red] (0,-1.3) arc (270:90:.2 and 0.550);
\draw[red,->] (0,-1.3) arc (-90:90:.2 and .550);
%Cut 2
\draw[blue,->] (0,0) ellipse (1.5 and 0.8);
\node at (0.19,-0.79) {$\textbf{.}$};
\node at (0.4,-1) {$x_0$};
\node at (-0.4,1) {$\textcolor{blue}{\gamma_1}$};
\node at (-0.4,-0.5) {$\textcolor{red}{\gamma_2}$};
%Cut 3
\draw[] (3,-0.5) arc (270:90:.2 and 0.550);
\draw[] (3,-0.5) arc (-90:90:.2 and .550);
\end{tikzpicture}
\end{center}
\end{document}
这给了我
但我不知道如何绘制圆环的轮廓。有什么想法吗?
答案1
使用上述tqft
包:
\documentclass{standalone}
%\url{http://tex.stackexchange.com/q/255318/86}
\usepackage{tikz}
\usetikzlibrary{tqft}
\begin{document}
\begin{tikzpicture}[rotate=90]
\pic[
transform shape,
name=a,
tqft,
cobordism edge/.style={draw},
incoming boundary components=0,
outgoing boundary components=2,
];
\draw[red] (a-outgoing boundary 1.center) to[out=90,in=90,looseness=1.25] (a-outgoing boundary 2.center) to[out=-90,in=-90,looseness=1.25] (a-outgoing boundary 1.center);
\pic[
transform shape,
tqft,
cobordism edge/.style={draw},
every outgoing boundary component/.style={draw,red!50!black},
incoming upper boundary component 2/.style={draw,blue},
incoming lower boundary component 2/.style={draw,dotted,blue},
incoming boundary components=2,
outgoing boundary components=1,
offset=.5,
at=(a-outgoing boundary),
anchor=incoming boundary,
];
\end{tikzpicture}
\end{document}
答案2
请参阅 TikZ 手册第 753 页。
\documentclass[border=.1in]{standalone}
\usepackage{tikz}
\usepackage{mathtools}
\begin{document}
\begin{minipage}{4in}
\begin{center}
\begin{tikzpicture}
%Hole
\begin{scope}[scale=0.8]
\path[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0) (-.9,0)--(0,-.56)-- (.9,0);
\draw[rounded corners=28pt] (-1.1,.1)--(0,-.6)--(1.1,.1);
\draw[rounded corners=24pt] (-.9,0)--(0,.6)--(.9,0);
\end{scope}
%Cut 1
\draw[densely dashed,red] (0,-1.3) arc (270:90:.2 and 0.550);
\draw[red,->] (0,-1.3) arc (-90:90:.2 and .550);
%Cut 2
\draw[blue] (1.0605,0.5656) arc (45:315:1.5 and 0.8);
\draw[blue] (1.0605,0.5656) to[out=-28.1,in=200] (3,.6);
\draw[blue] (1.0605,-0.5656) to[out=28.1,in=160] (3,-.5);
\node at (0.19,-0.79) {$\textbf{.}$};
\node at (0.4,-1) {$x_0$};
\node at (-0.4,1) {$\textcolor{blue}{\gamma_1}$};
\node at (-0.4,-0.5) {$\textcolor{red}{\gamma_2}$};
%Cut 3
\draw[] (3,-0.5) arc (270:90:.2 and 0.550);
\draw[] (3,-0.5) arc (-90:90:.2 and .550);
\end{tikzpicture}
\end{center}
An ellipse is given by
\[ \frac{x^2}{a^2} + \frac{y^2}{b^2} = 1 \]
where $a$ and $b$ are the respective radii for $x$ and $y$.
From
\[ y = b\sqrt{1-x^2/a^2} \]
we see that the slope at point $(x,y)$ is given by
\begin{align*}
\frac{dy}{dx} &= - \frac{bx}{a^2} \left(1-x^2/a^2\right)^{-1/2} \\
&= - \frac{b^2x}{a^2y} \quad.
\end{align*}
So for $a=1.5$, $b=.8$, $x=1.0605$ and $y=0.5656$ we get a slope of
$-0.5333$ or an angle of about $-28.1^\circ$.
\end{minipage}
\end{document}