Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have to draw many figures like this:

enter image description here

with different angles but not for pie charts.

What is the easiest way to draw the lines from the center to the circumference? I searched a lot but only found uber-complicated solutions! I'm sure this must be easy, probably I'm just failing to search for the right keywords. Can anyone help?

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

If the circle has radius r, you can do this:

\draw (origin) -- (angle:r);

If the circle is centered at place other than (0, 0), you can do:

\draw (location) -- ++(angle:r);

\documentclass[convet = false, tikz]{standalone}
\begin{document}
\begin{tikzpicture}
  \draw (0, 0) circle[radius = 2cm];
  \foreach \i in {0, 30, 80, 150, 270}{
    \draw (0, 0) -- (\i:2cm);
  }

  \draw (5, 0) circle[radius = 2cm];
  \foreach \i in {0, 30, 80, 150, 270}{
    \draw (5, 0) -- ++(\i:2cm);
  }
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer
    
could you please turn your code into a MWE? –  sara s Aug 11 '13 at 23:37
    
perfect, thanks. –  sara s Aug 11 '13 at 23:42
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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