I have adapted the following to draw lines from the center of a circle out to n equally spaced points on a circle (the n th roots of unity, or the points of an n-gon, or a star graph).
I need to be able to freely manipulate EDIT:four parameters:
1) the radius of the circle
2) the number n
3) the center of the circle.
EDIT:
4) the angle of inclination of the star (i.e. ability to rotate star)
With the LaTeX below I am able to do the first two, but I cannot center the circles. I need to be able to have the second circle centered at one of the points of the first circle, and I need to be able to do this generally (i.e. recursively, n-gon after n-gon, basically building rooted trees).
(I also need to be able to specify the colors of arbitrary edges and points, as the LaTeX below shows -- I assume that any technique that solves my problem with 3) will not prevent me from doing this).
Thanks in advance for your help.
\documentclass[portrait]{article}
\usepackage{tikz}
\usepackage{animate}
\usepackage[top=1in,bottom=1in,right=1in,left=1in]{geometry}
\begin{document}
\begin{tikzpicture}[scale=5.3,cap=round,>=latex]
\foreach \x in {0,60,...,360} {
% lines from center to point
\draw[gray] (0cm,0cm) -- (\x:.1cm);
% dots at each point
\filldraw[black] (\x:.1cm) circle(0.2pt);
}
\filldraw[black] (0,0) circle(0.2pt);
\filldraw[red] (0:.1cm) circle(0.2pt);
\draw[red] (0cm,0cm) -- (0:.1cm);
\end{tikzpicture}
\begin{tikzpicture}[scale=5.3,cap=round,>=latex]
\foreach \x in {0,120,...,360} {
% lines from center to point
\draw[gray] (0,0cm) -- (\x:.1cm);
% dots at each point
\filldraw[black] (\x:.1cm) circle(0.2pt);
}
\filldraw[black] (0,0) circle(0.2pt);
\filldraw[red] (0:.1cm) circle(0.2pt);
\draw[red] (0cm,0cm) -- (0:.1cm);
\end{tikzpicture}
\end{document}