绘制具有所需长轴和短轴的椭圆弧

绘制具有所需长轴和短轴的椭圆弧

因此,我给出两个点,并希望绘制一条连接它们的椭圆弧。更具体地说,我的代码如下:

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
[vertex/.style={circle,draw=black!100,fill=black!100,thick,inner sep=0pt,minimum size=1mm},]
\node (v1) at ( 0,0) [vertex,label=left:$v_1$] {};
\node (v2) at ( 1,0) [vertex,label=right:$v_2$] {};
\node (v3) at ( 1.35,1) [vertex,label=right:$v_3$] {};
\node (v4) at ( 0.5,1.75) [vertex,label=above:$v_4$] {};
\node (v5) at ( -0.35,1) [vertex,label=left:$v_5$] {};
\draw [-] (v1) to (v2);
\draw [-] (v2) to (v3);
\draw [-] (v3) to (v4);
\draw [-] (v4) to (v5);
\draw [-] (v5) to (v1);
\draw [-] (v3) to (v1);
%\draw [-] (v2) to [bend left=60] (v5);
\end{tikzpicture}
\end{figure}
\end{document}

我希望连接v2 to v5并且v2 to v4没有任何边缘相交。现在这只有在我们在五边形外绘制椭圆弧时才有可能。我该如何绘制它们?我无法利用左弯曲,因为它的弯曲程度不足以超出五边形。

答案1

有很多可能性,例如

%\draw [-] (v2) to [bend left=80, min distance=2cm] (v5);
%\draw [-] (v2) to [bend right=70, min distance=2cm] (v4);
%\draw [-] (v2) to [bend left=80, distance=2cm] (v5);
%\draw [-] (v2) to [bend right=70, distance=2cm] (v4);
\draw [-] (v2.center) to [controls=+(40:-2) and +(70:-2)] (v5.center);
\draw [-] (v2.center) to [controls=+(30:2) and +(30:2)] (v4.center);

用于控制bend操作的参数的详细信息可以在pgfmanual文档第 751 页(特别是 755 和 756 页)及第 70 节中找到。

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{figure}[H]
\centering
\begin{tikzpicture}
[vertex/.style={circle,draw=black!100,fill=black!100,thick,inner sep=0pt,minimum size=1mm},]
\node (v1) at ( 0,0) [vertex,label=left:$v_1$] {};
\node (v2) at ( 1,0) [vertex,label=right:$v_2$] {};
\node (v3) at ( 1.35,1) [vertex,label=right:$v_3$] {};
\node (v4) at ( 0.5,1.75) [vertex,label=above:$v_4$] {};
\node (v5) at ( -0.35,1) [vertex,label=left:$v_5$] {};
\draw [-] (v1) to (v2);
\draw [-] (v2) to (v3);
\draw [-] (v3) to (v4);
\draw [-] (v4) to (v5);
\draw [-] (v5) to (v1);
\draw [-] (v3) to (v1);
%\draw [-] (v2) to [bend left=80, min distance=2cm] (v5);
%\draw [-] (v2) to [bend right=70, min distance=2cm] (v4);
%\draw [-] (v2) to [bend left=80, distance=2cm] (v5);
%\draw [-] (v2) to [bend right=70, distance=2cm] (v4);
\draw [-] (v2.center) to [controls=+(40:-2) and +(70:-2)] (v5.center);
\draw [-] (v2.center) to [controls=+(30:2) and +(30:2)] (v4.center);

\end{tikzpicture}
\end{figure}
\end{document}

在此处输入图片描述

您可以调整角度和距离,如下所示

\draw [-] (v2.center) to [controls=+(30:-3) and +(50:-3)] (v5.center);
\draw [-] (v2.center) to [controls=+(30:3) and +(30:3)] (v4.center);

这使

在此处输入图片描述

相关内容