[Tex/LaTex] Drawing triangles using lengths and angles

diagramstikz-pgf

I am just about getting my head around the tikz point grid and have managed to draw triangles using this method, but is there a way I can draw by directly inputing line lengths and angles?

e.g. if I wanted angles of 125 degrees, 40 Degrees and 15 degrees with the Hypotenuse at 15cm, how would I set this out?

Best Answer

Like this?

\documentclass[margin=1cm]{standalone}

\usepackage{tikz}
\usetikzlibrary{intersections}

\begin{document}
  \begin{tikzpicture}
  \def\angf{40} %First angle
  \def\angs{125} %Second angle
  \def\hypo{15} %Hypotenus
  \coordinate (O) at (0,0);
  \draw[name path=line 1] (O) --++ (\angf:\hypo) coordinate (A);
  \path[name path=line 2] (O) --++ (0:2\hypo);
  \path[name path=line 3] (A) --++ (-\angs:2\hypo);
  \path [name intersections={of=line 2 and line 3,by=E}];
  \pgfresetboundingbox
  \draw (O)--(E)--(A);
  \end{tikzpicture}
\end{document}

enter image description here

Related Question