标签未在指定位置排版

标签未在指定位置排版

我画了两个以 为中心的同心圆O。我指定小圆的半径为1。大圆的半径确定为 ,使得内接角LMN20度数,被半径 平分OM,并与小圆在S和 处相切,T使得角SOMTOM80度数。

我担心的是弦MN没有画出来。弦LM是画出来的,但不是弦。以下是显示全等弦和MN的长度的计算。LMMN

`triangle{OSM}` and `triangle{OTM}` are congruent, right triangles.
Since `OM` bisects `angle{LMN}`, and the measure of `angle{LMN}` is 20 degrees,
`angle{LMO}` and `angle{NMO` both have measure `10` degrees.

r is the radius of the smaller circle.
According to the Law of Sines, |OM| = r/sin(10). By the Pythagorean Theorem,
|MS| = |MT| = (r/sin(10))\sqrt{1 - sin^{2}(10)} =(r/sin(10))cos(10) = r*cot(10).

我声明r=1。因此,较大圆的半径为cot(10)。使用以下命令,我预计 必须angle{LMN}是较大三角形的内接角。

\coordinate (M) at ({-cot(10)},0);
\coordinate (L) at ($(M) +(10:{2*cot(10)})$);
\coordinate (N) at ($(M) +(-10:{2*cot(10)})$);

但事实并非如此,在和 处,LMMN被画得比圆圈稍远一些。这是怎么发生的?MN

我使用以下命令来弥补calc包中的错误。

\draw[name path=bigger_circle] (O) circle ({cot(10)});
\path[name path=chord_LM] (M) -- (L);
\draw[name path=chord_MN] (M) -- (N);
\coordinate[name intersections={of=bigger_circle and chord_LM, by=corrected_location_for_L}];
\coordinate[name intersections={of=bigger_circle and chord_MN, by=corrected_location_for_N}];

LM画出了弦,但N似乎位于M,因此MN没有画出弦。

\documentclass{amsart}
\usepackage{tikz}

\usetikzlibrary{calc,intersections}


\begin{document}

\begin{tikzpicture}

%Two concentric circles are drawn.
%
\coordinate (O) at (0,0);
\draw[fill] (O) circle (1.5pt);
\draw (O) circle (1);
\draw[name path=bigger_circle] (O) circle ({cot(10)});
%

%
\coordinate (S) at (100:1);
\draw[fill] (S) circle (1.5pt);
\coordinate (T) at (-100:1);
\draw[fill] (T) circle (1.5pt);
%
\coordinate (M) at ({-cot(10)},0);
%
\coordinate (L) at ($(M) +(10:{2*cot(10)})$);
\coordinate (N) at ($(M) +(-10:{2*cot(10)})$);
%
\path[name path=chord_LM] (M) -- (L);
\path[name path=chord_MN] (M) -- (N);
%
%The calc package is drawing the chords LM and MN too long. So, the intersections package is used.
%
\coordinate[name intersections={of=bigger_circle and chord_LM, by=corrected_location_for_L}];
\coordinate[name intersections={of=bigger_circle and chord_MN, by=corrected_location_for_N}];
%
\draw (M) -- (corrected_location_for_L);
\draw[green] (M) -- (corrected_location_for_N);


%The labels for the points are typeset.
\path node[anchor=west, inner sep=0, font=\footnotesize] at ($(O) +(0.15,0)$){$O$};
\path node[anchor=east, inner sep=0, font=\footnotesize] at ($(M) +(-0.15,0)$){$M$};
\path let \p1=($(L)-(M)$), \n1={atan(\y1/\x1)} in node[anchor={\n1+180}, inner sep=0, font=\footnotesize] at ($(corrected_location_for_L) +({\n1}:0.15)$){$L$};
\path let \p1=($(M)-(N)$), \n1={atan(\y1/\x1)} in node[anchor={\n1+180}, inner sep=0, font=\footnotesize] at ($(corrected_location_for_N) +({\n1}:0.15)$){$N$};
\path node[anchor={80-180}, inner sep=0, font=\footnotesize] at ($(S) +(80:0.15)$){$S$};
\path node[anchor={-80+180}, inner sep=0, font=\footnotesize] at ($(T) +(-80:0.15)$){$T$};

\draw[fill=green] (corrected_location_for_L) circle (2pt);
\draw[fill=green] (corrected_location_for_N) circle (2pt);


\end{tikzpicture}

\end{document}

答案1

你选错了交点,每条线都与圆在期望的点相交在 处M。要绝对确定您选择哪个点,您应该使用sort by交叉点选项。对于您来说,使用沿弦的顺序是最合适的。例如,对于第一组交叉点,您可以写

\coordinate[name intersections={of=bigger_circle and chord_ML,
by={tmp,corrected_location_for_L}, sort by=chord_ML}];

按顺序对交叉点进行排序,并用和chord_ML标记它们。tmpcorrected_location_for_L

示例输出

\documentclass{amsart}

\usepackage{tikz}

\usetikzlibrary{calc,intersections}

\begin{document}

\begin{tikzpicture}

%Two concentric circles are drawn.
%
\coordinate (O) at (0,0);
\draw[fill] (O) circle (1.5pt);
\draw (O) circle (1);
\draw[name path=bigger_circle] (O) circle ({cot(10)});
%

%
\coordinate (S) at (100:1);
\draw[fill] (S) circle (1.5pt);
\coordinate (T) at (-100:1);
\draw[fill] (T) circle (1.5pt);
%
\coordinate (M) at ({-cot(10)},0);
%
\coordinate (L) at ($(M) + (10:{2*cot(10)})$);
\coordinate (N) at ($(M) + (-10:{2*cot(10)})$);
%
\path[name path=chord_ML] (M) -- (L);
\path[name path=chord_MN] (M) -- (N);
%
%The calc package is drawing the chords LM and MN too long. So, the intersections package is used.
%
\coordinate[name intersections={of=bigger_circle and chord_ML,
by={tmp,corrected_location_for_L}, sort by=chord_ML}];
\coordinate[name intersections={of=bigger_circle and chord_MN,
by={tmp,corrected_location_for_N}, sort by=chord_MN}];
%
\draw (M) -- (corrected_location_for_L);
\draw[green] (M) -- (corrected_location_for_N);

%The labels for the points are typeset.
\path node[anchor=west, inner sep=0, font=\footnotesize] at ($(O) +(0.15,0)$){$O$};
\path node[anchor=east, inner sep=0, font=\footnotesize] at ($(M) +(-0.15,0)$){$M$};
\path let \p1=($(L)-(M)$), \n1={atan(\y1/\x1)} in node[anchor={\n1+180}, inner sep=0, font=\footnotesize] at ($(corrected_location_for_L) +({\n1}:0.15)$){$L$};
\path let \p1=($(M)-(N)$), \n1={atan(\y1/\x1)} in node[anchor={\n1+180}, inner sep=0, font=\footnotesize] at ($(corrected_location_for_N) +({\n1}:0.15)$){$N$};
\path node[anchor={80-180}, inner sep=0, font=\footnotesize] at ($(S) +(80:0.15)$){$S$};
\path node[anchor={-80+180}, inner sep=0, font=\footnotesize] at ($(T) +(-80:0.15)$){$T$};

\draw[fill=green] (corrected_location_for_L) circle (2pt);
\draw[fill=green] (corrected_location_for_N) circle (2pt);

\end{tikzpicture}

\end{document}

答案2

我不知道这条线的长度,但是错误的标签位置是因为您使用了错误的交叉点。

圆与弦之间有两个交点。一个在M,另一个在L/ N。当您使用 时by={a},TikZ 找到的第一个交点被命名为{a},如果您使用by={a,b}第一个交点,则为a,第二个交点为b

我无法确切地说出为什么在一种情况下你会得到正确的交点而在另一种情况下却得不到正确的交点,但这将归因于 TikZ 查找交点的方式。例如,假设它沿着圆查找,从零度开始并逆时针方向工作,ML它找到的第一个交点在L,第二个交点在M。对于MN,它找到的第一个交点将在M

因此,下面是完成您想要的功能的完整代码。我还做了一些其他更改,主要是标签的绘制方式,但如果您更喜欢自己的方法,可以忽略这一点。

在此处输入图片描述

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,intersections}
\begin{document}

\begin{tikzpicture}[every label/.append style={font=\footnotesize}]
%Two concentric circles are drawn.
%
\coordinate [label=right:{$O$}] (O) at (0,0);
\draw (O) circle (1);
\draw[name path=bigger_circle] (O) circle[radius={cot(10)}];
%

%
\coordinate [label=above:{$S$}] (S) at (100:1);
\coordinate [label=below:{$T$}] (T) at (-100:1);

%
\foreach \x in {O,S,T}
  \draw[fill] (\x) circle (1.5pt);


\coordinate [label=left:{$M$}] (M) at ({-cot(10)},0);
%
\coordinate (L) at ($(M) +(10:{2*cot(10)})$);
\coordinate (N) at ($(M) +(-10:{2*cot(10)})$);
%
\path[name path=chord_LM] (M) -- (L);
\path[name path=chord_MN] (M) -- (N);
%
%The calc package is drawing the chords LM and MN too long. So, the intersections package is used.
%
\path[name intersections={of=bigger_circle and chord_LM, by={corrected_location_for_L,i}}];
\path[name intersections={of=bigger_circle and chord_MN, by={i,corrected_location_for_N}}];
%
\draw (M) -- (corrected_location_for_L);
\draw[green] (M) -- (corrected_location_for_N);

\draw[fill=green] (corrected_location_for_L) circle (2pt);
\draw[fill=green] (corrected_location_for_N) circle (2pt);

\node [font=\footnotesize] at ($(L)!-2mm!(M)$)  {$L$};
\node [font=\footnotesize] at ($(N)!-2mm!(M)$)  {$N$};
\end{tikzpicture}
\end{document}

相关内容