# How can I create a dynamic geometry file in Tex?

I have a file containing

\documentclass[10pt]{article}
\usepackage{pgf,tikz}
\usetikzlibrary{arrows}
\pagestyle{empty}
\begin{document}
\definecolor{uququq}{rgb}{0.25,0.25,0.25}
\definecolor{tttttt}{rgb}{0.2,0.2,0.2}
\begin{tikzpicture}[line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]
\clip(-2.5,-1.5) rectangle (4.5,6.08);
\draw(-0.5,2) circle (1.5cm);
\draw(1,2) circle (3cm);
\draw (0.5,4.24)-- (1,2);
\draw (1,2)-- (2.25,3.12);
\draw (0.5,4.24)-- (2.5,2);
\draw(0.25,2) circle (2.25cm);
\draw(1.75,2) circle (0.75cm);
\draw (1,2)-- (2.5,2);
\draw (1.73,2.08) -- (1.73,1.92);
\draw (1.77,2.08) -- (1.77,1.92);
\draw (2.5,2)-- (4,2);
\draw (3.23,2.08) -- (3.23,1.92);
\draw (3.27,2.08) -- (3.27,1.92);
\draw (-2,2)-- (1,2);
\draw (-2,2)-- (-0.34,3.49);
\draw (-0.34,3.49)-- (0.5,4.24);
\draw (0.05,3.93) -- (0.11,3.79);
\draw (0.5,4.24)-- (1.33,4.98);
\draw (0.88,4.68) -- (0.94,4.54);
\draw (0.5,4.24)-- (2.25,3.12);
\draw (1.35,3.78) -- (1.31,3.63);
\draw (1.39,3.75) -- (1.35,3.6);
\draw (1.43,3.73) -- (1.39,3.58);
\draw (2.25,3.12)-- (4,2);
\draw (3.11,2.66) -- (3.06,2.51);
\draw (3.15,2.63) -- (3.1,2.48);
\draw (3.19,2.61) -- (3.14,2.46);
\begin{scriptsize}
\fill [color=tttttt] (-2,2) circle (1.5pt);
\draw[color=tttttt] (-2.23,1.68) node {$A$};
\fill [color=black] (4,2) circle (1.5pt);
\draw[color=black] (4.1,2.26) node {$B$};
\fill [color=uququq] (1,2) circle (1.5pt);
\draw[color=uququq] (1.02,1.57) node {$C$};
\fill [color=uququq] (-0.5,2) circle (1.5pt);
\draw[color=uququq] (-0.4,2.26) node {$D$};
\fill [color=black] (-0.34,3.49) circle (1.5pt);
\draw[color=black] (-0.36,3.82) node {$M$};
\fill [color=uququq] (1.33,4.98) circle (1.5pt);
\draw[color=uququq] (1.34,5.35) node {$N$};
\fill [color=uququq] (0.5,4.24) circle (1.5pt);
\draw[color=uququq] (0.48,4.59) node {$H$};
\fill [color=uququq] (2.5,2) circle (1.5pt);
\draw[color=uququq] (2.56,1.9) node {$I$};
\fill [color=uququq] (2.25,3.12) circle (1.5pt);
\draw[color=uququq] (2.34,3.38) node {$J$};
\fill [color=uququq] (1.83,2.75) circle (1.5pt);
\draw[color=uququq] (1.79,2.5) node {$G$};
\end{scriptsize}
\end{tikzpicture}
\end{document}


and file was written in the program GeoGebra and I uploaded at http://www.mediafire.com/?r61yp96mwlm3t1h

How can I create a file that point M moves on a circle in Tex as in GeoGebra?

-
You can do this directly from GeoGebra as described here: prep11geogebra.pbworks.com/w/page/36696026/… –  student Oct 13 '12 at 13:09
However I don't know how to make a dynamic worksheet just out of plain tikz code... For me the question seems more to be a GeoGebra question and not a TeX question. Perhaps you could point out why your question is really related to LaTeX. Otherwise I think the question would better fit on superuser.com or something like that... –  student Oct 13 '12 at 13:10
You can not create a dynamic .pdf file with LaTeX. Once you compile your file you have a static .pdf (or other formats). What you can do is to use many layers on a beamer file to produce the idea of movement. But your $M$ point was not defined as the variable point so you will have a lot of things to do to produce the other figures with respect to the position of $M$. –  Sigur Oct 13 '12 at 13:34
Thank you very much. –  minthao_2011 Oct 13 '12 at 14:17
This answer -- tex.stackexchange.com/a/73440/11232 will/may give you some idea on getting animations in pdf files. see the updates in that answer. –  Harish Kumar Oct 13 '12 at 14:24

A clickable PDF animation, created as a modified version of the demo inlinemovie.tex:

\documentclass{article}
\usepackage{lmodern}
\usepackage[inline]{asymptote}
\usepackage{animate}
\begin{document}

Here is an inline PDF movie, generated with the commands
\begin{verbatim}
pdflatex inlinemovie
asy inlinemovie-*.asy
pdflatex inlinemovie
\end{verbatim}
or equivalently,
\begin{verbatim}
latexmk -pdf inlinemovie
\end{verbatim}

\begin{center}
\begin{asy}
import markers;
import animate;
animation Anim=animation("movie1");
real phi;

picture pic;
size(pic,300);

for(int i=0; i < 40; ++i) {
phi=100-2*i;
guide circ1=circle((5,0),1);
guide circ2=circle((2,0),2);
guide circ3=circle((3,0),3);
guide circ4=circle((4,0),4);

pair A,B,C,D,G,H,I,J,M,NN;
pair AMp;
A=(0,0); B=(8,0); D=(2,0);
C=(4,0); I=(6,0);

M=shift(D)*rotate(phi)*(2,0);
AMp=0.5(A+M);

guide AM=M--(M+dir(M-AMp)*10);
NN=intersectionpoint(AM,circ4);
H=0.5(M+NN);
J=0.5(H+B);

draw(pic,A--C);
draw(pic,A--M);
draw(pic,M--NN,StickIntervalMarker(2,1,angle=-20,red,dotframe(black)));
draw(pic,C--B,StickIntervalMarker(2,2,angle=-20,darkgreen,dotframe(black)));
draw(pic,H--B,StickIntervalMarker(2,3,angle=-20,blue,dotframe(black)));

draw(pic,J--C);
draw(pic,H--C);
draw(pic,H--I);

label(pic,"$H$",H,NW);
G=intersectionpoint(J--C,H--I);

dot(pic,A);
dot(pic,B);
dot(pic,C);
dot(pic,D);
dot(pic,M);
dot(pic,NN);
dot(pic,G);
dot(pic,H);
dot(pic,J);
label(pic,"$A$",A,W);
label(pic,"$B$",B,E);
label(pic,"$C$",C,SW);
label(pic,"$D$",D,N);
label(pic,"$M$",M,NW);
label(pic,"$N$",NN,dir(M-A));
label(pic,"$G$",G,S);
label(pic,"$H$",H,NW);
label(pic,"$I$",I,SE);
label(pic,"$J$",J,NE);

draw(pic,circ1);
draw(pic,circ2);
draw(pic,circ3);
draw(pic,circ4);


For more details see texdoc asymptote.