[Tex/LaTex] Draw lines by specifying angles

diagramstikz-pgf

I'd like to be able to draw lines in LaTeX by specifying an angle, rather than specifying it like so

\put(0,0){\line(2,1){3}}

Is this possible? I've looked at tikz and tikz-euclid. I've even tried installing tikz-euclid, but I couldn't even do that (I found these but couldn't find the .ins for tikz-euclid). And I'm not sure if that's what I want anyway.

What do I need to do to accomplish this?

Best Answer

You can read about it in the pgf manual, Section 13: Specifying Coordinates.

An example:

\documentclass{standalone}
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}
    % Draw a line at 30 degrees and of length 3
    \draw (0,0) -- (30:3cm);
\end{tikzpicture}
\end{document}

You can also use the relative coordinates:

\begin{tikzpicture}
    % Draw the first line with absolute coordinates and the 
    % second with relative coordinates to the first line
    \draw (0,0) -- (30:3cm) -- ++(80:3cm);
\end{tikzpicture}
Related Question