Programmatically draw (and label) a triangle's angle
I want to draw and label angle A (alpha) of my ABC triangle while still
being able to change to coordinate of A B and C so that the angle and the
mark adapts to it. I've managed to create something, but partly not really
understanding what I'm doing and looking for a more solid solid solution,
I'm asking for some help here. The drawing that I need, has more than
three points, but I think, once I understand this, the rest will be easier
to understand. (I also have problems with pasting my code in the question.
I always have to edit it.)
\documentclass{article}
\usepackage{pgfplots}
\usetkzobj{all} %also needed
\begin{document}
\begin{tikzpicture}
\coordinate (M) at (0,0) ;
\coordinate (A) at (canvas polar cs:angle=90,radius=3cm) ;
\coordinate (B) at (canvas polar cs:angle=-30,radius=3cm) ;
\coordinate (C) at (canvas polar cs:angle=30,radius=3cm);
\draw[fill=red!30] (A)-- +(-60:2cm) arc (-60:-30:2cm) -- cycle;
\draw (M) circle (3cm);
\fill (M) circle (1pt) node[below left] {M};
\draw (A) -- (B);
\draw (A) -- (C);
\filldraw (A) circle(1pt) node[above] {A};
\filldraw (B) circle(1pt) node[right] {B};
\filldraw (C) circle(1pt) node[right] {C};
\draw (B) -- (C);
\draw(70:2.4cm) node {$\alpha$};
%the answer thanks to Claudio
\tkzMarkAngle[fill= orange,size=0.65cm, opacity=.4](A,C,B)
\tkzLabelAngle[pos = -0.5](A,C,B){$\gamma$}
%end answer
\end{tikzpicture}
\end{document}
No comments:
Post a Comment