建议使用大头针或钩形箭头来标记 `TikZ` 图中的角度

建议使用大头针或钩形箭头来标记 `TikZ` 图中的角度

以下代码渲染了一个外接三角形的圆。其中一个角标记为 $\theta$。我希望另一个角标记为 $90 - \theta$。它所属的位置没有空间。我正在寻找有关“别针”或钩形箭头的建议。无论哪种情况,“别针”或钩形箭头的末端都应位于绿点处。

\documentclass{amsart}
\usepackage{amsmath}

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

\begin{document}

\begin{tikzpicture}

%The circle circumscribing \triangle{ABC} is drawn. O is the center of the circle.
%\angle{ABO} and \angle{ACB} are complimentary angles.
\coordinate (O) at (0,0);
\draw (O) circle (1.75);
\draw[fill] (O) circle (1.5pt);
%
\path (190:1.75) coordinate (A) (120:1.75) coordinate (B) (70:1.75) coordinate (C);
\draw (A) -- (B) -- (C) -- cycle;
%
\draw[dashed] (O) -- (A);
\draw[dashed] (O) -- (B);
%


%The mark indicating the measure of \angle{ABO} is drawn. It is labeled \theta.
\draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(B)!2.5mm!(O)$) arc (-60:{\n1-180}:0.25);
\draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in node[anchor={0.5*((\n1-180)-60)+180}, inner sep=0, font=\tiny] at ($(B) +({0.5*((\n1-180)-60)}:0.3)$){$\theta$};


%The mark indicating the measure of \angle{ABO} is drawn. It is labeled \theta.
\draw[draw=blue] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)}, \p2=($(B)-(C)$), \n2={atan(\y2/\x2)} in ($(C)!3.5mm!(B)$) arc ({\n2-180}:{\n1-180}:0.35);
\draw[fill=green] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)}, \p2=($(B)-(C)$), \n2={atan(\y2/\x2)} in ($(C) +({0.5*(\n1+\n2)-180}:0.45)$) circle (1pt);

\end{tikzpicture}

\end{document}

答案1

这是一个建议。编辑:我添加了您自己的建议并进行了一些微小的修改(使其编译并增加了松散性)。

\documentclass{amsart}
\usepackage{amsmath}

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

\begin{document}

\begin{tikzpicture}

%The circle circumscribing \triangle{ABC} is drawn. O is the center of the circle.
%\angle{ABO} and \angle{ACB} are complimentary angles.
\coordinate (O) at (0,0);
\draw (O) circle (1.75);
\draw[fill] (O) circle (1.5pt);
%
\path (190:1.75) coordinate (A) (120:1.75) coordinate (B) (70:1.75) coordinate (C);
\draw (A) -- (B) -- (C) -- cycle;
%
\draw[dashed] (O) -- (A);
\draw[dashed] (O) -- (B);
%


%The mark indicating the measure of \angle{ABO} is drawn. It is labeled \theta.
\draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(B)!2.5mm!(O)$) arc (-60:{\n1-180}:0.25);
\draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in node[anchor={0.5*((\n1-180)-60)+180}, inner sep=0, font=\tiny] at ($(B) +({0.5*((\n1-180)-60)}:0.3)$){$\theta$};


%The mark indicating the measure of \angle{ABO} is drawn. It is labeled \theta.
\draw[draw=blue] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)}, \p2=($(B)-(C)$), \n2={atan(\y2/\x2)} in ($(C)!3.5mm!(B)$) arc ({\n2-180}:{\n1-180}:0.35);
\draw[fill=green] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)}, \p2=($(B)-(C)$), \n2={atan(\y2/\x2)} in ($(C) +({0.5*(\n1+\n2)-180}:0.45)$) 
coordinate(X) circle (1pt);

\draw[latex-,shorten <=1pt] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)}, 
\p2=($(B)-(C)$), \n2={\n1+atan(\y2/\x2)} in (X)
to[out={0.5*\n2-180},in=-90,looseness=2] 
++ (-12pt,18pt) node[above]{$90^\circ-\theta$};
\end{tikzpicture}
\end{document}

在此处输入图片描述

如果你真的想要一个钩子,你可能需要加载这个arrows.meta库。

\documentclass{amsart}
\usepackage{amsmath}

\usepackage{tikz}
\usetikzlibrary{calc,intersections,arrows.meta}

\begin{document}

\begin{tikzpicture}

%The circle circumscribing \triangle{ABC} is drawn. O is the center of the circle.
%\angle{ABO} and \angle{ACB} are complimentary angles.
\coordinate (O) at (0,0);
\draw (O) circle (1.75);
\draw[fill] (O) circle (1.5pt);
%
\path (190:1.75) coordinate (A) (120:1.75) coordinate (B) (70:1.75) coordinate (C);
\draw (A) -- (B) -- (C) -- cycle;
%
\draw[dashed] (O) -- (A);
\draw[dashed] (O) -- (B);
%


%The mark indicating the measure of \angle{ABO} is drawn. It is labeled \theta.
\draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in ($(B)!2.5mm!(O)$) arc (-60:{\n1-180}:0.25);
\draw[draw=blue] let \p1=($(A)-(B)$), \n1={atan(\y1/\x1)} in node[anchor={0.5*((\n1-180)-60)+180}, inner sep=0, font=\tiny] at ($(B) +({0.5*((\n1-180)-60)}:0.3)$){$\theta$};


%The mark indicating the measure of \angle{ABO} is drawn. It is labeled \theta.
\draw[draw=blue] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)}, \p2=($(B)-(C)$), \n2={atan(\y2/\x2)} in ($(C)!3.5mm!(B)$) arc ({\n2-180}:{\n1-180}:0.35);
\draw[fill=green] let \p1=($(A)-(C)$), \n1={atan(\y1/\x1)}, \p2=($(B)-(C)$), \n2={atan(\y2/\x2)} in ($(C) +({0.5*(\n1+\n2)-180}:0.45)$) 
coordinate(X) circle (1pt);
\draw[{Hooks[]}-,shorten <=1pt] (X) to[out=90,in=-90] ++ (3pt,18pt)
node[above]{$90^\circ-\theta$};

\end{tikzpicture}

\end{document}

在此处输入图片描述

为了完整性:有一种可以说更简单的方法来绘制角弧,即使用angles库。

\documentclass{amsart}
\usepackage{amsmath}

\usepackage{tikz}
\usetikzlibrary{angles,quotes,plotmarks}

\begin{document}

\begin{tikzpicture}

%The circle circumscribing \triangle{ABC} is drawn. O is the center of the circle.
%\angle{ABO} and \angle{ACB} are complimentary angles.
\coordinate (O) at (0,0);
\draw (O) circle (1.75);
\draw[fill] (O) circle (1.5pt);
%
\path (190:1.75) coordinate (A) (120:1.75) coordinate (B) (70:1.75) coordinate (C);
\draw (A) -- (B) -- (C) -- cycle;
%
\draw[dashed] (O) -- (A);
\draw[dashed] (O) -- (B);
%

\path (A) -- (B) -- (O)
pic [angle radius=2.5mm,font=\tiny,draw,
angle eccentricity=2,"$\theta$"] {angle = A--B--O};

\path (B) -- (C) -- (A)
pic [angle radius=2.5mm,draw=black,
angle eccentricity=2,"{\pgfuseplotmark{*}}" 
{green,name=X,pin=100:{\tiny$90^\circ-\theta$}}] {angle = B--C--A};

\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

使用 tkz-euclide 的选项

结果: 在此处输入图片描述

梅威瑟:

\documentclass[border=2mm]{standalone}
\usepackage{xcolor}
\usepackage{amsmath}
\usepackage{tkz-euclide}
\usetikzlibrary{arrows.meta}
\usetkzobj{all}
\begin{document}
    \begin{tikzpicture}
        % Set limits.
        \tkzInit[xmin=-4,xmax=11,ymax=5, ymin=-5]
        \tkzGrid[sub,color=blue!10!,subxstep=.5,subystep=.5]
        \tkzClip
        %Define principal points.
        \tkzDefPoint(0,0){O}
        \tkzDefShiftPoint[O](70:3){A}
        \tkzDefShiftPoint[O](120:3){B}
        \tkzDefShiftPoint[O](190:3){C}

        %Define principal points.
        \tkzDefPoint(7,0){O'}
        \tkzDefShiftPoint[O'](50:3){A'}
        \tkzDefShiftPoint[O'](120:3){B'}
        \tkzDefShiftPoint[O'](190:3){C'}

        %Draw the circle
        \tkzDrawCircle[R,blue](O,3cm)
        \tkzDrawCircle[R,blue](O',3cm)

        % Draw angles
        \tkzMarkAngle[fill=blue!25,mkpos=.2, size=0.5](C,B,O)
        \tkzMarkAngle[fill=green!25,mkpos=.2, size=0.5](B,A,C)

        \tkzMarkAngle[fill=blue!25,mkpos=.2, size=0.5](C',B',O')
        \tkzMarkAngle[fill=green!25,mkpos=.2, size=0.5](B',A',C')

        % Draw all segments.
        \tkzDrawSegments[thick,dashed](O,C O,B)
        \tkzDrawSegments[thick](C,A B,A B,C)

        \tkzDrawSegments[thick,dashed](O',C' O',B')
        \tkzDrawSegments[thick](C',A' B',A' B',C')

        % Draw specific points.
        \tkzDrawPoints[fill=white,size=7pt](A,B,C)
        \tkzDrawPoints[fill=black,size=12pt](O)

%       \tkzDrawPoints[fill=red,size=10pt](A',B',C')
        \tkzDrawPoints[fill=black,size=12pt](O')

        % Label points
        \tkzLabelPoints[color=blue,opacity=.7,above](A,B) 
        \tkzLabelPoints[color=blue,opacity=.7,left](C)
        \tkzLabelPoints[color=blue,opacity=.7,below =5pt](O)

        % Label angles.
        \tkzLabelAngle[pos = .7](C,B,O){$\theta$}
        \tkzLabelAngle[pos =-1.2, rotate=25](B,A,C){$90-\theta$}

        \tkzLabelAngle[pos = .8](C',B',O'){$\theta$}
%           \tkzLabelAngle[pos =-1.2, rotate=25](B',A',C'){$\theta-90$}

        \draw[thick, Stealth-] (A')++(190:14.pt) to [in=-90,out=190] ++(-1,1.2) node[anchor=south] {$90-\theta$};
        % You can mark the segments
        \tkzMarkSegments[mark=||,pos=0.6](B,O C,O)
    \end{tikzpicture}
\end{document}

相关内容