使用圆心和端点绘制圆弧

使用圆心和端点绘制圆弧

我有一个显示,说明了计算两个角度之和的正弦和余弦的规则。的度数为$\angle{AQP}$$x$代码中的最后三行给出了以为中心的圆弧端点的名称的命令Q。我如何绘制圆弧?(我只想使用tikz命令来绘制此圆弧。)我使用了以下命令。

\path[name path=circle_at_Q] (Q) circle (5mm);
\coordinate[name intersections={of=circle_at_Q and path_AQ, by={an_endpoint_of_arc_at_Q}}];
\coordinate[name intersections={of=circle_at_Q and path_PQ, by={another_endpoint_of_arc_at_Q}}];
\draw[draw=blue] let \p1=(an_endpoint_of_arc_at_Q),\p2=(another_endpoint_of_arc_at_Q) in
(Q) ++({atan(\y1/\x1)}:5mm) arc ({atan(\y1/\x1)}:{atan(\y2/\x2)}:5mm);

使用时代码可以正确编译tikz,但它不会在 处绘制圆弧Q

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

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

\begin{document}    
\begin{tikzpicture}

\coordinate (O) at (0,0);

\draw[-latex,name path=ray_1] (O) -- (10:8);
\coordinate (label_for_ray_r_1) at ($(10:8) +(10:3mm)$);
\node at (label_for_ray_r_1){$r_{1}$};
\draw[-latex,name path=ray_2] (O) -- (50:8);
\coordinate (label_for_ray_r_2) at ($(45:8) +(50:0.3)$);
\node at (label_for_ray_r_2){$r_{2}$};
\draw[-latex,name path=ray_3] (O) -- (75:8);
\coordinate (label_for_ray_r_3) at ($(75:8) +(75:0.3)$);
\node at (label_for_ray_r_3){$r_{3}$};


\coordinate (Q) at (75:6.5);
\draw[fill] (Q) circle (1.5pt);
\coordinate (P) at ($(O)!(Q)!(50:8)$);
\draw[fill,blue] (P) circle (1.5pt);
\draw[name path=path_PQ] (P) -- (Q);

%A right-angle mark is drawn at P.
\coordinate (U) at ($(P)!4mm!-45:(O)$);
\draw[dashed] (U) -- ($(P)!(U)!(O)$);
\draw[dashed] (U) -- ($(P)!(U)!(Q)$);


\coordinate (A) at ($(O)!(Q)!(10:8)$);
\draw[fill] (A) circle (1.5pt);
\draw[name path=path_AQ] (A) -- (Q);

\coordinate (B) at ($(O)!(P)!(10:8)$);
\draw[fill] (B) circle (1.5pt);
\draw (B) -- (P);

%The label for O is typeset.
\coordinate (label_O_below_left) at ($(O)!-7mm!(10:8)$);
\coordinate (label_O_below) at ($(O)!-7mm!(75:8)$);
\coordinate (label_O) at ($(label_O_below_left)!0.5!(label_O_below)$);
\node[blue] at ($(O)!3mm!(label_O)$){$O$};

%The label for Q is typeset.
\coordinate (label_Q_left) at ($(Q)!-7mm!(P)$);
\coordinate (label_Q_right) at ($(Q)!-7mm!(A)$);
\coordinate (label_Q) at ($(label_Q_left)!0.5!(label_Q_right)$);
\node[blue] at ($(Q)!3mm!(label_Q)$){$Q$};

%The label for P is typeset.
\coordinate (label_P_above_right) at ($(P)!15mm!(50:8)$);
\coordinate (label_P_below) at ($(P)!15mm!(B)$);
\coordinate (label_P) at ($(label_P_above_right)!0.5!(label_P_below)$);
\node[blue] at ($(P)!3mm!(label_P)$){$P$};

%The labels for A and B are typeset.
\coordinate (label_A) at ($(A)!-3mm!(Q)$);
\node[blue] at (label_A){$A$};
\coordinate (label_B) at ($(B)!-3mm!(P)$);
\node[blue] at (label_B){$B$};


%A right-angle mark is drawn at A.
\coordinate (U_2) at ($(A)!4mm!-45:(O)$);
\draw[dashed] (U_2) -- ($(A)!(U_2)!(O)$);
\draw[dashed] (U_2) -- ($(A)!(U_2)!(Q)$);


%A right-angle mark is drawn at B.
\coordinate (U_3) at ($(B)!4mm!-45:(O)$);
\draw[dashed] (U_3) -- ($(B)!(U_3)!(O)$);
\draw[dashed] (U_3) -- ($(B)!(U_3)!(P)$);


%The angle at O with a measure of x is drawn.
\draw[draw=blue] (O) ++(10:5mm) arc (10:50:5mm);
\coordinate (label_for_x) at (30:0.55);
\node[font=\footnotesize, anchor=-150] at (label_for_x){$x$};

%The angle at O with a measure of y is drawn.
\draw[draw=blue] (O) ++(50:7.5mm) arc (50:75:7.5mm);
\coordinate (label_for_y) at (62.5:0.8);
\node[font=\footnotesize, anchor=-117.5] at (label_for_y){$y$};

%The angle at Q with a measure of x is drawn.
\path[name path=circle_at_Q] (Q) circle (5mm);
\coordinate[name intersections={of=circle_at_Q and path_AQ, by={an_endpoint_of_arc_at_Q}}];
\coordinate[name intersections={of=circle_at_Q and path_PQ, by={another_endpoint_of_arc_at_Q}}];
\draw[draw=blue] let \p1=(an_endpoint_of_arc_at_Q),\p2=(another_endpoint_of_arc_at_Q) in
(Q) ++({atan(\y1/\x1)}:5mm) arc ({atan(\y1/\x1)}:{atan(\y2/\x2)}:5mm);

\end{tikzpicture}    
\end{document}

答案1

通过计算letin。不需要最后两个交点。

在此处输入图片描述

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

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

\begin{document}    
\begin{tikzpicture}

\coordinate (O) at (0,0);

\draw[-latex,name path=ray_1] (O) -- (10:8);
\coordinate (label_for_ray_r_1) at ($(10:8) +(10:3mm)$);
\node at (label_for_ray_r_1){$r_{1}$};
\draw[-latex,name path=ray_2] (O) -- (50:8);
\coordinate (label_for_ray_r_2) at ($(45:8) +(50:0.3)$);
\node at (label_for_ray_r_2){$r_{2}$};
\draw[-latex,name path=ray_3] (O) -- (75:8);
\coordinate (label_for_ray_r_3) at ($(75:8) +(75:0.3)$);
\node at (label_for_ray_r_3){$r_{3}$};


\coordinate (Q) at (75:6.5);
\draw[fill] (Q) circle (1.5pt);
\coordinate (P) at ($(O)!(Q)!(50:8)$);
\draw[fill,blue] (P) circle (1.5pt);
\draw[name path=path_PQ] (P) -- (Q);

%A right-angle mark is drawn at P.
\coordinate (U) at ($(P)!4mm!-45:(O)$);
\draw[dashed] (U) -- ($(P)!(U)!(O)$);
\draw[dashed] (U) -- ($(P)!(U)!(Q)$);


\coordinate (A) at ($(O)!(Q)!(10:8)$);
\draw[fill] (A) circle (1.5pt);
\draw[name path=path_AQ] (A) -- (Q);

\coordinate (B) at ($(O)!(P)!(10:8)$);
\draw[fill] (B) circle (1.5pt);
\draw (B) -- (P);

%The label for O is typeset.
\coordinate (label_O_below_left) at ($(O)!-7mm!(10:8)$);
\coordinate (label_O_below) at ($(O)!-7mm!(75:8)$);
\coordinate (label_O) at ($(label_O_below_left)!0.5!(label_O_below)$);
\node[blue] at ($(O)!3mm!(label_O)$){$O$};

%The label for Q is typeset.
\coordinate (label_Q_left) at ($(Q)!-7mm!(P)$);
\coordinate (label_Q_right) at ($(Q)!-7mm!(A)$);
\coordinate (label_Q) at ($(label_Q_left)!0.5!(label_Q_right)$);
\node[blue] at ($(Q)!3mm!(label_Q)$){$Q$};

%The label for P is typeset.
\coordinate (label_P_above_right) at ($(P)!15mm!(50:8)$);
\coordinate (label_P_below) at ($(P)!15mm!(B)$);
\coordinate (label_P) at ($(label_P_above_right)!0.5!(label_P_below)$);
\node[blue] at ($(P)!3mm!(label_P)$){$P$};

%The labels for A and B are typeset.
\coordinate (label_A) at ($(A)!-3mm!(Q)$);
\node[blue] at (label_A){$A$};
\coordinate (label_B) at ($(B)!-3mm!(P)$);
\node[blue] at (label_B){$B$};


%A right-angle mark is drawn at A.
\coordinate (U_2) at ($(A)!4mm!-45:(O)$);
\draw[dashed] (U_2) -- ($(A)!(U_2)!(O)$);
\draw[dashed] (U_2) -- ($(A)!(U_2)!(Q)$);


%A right-angle mark is drawn at B.
\coordinate (U_3) at ($(B)!4mm!-45:(O)$);
\draw[dashed] (U_3) -- ($(B)!(U_3)!(O)$);
\draw[dashed] (U_3) -- ($(B)!(U_3)!(P)$);


%The angle at O with a measure of x is drawn.
\draw[draw=blue] (O) ++(10:5mm) arc (10:50:5mm);
\coordinate (label_for_x) at (30:0.55);
\node[font=\footnotesize, anchor=-150] at (label_for_x){$x$};

%The angle at O with a measure of y is drawn.
\draw[draw=blue] (O) ++(50:7.5mm) arc (50:75:7.5mm);
\coordinate (label_for_y) at (62.5:0.8);
\node[font=\footnotesize, anchor=-117.5] at (label_for_y){$y$};

\draw[draw=blue]
    let \p1=($(A)-(Q)$),
    \n1={atan(\y1/\x1)},
    \p2=($(P)-(Q)$),
    \n2={atan(\y2/\x2)} in
    ($(Q)!.5cm!(A)$) arc (\n1:\n2:.5);

\end{tikzpicture}    
\end{document}

答案2

使用范围和剪辑的最简单的操作系统:

\begin{scope}
\clip (A)--(B)--(P)--(Q)--cycle ;
\draw (Q) circle (.5) ;
\end{scope}

在此处输入图片描述

\documentclass{amsart}
\usepackage{amsmath}
\usepackage{amsfonts}

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

\begin{document}

\begin{tikzpicture}

\coordinate (O) at (0,0);

\draw[-latex,name path=ray_1] (O) -- (10:8);
\coordinate (label_for_ray_r_1) at ($(10:8) +(10:3mm)$);
\node at (label_for_ray_r_1){$r_{1}$};
\draw[-latex,name path=ray_2] (O) -- (50:8);
\coordinate (label_for_ray_r_2) at ($(45:8) +(50:0.3)$);
\node at (label_for_ray_r_2){$r_{2}$};
\draw[-latex,name path=ray_3] (O) -- (75:8);
\coordinate (label_for_ray_r_3) at ($(75:8) +(75:0.3)$);
\node at (label_for_ray_r_3){$r_{3}$};


\coordinate (Q) at (75:6.5);
\draw[fill] (Q) circle (1.5pt);
\coordinate (P) at ($(O)!(Q)!(50:8)$);
\draw[fill,blue] (P) circle (1.5pt);
\draw[name path=path_PQ] (P) -- (Q);

%A right-angle mark is drawn at P.
\coordinate (U) at ($(P)!4mm!-45:(O)$);
\draw[dashed] (U) -- ($(P)!(U)!(O)$);
\draw[dashed] (U) -- ($(P)!(U)!(Q)$);


\coordinate (A) at ($(O)!(Q)!(10:8)$);
\draw[fill] (A) circle (1.5pt);
\draw[name path=path_AQ] (A) -- (Q);

\coordinate (B) at ($(O)!(P)!(10:8)$);
\draw[fill] (B) circle (1.5pt);
\draw (B) -- (P);

%The label for O is typeset.
\coordinate (label_O_below_left) at ($(O)!-7mm!(10:8)$);
\coordinate (label_O_below) at ($(O)!-7mm!(75:8)$);
\coordinate (label_O) at ($(label_O_below_left)!0.5!(label_O_below)$);
\node[blue] at ($(O)!3mm!(label_O)$){$O$};

%The label for Q is typeset.
\coordinate (label_Q_left) at ($(Q)!-7mm!(P)$);
\coordinate (label_Q_right) at ($(Q)!-7mm!(A)$);
\coordinate (label_Q) at ($(label_Q_left)!0.5!(label_Q_right)$);
\node[blue] at ($(Q)!3mm!(label_Q)$){$Q$};

%The label for P is typeset.
\coordinate (label_P_above_right) at ($(P)!15mm!(50:8)$);
\coordinate (label_P_below) at ($(P)!15mm!(B)$);
\coordinate (label_P) at ($(label_P_above_right)!0.5!(label_P_below)$);
\node[blue] at ($(P)!3mm!(label_P)$){$P$};

%The labels for A and B are typeset.
\coordinate (label_A) at ($(A)!-3mm!(Q)$);
\node[blue] at (label_A){$A$};
\coordinate (label_B) at ($(B)!-3mm!(P)$);
\node[blue] at (label_B){$B$};


%A right-angle mark is drawn at A.
\coordinate (U_2) at ($(A)!4mm!-45:(O)$);
\draw[dashed] (U_2) -- ($(A)!(U_2)!(O)$);
\draw[dashed] (U_2) -- ($(A)!(U_2)!(Q)$);


%A right-angle mark is drawn at B.
\coordinate (U_3) at ($(B)!4mm!-45:(O)$);
\draw[dashed] (U_3) -- ($(B)!(U_3)!(O)$);
\draw[dashed] (U_3) -- ($(B)!(U_3)!(P)$);


%The angle at O with a measure of x is drawn.
\draw[draw=blue] (O) ++(10:5mm) arc (10:50:5mm);
\coordinate (label_for_x) at (30:0.55);
\node[font=\footnotesize, anchor=-150] at (label_for_x){$x$};

%The angle at O with a measure of y is drawn.
\draw[draw=blue] (O) ++(50:7.5mm) arc (50:75:7.5mm);
\coordinate (label_for_y) at (62.5:0.8);
\node[font=\footnotesize, anchor=-117.5] at (label_for_y){$y$};

\begin{scope}
\clip (A)--(B)--(P)--(Q)--cycle ;
\draw (Q) circle (.5) ;
\end{scope}

%The angle at Q with a measure of x is drawn.
%\path[name path=circle_at_Q] (Q) circle (5mm);
%\coordinate[name intersections={of=circle_at_Q and path_AQ, by={an_endpoint_of_arc_at_Q}}];
%\coordinate[name intersections={of=circle_at_Q and path_PQ, by={another_endpoint_of_arc_at_Q}}];

%\draw
%  pic[draw=orange,<->,angle eccentricity=1.2,angle radius=.5cm] {angle=A--Q--P};

\end{tikzpicture}

\end{document}

相关内容