在圆弧上绘制边

在圆弧上绘制边

我想在圆弧上的两个节点之间画一条边。对于小角度,我可以通过向左弯曲和向右弯曲来获得或多或少逼真的外观,但对于大距离,例如将位于 90° 的节点与位于 225° 的节点连接起来,效果会变得很丑陋。

但是,单独绘制圆弧不会绘制箭头,也不会在节点的“边界”处结束,而是在节点的中心结束。那么有没有解决方案,例如在构建路径时指定“边缘”参数,以便我可以指定它应该位于的圆弧?

以下是一个例子:

在此处输入图片描述

\documentclass{scrartcl}
\usepackage{tikz}
\begin{document}

\begin{tikzpicture}
\node (V1) at (0,8) {$\o{v}_1$};
\node (V3) at (4,4) {$\o{v}_2$};
\node (V5) at (0,0) {$\o{v}_3$};
\node (V6) at (-2.83,1.17) {$\o{v}_4$};

\node at (0,4) {$\o{C}$};

\path   (V1) edge[bend left=45] node[above right] {$\o{g}_1(x)$} (V3)
        (V5) edge[bend right=45] node[below right] {$\o{g}_2(x)$} (V3)
        (V5) edge[bend left=15] node[below] {$\o{g}_3(x)$} (V6)
        (V1) edge[bend right=70] node[above left] {$\o{g}_4(x)$} (V6);
\end{tikzpicture}
\end{document}

虽然路径的前三个边看起来或多或少像是位于一个圆圈上,但第四个边却使圆圈变成了一个土豆。

答案1

你说:

单独绘制圆弧不会绘制箭头,也不会在节点的“边界”处结束,而是在中心处结束

(*顺便说一下,他们的中心)

但这并不完全正确;您可以尝试使用 的解决方法arc。例如:

\draw [right, ->] (0.3,8) arc [radius=4, start angle=90, end angle= 0];

将从 V1 画一个箭头到几乎 V2。

通过调整半径和节点的位置,你可以画出圆圈(带箭头,见上文->

编辑:

为了避免在起始位置附近徘徊,您可以使用节点锚点:

\draw [->] (V1.east) arc [radius=4, start angle=90, end angle= 0];

答案2

另一个arc解决方案:

\documentclass{scrartcl}
\usepackage{tikz}
\usetikzlibrary{positioning}
\begin{document}

\begin{tikzpicture}
\node (V1) at (0,8) {$\o{v}_1$};
\node (V3) at (4,4) {$\o{v}_2$};
\node (V5) at (0,0) {$\o{v}_3$};
\node (V6) at (-2.83,1.17) {$\o{v}_4$};

\node at (0,4) {$\o{C}$};

\draw[-latex,shorten <= 10pt,shorten >= 10pt] (V1) arc(90:0:4cm) node[above right=3ex and .5ex] {$\o{g}_1(x)$} (V3);
\draw[-latex,shorten <= 10pt,shorten >= 10pt] (V5) arc(-90:0:4cm) node[below right=3ex and .5ex] {$\o{g}_2(x)$} (V3);
\draw[-latex,shorten <= 10pt,shorten >= 10pt] (V5) arc(270:225:4cm) node[below right=3ex and -2.5ex] {$\o{g}_3(x)$} (V6);
\draw[-latex,shorten <= 10pt,shorten >= 10pt]        (V1) arc(90:225:4cm) node[above left =1ex and 2.5ex] {$\o{g}_4(x)$} (V6);
\end{tikzpicture}
\end{document}

在此处输入图片描述

根据口味调整start angleend angleshorten<=和)的距离。>=

相关内容