2

I have a triangle which has a [clip] path that is used to create a circle that looks like a arc to show the angle. I need to label it with a node as $\theta$. How can I achieve this? The current code places it at 0,0.

\begin{tikzpicture}
    \coordinate (A) at (0,0);
    \coordinate (B) at (0,3);
    \coordinate (C) at (4,0);
    \draw (A) -- (B) node[midway,left] {$o$} -- (C) node[midway,above] {$h$} -- cycle node[midway,below] {$a$};
    \path[clip] (A) -- (B) -- (C) -- cycle;
    \node[circle,draw=black,minimum size=40pt] at (C) (circ) {} node[above] {$\theta$};
\end{tikzpicture}

img

  • 1
    Append the node specification with theta to the path realized with \draw. – Marian G. May 15 at 17:37
  • \draw (A) -- (B) node[midway,left] {$o$} -- (C) node[midway,above] {$h$} -- cycle node[midway,below] {$a$} node[above] {$\theta$}; \path[clip] (A) -- (B) -- (C) -- cycle; \node[circle,draw=black,minimum size=40pt] at (C) (circ) {}; with that code it is stil above 0,0 – James Conway May 15 at 17:41
2

They are much better ways for denoting angles, e.g., the library angles. Also, the circle can be drawn by using the \draw command instead of realizing it as an empty node.

Result

enter image description here

Code

\documentclass[border=10pt]{standalone}

\usepackage{tikz}


\begin{document}

\begin{tikzpicture}
\coordinate (A) at (0,0);
\coordinate (B) at (0,3);
\coordinate (C) at (4,0);
%
\draw[thick,line join=round]
    (A) -- (B)
        node[midway,left] {$o$}
    -- (C)
        node[midway,above] {$h$}
    -- cycle
        node[midway,below] {$a$}
        node[pos=.18,above] {$\theta$};
\path[clip]
    (A) -- (B) -- (C) -- cycle;
\draw (C) circle (30pt);
\end{tikzpicture}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.