# Repeated line drawing

I am trying to draw a diagram , which contains repeated lines for that i would like to use a new command. what would be the best command? any suggestions?

That diagram is this and not to worry about the grid lines

-
It is impossible to say without your minimal code. Please, explain better what you want and what you'd tried. – Sigur Dec 23 '13 at 15:07
Welcome to TeX.SX. Questions about how to draw specific graphics that just post an image of the desired result or not even that are really not reasonable questions to ask on the site. Please post a minimal compilable document showing that you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document. – Tobi Dec 23 '13 at 15:12
\foreach \angle in {0,10,...,360}{\draw[blue](0,0)--(\angle:1cm) node[fill,circle,inner sep=2pt]{};} might be a starting point – Claudio Fiandrino Dec 23 '13 at 15:20
You need to be more specific. "That diagram may be like this" is very vague. What about the grid in the background? – Werner Dec 23 '13 at 15:30

The picture is from page 34 of the pstricks-add manual; the code (after being marginally improved) is as follows:

\documentclass{article}

\begin{document}

\psset{yunit = 4, xunit = 2}
\begin{pspicture}(-1,0)(3,2)
\psgrid[subgridcolor = lightgray]
\pnodes(-1,0){A}(1,1){B}
\psline[linecolor = red](A)(3,2)
\multido{\iA = 0+10}{36}{
\psRelLine[linecolor = blue, angle = \iA](B)(A){-0.5}{EndNode}
\qdisk(EndNode){2pt}
}
\end{pspicture}

\end{document}


-
+1 for recognizing the picture. – Sigur Dec 23 '13 at 16:25

Via TiKZ draw. Use of foreach loop and scale the y axis.

Code

\documentclass{article} % or standalone
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}[yscale=2]
\draw [help lines, xstep=0.2, ystep=0.4,thin] (-1,0.2) grid (3,2.8);
\foreach \angle in {0,10,...,360}{
}
\end{tikzpicture}
\end{document}

-

A recommended solution with PSTricks just for fun!

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-node}
\psset{algebraic,plotpoints=37}

\begin{document}

\begin{pspicture}[showgrid](-2,-2)(4,4)
\curvepnodes{0}{2 Pi mul}{1.5*cos(t)+1|2.5*sin(t)+1}{P}
\multido{\i=0+1}{\Pnodecount}{\psline{-*}(1,1)(P\i)}
\end{pspicture}

\end{document}


## Animated version

This is the orbit of our earth around the sun.

\documentclass[pstricks,border=12pt]{standalone}
\usepackage{pst-plot,pst-node}
\psset{algebraic,plotpoints=37}

\begin{document}

\multido{\i=0+1}{36}{%
\begin{pspicture}[showgrid](-2,-2)(4,4)
\curvepnodes{0}{2 Pi mul}{1.5*cos(t)+1|2.5*sin(t)+1}{P}
\psline{-*}(1,1)(P\i)
\end{pspicture}}

\end{document}


-