tikz 交集与库 calc 结合失败

tikz 交集与库 calc 结合失败

在第二个示例中,我尝试使用该库intersection。只要我不使用该calc库,它就可以正常工作。

第一个例子表明了我的意图。我使用($2*(w1')$)它来产生预期的结果:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections,calc}


\begin{document}
\begin{tikzpicture}[x=3cm,y=3cm]
\coordinate (O) at (0,0);
\coordinate (F') at (-0.8,-0.1);
\coordinate (F'') at (0.8,0);
\draw[thick](O) ++(F') ++ (F'');
\draw[gray,name path=circle around F'] (F') circle (1.2);
\draw[gray,name path=circle around F''] (F'') circle (1.2);
\draw[name intersections={of=circle around F' and circle around F'',by={w1,w1'}}]   (intersection-1) node[dot,draw]{}
-- (intersection-2)node[dot,draw]{};
\draw[red,thick] (w1) -- (w1');
\draw[blue,thick] (w1) -- ($2*(w1')$);
\end{tikzpicture}
\end{document}

图中你可以看到蓝线被扩大了。

在第二个(不是最小的)例子中,它失败了:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{intersections,calc}


\begin{document}
\tikzset{dot/.style={circle,minimum size=3pt,inner sep=0pt,outer sep=0pt,thick,fill,}}
\begin{tikzpicture}[x=3cm,y=3cm]
\coordinate (B) at (-1,0);\node[dot] at (B) {};\node[left] at (B) {$B$};
\coordinate (D) at (0,1);\node[dot] at (D) {};\node[anchor=south east] at (D) {$D$};
\coordinate (F) at (0,-.25);\node[dot] at (F) {};\node[anchor=west] at (F) {$F$};

\draw[thick,name path=line FB] (F) -- (B);
\draw[thick,name path=line FD] (F) -- (D);
\draw[gray,name path=circle around F] (F) circle (0.8);

\path[name intersections={of=circle around F and line FB,by=F'}];
\path[name intersections={of=circle around F and line FD,by=F''}];

\draw[gray,name path=circle around F'] (F') circle (0.6);
\draw[gray,name path=circle around F''] (F'') circle (0.6);
\draw[name intersections={of=circle around F' and circle around F'',by={w1,w1'}}] 
   (w1) node[dot]{}
-- (w1')node[dot]{};
\draw[red] (w1') -- ($2*(w1)$);
\end{tikzpicture}
\end{document}

红线错过了交叉路口。我不知道为什么。

问题是什么?

答案1

坐标($2*(w1)$)表示“取 所代表的坐标(w1)并将其加倍”。传统上,我们从原点缩放矢量。如果你在原点处绘制斑点,(w1)那么($2*(w1)$)你会看到它们排列在一条直线上。

你想要的是“将向量从(w1')(w1),将其翻倍,然后再次将其锚定在(w1')”。你可以使用($(w1') + 2*(w1) - 2*(w1')$)(括号似乎有点让人困惑)或 来执行此操作($(w1')!2!(w1)$)

相关内容