如何标记 tikz 图片中的节点(坐标)?

如何标记 tikz 图片中的节点(坐标)?
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{quotes,angles}

\begin{document}

\begin{tikzpicture} %[scale=3]
    \draw (0,0) node[below]{$O$} circle (2);
    \coordinate (A) at (120:2);
    \coordinate (B) at (210:2);
    \coordinate (C) at (-40:2);
    \coordinate (D) at ( 60:2);
    \draw (A) -- (C) -- (D) -- (B) -- (A);
    \draw (B) -- (A) -- (C) pic [draw, angle radius=12mm, "$30^\circ$"] {angle = B--A--C};
    \draw (D) -- (B) -- (A) pic [draw, angle radius=15mm, "$15^\circ$"] {angle = D--B--A};
    \draw (B) -- (D) -- (C) pic [angle radius=12mm, "$ x^\circ$", draw] {angle = B--D--C};
\end{tikzpicture}
\\


\begin{tikzpicture} %[scale=3]
    \draw (0,0) node[below]{$O$} circle (2);
    \node (A) at (120:2) [above right] {$A$};
    \node (B) at (210:2) [below left ] {$B$};
    \node (C) at (-40:2) [above right] {$C$};
    \node (D) at ( 60:2) [above right] {$D$};
    \draw (A) -- (C) -- (D) -- (B) -- (A);
\end{tikzpicture}


\end{document}

我如何ABCD正确标记坐标(在第一张图片中)?

我可以使用\node它们吗,因为它们可以贴标签吗?

谢谢!

在此处输入图片描述

答案1

我使用了定位库:

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{quotes,angles,positioning}

\begin{document}

\begin{tikzpicture}
    \draw (0,0) node[below]{$O$} circle (2);
    \coordinate (A) at (120:2);
    \node at (A) [above = 1mm of A] {$A$};
    \coordinate (B) at (210:2);
    \node at (B) [below left = 1mm of B] {$B$};
    \coordinate (C) at (-40:2);
    \node at (C) [below = 1mm of C] {$C$};
    \coordinate (D) at ( 60:2);
    \node at (D) [above right = 0.7mm of D] {$D$};
    \draw (A) -- (C) -- (D) -- (B) -- (A);
    \draw (B) -- (A) -- (C) pic [draw, angle radius=12mm, "$30^\circ$"] {angle = B--A--C};
    \draw (D) -- (B) -- (A) pic [draw, angle radius=15mm, "$15^\circ$"] {angle = D--B--A};
    \draw (B) -- (D) -- (C) pic [angle radius=12mm, "$ x^\circ$", draw] {angle = B--D--C};
\end{tikzpicture}
\end{document}

在此处输入图片描述

答案2

您可以直接在第一张图片上给坐标添加标签,我认为这是最自然的方式:

\documentclass[tikz, convert={density=300,size=256,outext=.png}]{standalone}
\usetikzlibrary{quotes,angles}

\begin{document}
    \begin{tikzpicture} %[scale=3]
        \draw (0,0) node[below]{$O$} circle (2);
        \coordinate[label=above:A] (A) at (120:2);
        \coordinate[label=below left:B] (B) at (210:2);
        \coordinate[label=below right:C] (C) at (-40:2);
        \coordinate[label=above:D] (D) at ( 60:2);
        %\draw (A) -- (C) -- (D) -- (B) -- (A);
        \draw (B) -- (A) -- (C) pic [draw, angle radius=12mm, "$30^\circ$"] {angle = B--A--C};
        \draw (D) -- (B) -- (A) pic [draw, angle radius=15mm, "$15^\circ$"] {angle = D--B--A};
        \draw (B) -- (D) -- (C) pic [angle radius=12mm, "$ x^\circ$", draw] {angle = B--D--C};
    \end{tikzpicture}
\end{document}

顺便说一句,您不需要第一次就画出线条。

期望结果

答案3

\begin{tikzpicture}[scale=1.5]
\coordinate[label=above left:$A$] (A) at (0,2);
\coordinate[label=below left:$B$] (B) at (0,0);
\coordinate[label=below right:$C$] (C) at (3,0);
\draw (A) -- (B) -- (C) -- cycle;
\coordinate[label=above right:$P$] (P) at (1.5,1);
\draw (B) -- (P);
\coordinate[label=above right:$Q$] (Q) at (1.5,2);
\draw (P) -- (Q);
\coordinate[label=below right:$R$] (R) at (3,1);
\draw (P) -- (R);
\end{tikzpicture}

相关内容