在 TikZ 图片中绘制钩形箭头来标记角度

在 TikZ 图片中绘制钩形箭头来标记角度

我想将C梯形中的角度标记ABCD}为 $180^{\circ} - \theta$。这个标签太大,无法很好地放入梯形内。我希望将其放置在顶点的左侧上方。命令

\draw[latex-,shorten <=1pt] let \n1={atan(2/5)} in ($(C) +({0.5*((\n1+180)+270)}:0.45)$) to[out={0.5*((\n1+180)+270)}, in=-90, looseness=2] ++(-8pt,25pt) node[anchor=south, inner sep=0, font=\tiny]{$180^{\circ}-\theta$};

未编译。

\documentclass[10pt]{amsart}

\usepackage{mathtools,array}

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




\begin{document}


\begin{tikzpicture}

\path (0,0) coordinate (A) (10,0) coordinate (B) (10,7) coordinate (C) (0,3) coordinate (D);
\path (5,0) coordinate (P) (3,{((7/10)*3)+((3/10)*7)}) coordinate (M);

\draw (A) -- (B) -- (C) -- (D) -- cycle;
\draw (M) -- (P);



%Side AP and BP are marked with "|".
\draw ($(5/2,0) +(0,-3pt)$) -- ($(5/2,0) +(0,3pt)$);
\draw ($(15/2,0) +(0,-3pt)$) -- ($(15/2,0) +(0,3pt)$);


%Line segments AD and DM are marked with "||".
\draw ($($(0,3/2)!1pt!(A)$)!3pt!90:(A)$) -- ($($(0,3/2)!1pt!(A)$)!3pt!-90:(A)$);
\draw ($($(0,3/2)!1pt!(D)$)!3pt!90:(A)$) -- ($($(0,3/2)!1pt!(D)$)!3pt!-90:(A)$);
%
\draw ($($($(D)!0.5!(M)$)!1pt!(D)$)!3pt!90:(D)$) -- ($($($(D)!0.5!(M)$)!1pt!(D)$)!3pt!-90:(D)$);
\draw ($($($(D)!0.5!(M)$)!1pt!(M)$)!3pt!90:(D)$) -- ($($($(D)!0.5!(M)$)!1pt!(M)$)!3pt!-90:(D)$);


%Line segments CM and BC are marked "|||".
\draw ($($(C)!0.5!(M)$)!3pt!90:(C)$) -- ($($(C)!0.5!(M)$)!3pt!-90:(C)$);
\draw ($($($(C)!0.5!(M)$)!2pt!(C)$)!3pt!90:(C)$) -- ($($($(C)!0.5!(M)$)!2pt!(C)$)!3pt!-90:(C)$);
\draw ($($($(C)!0.5!(M)$)!2pt!(M)$)!3pt!90:(C)$) -- ($($($(C)!0.5!(M)$)!2pt!(M)$)!3pt!-90:(C)$);
%
\draw ($($(B)!0.5!(C)$)!3pt!90:(B)$) -- ($($(B)!0.5!(C)$)!3pt!-90:(B)$);
\draw ($($($(B)!0.5!(C)$)!2pt!(B)$)!3pt!90:(B)$) -- ($($($(B)!0.5!(C)$)!2pt!(B)$)!3pt!-90:(B)$);
\draw ($($($(B)!0.5!(C)$)!2pt!(C)$)!3pt!90:(B)$) -- ($($($(B)!0.5!(C)$)!2pt!(C)$)!3pt!-90:(B)$);



%A right-angle mark is drawn at A.
\draw ({3*sqrt(1/2)*1mm},0) -- ({3*sqrt(1/2)*1mm},{3*sqrt(1/2)*1mm}) -- (0,{3*sqrt(1/2)*1mm});

%A right-angle mark is drawn at B.
\draw ($(B) +({-3*sqrt(1/2)*1mm},0)$) -- ($(B) +({-3*sqrt(1/2)*1mm},{3*sqrt(1/2)*1mm})$) -- ($(B) +(0,{3*sqrt(1/2)*1mm})$);

%A right-angle mark is drawn at M.
\draw let \n1={atan(2/5)} in ($(M) +({\n1}:{(3*sqrt(1/2))*1mm})$) coordinate (auxiliary_point_1) -- ($(auxiliary_point_1) +({\n1-90}:{(3*sqrt(1/2))*1mm})$) coordinate (auxiliary_point_2) -- ($(auxiliary_point_2) +({\n1-180}:{(3*sqrt(1/2))*1mm})$);



%The mark indicating the measure of \angle{ADC} is drawn. It is labeled \theta.
\draw[draw=blue] let \n1={atan(2/5)} in ($(D)!3mm!(A)$) arc (-90:\n1:0.3);
\draw[blue] let \n1={atan(2/5)} in node[anchor={0.5*(\n1-90)-180}, inner sep=0, font=\tiny] at ($(D) +({0.5*(\n1-90)}:0.45)$){$\theta$};

%The mark indicating the measure of \angle{BCD} is drawn. It is labeled 180^{\circ} - \theta.
\draw[draw=blue] let \n1={atan(2/5)} in ($(C)!4.5mm!(D)$) arc ({\n1+180}:270:0.45);
%\draw[latex-,shorten <=1pt] let \n1={atan(2/5)} in ($(C) +({0.5*((\n1+180)+270)}:0.45)$) to[out={0.5*((\n1+180)+270)}, in=-90, looseness=2] ++(-8pt,25pt) node[anchor=south, inner sep=0, font=\tiny]{$180^{\circ}-\theta$};

\end{tikzpicture}

\end{document}

答案1

解析器对该语法感到困惑,但如果您out使用 calc 语法计算角度,它就可以工作。

\documentclass[10pt]{amsart}

\usepackage{mathtools,array}

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




\begin{document}


\begin{tikzpicture}

\path (0,0) coordinate (A) (10,0) coordinate (B) (10,7) coordinate (C) (0,3) coordinate (D);
\path (5,0) coordinate (P) (3,{((7/10)*3)+((3/10)*7)}) coordinate (M);

\draw (A) -- (B) -- (C) -- (D) -- cycle;
\draw (M) -- (P);



%Side AP and BP are marked with "|".
\draw ($(5/2,0) +(0,-3pt)$) -- ($(5/2,0) +(0,3pt)$);
\draw ($(15/2,0) +(0,-3pt)$) -- ($(15/2,0) +(0,3pt)$);


%Line segments AD and DM are marked with "||".
\draw ($($(0,3/2)!1pt!(A)$)!3pt!90:(A)$) -- ($($(0,3/2)!1pt!(A)$)!3pt!-90:(A)$);
\draw ($($(0,3/2)!1pt!(D)$)!3pt!90:(A)$) -- ($($(0,3/2)!1pt!(D)$)!3pt!-90:(A)$);
%
\draw ($($($(D)!0.5!(M)$)!1pt!(D)$)!3pt!90:(D)$) -- ($($($(D)!0.5!(M)$)!1pt!(D)$)!3pt!-90:(D)$);
\draw ($($($(D)!0.5!(M)$)!1pt!(M)$)!3pt!90:(D)$) -- ($($($(D)!0.5!(M)$)!1pt!(M)$)!3pt!-90:(D)$);


%Line segments CM and BC are marked "|||".
\draw ($($(C)!0.5!(M)$)!3pt!90:(C)$) -- ($($(C)!0.5!(M)$)!3pt!-90:(C)$);
\draw ($($($(C)!0.5!(M)$)!2pt!(C)$)!3pt!90:(C)$) -- ($($($(C)!0.5!(M)$)!2pt!(C)$)!3pt!-90:(C)$);
\draw ($($($(C)!0.5!(M)$)!2pt!(M)$)!3pt!90:(C)$) -- ($($($(C)!0.5!(M)$)!2pt!(M)$)!3pt!-90:(C)$);
%
\draw ($($(B)!0.5!(C)$)!3pt!90:(B)$) -- ($($(B)!0.5!(C)$)!3pt!-90:(B)$);
\draw ($($($(B)!0.5!(C)$)!2pt!(B)$)!3pt!90:(B)$) -- ($($($(B)!0.5!(C)$)!2pt!(B)$)!3pt!-90:(B)$);
\draw ($($($(B)!0.5!(C)$)!2pt!(C)$)!3pt!90:(B)$) -- ($($($(B)!0.5!(C)$)!2pt!(C)$)!3pt!-90:(B)$);



%A right-angle mark is drawn at A.
\draw ({3*sqrt(1/2)*1mm},0) -- ({3*sqrt(1/2)*1mm},{3*sqrt(1/2)*1mm}) -- (0,{3*sqrt(1/2)*1mm});

%A right-angle mark is drawn at B.
\draw ($(B) +({-3*sqrt(1/2)*1mm},0)$) -- ($(B) +({-3*sqrt(1/2)*1mm},{3*sqrt(1/2)*1mm})$) -- ($(B) +(0,{3*sqrt(1/2)*1mm})$);

%A right-angle mark is drawn at M.
\draw let \n1={atan(2/5)} in ($(M) +({\n1}:{(3*sqrt(1/2))*1mm})$) coordinate (auxiliary_point_1) -- ($(auxiliary_point_1) +({\n1-90}:{(3*sqrt(1/2))*1mm})$) coordinate (auxiliary_point_2) -- ($(auxiliary_point_2) +({\n1-180}:{(3*sqrt(1/2))*1mm})$);



%The mark indicating the measure of \angle{ADC} is drawn. It is labeled \theta.
\draw[draw=blue] let \n1={atan(2/5)} in ($(D)!3mm!(A)$) arc (-90:\n1:0.3);
\draw[blue] let \n1={atan(2/5)} in node[anchor={0.5*(\n1-90)-180}, inner sep=0, font=\tiny] at ($(D) +({0.5*(\n1-90)}:0.45)$){$\theta$};

%The mark indicating the measure of \angle{BCD} is drawn. It is labeled 180^{\circ} - \theta.
\draw[draw=blue] let \n1={atan(2/5)} in ($(C)!4.5mm!(D)$) arc ({\n1+180}:270:0.45);
\draw[latex-,shorten <=1pt] let \n1={atan(2/5)},\n2={0.5*((\n1+180)+270)} in  
($(C)+({0.5*((\n1+180)+270)}:0.45)$) 
 to[out=\n2, in=-90,
 looseness=2] ++(-8pt,25pt) node[anchor=south, inner sep=0,
 font=\tiny]{$180^{\circ}-\theta$};

\end{tikzpicture}

\end{document}

在此处输入图片描述

相关内容