TikZ 中角度计算不正确

TikZ 中角度计算不正确

在下图中,角度 A 的度数约为 53 度。准确地说,它是 180 - arccos(-3/5)。我使用以下命令绘制了一个以 A 为顶点的圆弧。

\draw[name path=arc_to_mark_angle_CAP, draw=blue] let \n1={180-acos(-3/5)} in ($(A)!0.7cm!(P)$) arc (0:\n1:0.7);

因此,我认为以下命令会在 A 处绘制一个角平分线。

\draw[name path=a_ray_from_A_bisecting_angle_CAP] let \n1={180-acos(-3/5)}, \n2={1/2*\n1} in (A) -- (\n1:1);

不是。为什么用此代码无法正确绘制角平分线?

\documentclass{article}


\usepackage{amsmath, mathtools, amssymb, amsthm}

\usepackage[dvipsnames]{xcolor}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,intersections,quotes,decorations.markings}


\begin{document}




\section{Introduction}



\begin{center}
\begin{tikzpicture}

\path ({(1/4)*2*9*(-3/5)},0) coordinate (A) (0,0) coordinate (B) ({(1/4)*9*(-3/5)},{(1/4)*9*(4/5)}) coordinate (C)
({(1/4)*10},0) coordinate (P);
\node[anchor=north, inner sep=0, font=\footnotesize] at ($(A) +(0,-0.15)$){$A$};
\node[anchor=south, inner sep=0, font=\footnotesize] at ($(C) +(0,0.15)$){$C$};
\node[anchor=north, inner sep=0, font=\footnotesize] at ($(P) +(0,-0.15)$){$P$};
\draw (A) -- (P) -- (C) -- cycle;




%The angle indicating the measure of \angle{CAP} is drawn.
\draw[name path=arc_to_mark_angle_CAP, draw=blue] let \n1={180-acos(-3/5)} in ($(A)!0.7cm!(P)$) arc (0:\n1:0.7);
\draw[name path=a_ray_from_A_bisecting_angle_CAP] let \n1={180-acos(-3/5)}, \n2={1/2*\n1} in (A) -- (\n2:1);


\end{tikzpicture}
\end{center}




\end{document}

答案1

您只是缺少+线的结束坐标前面的一个符号来相对于路径的起始坐标进行设置。

将从(X) -- (30:2)坐标X绝对极坐标30:2(相对于原点0:0),(X) -- +(30:2)画一条线到坐标相对的到上一个坐标,这就是您想要的:

\documentclass[border=10pt]{standalone}
\usepackage{tikz}
\usetikzlibrary{calc, intersections}

\begin{document}
\begin{tikzpicture}

    \path 
        ({(1/4)*2*9*(-3/5)},0) coordinate (A) 
        (0,0) coordinate (B) 
        ({(1/4)*9*(-3/5)},{(1/4)*9*(4/5)}) coordinate (C)
        ({(1/4)*10},0) coordinate (P);
        
    \node[anchor=north, inner sep=0pt, font=\footnotesize] 
        at ($(A)+(0,-0.15)$) {$A$};
    \node[anchor=south, inner sep=0pt, font=\footnotesize] 
        at ($(C)+(0,0.15)$) {$C$};
    \node[anchor=north, inner sep=0pt, font=\footnotesize] 
        at ($(P)+(0,-0.15)$) {$P$};
        
    \draw (A) -- (P) -- (C) -- cycle;
    
    %The angle indicating the measure of \angle{CAP} is drawn.
    \draw[name path=arc_to_mark_angle_CAP, draw=blue] 
        let \n1={180-acos(-3/5)} in 
        ($(A)!0.7cm!(P)$) arc[start angle=0, end angle=\n1, radius=0.7];
    \draw[name path=a_ray_from_A_bisecting_angle_CAP] 
        let \n1={180-acos(-3/5)}, \n2={1/2*\n1} in 
        (A) -- +(\n2:1);
    
\end{tikzpicture}
\end{document}

在此处输入图片描述

相关内容