embed interactive cycloid plot in beamer+sagetex
I have the following graph and would like to included it on a beamer presentation. It there a way to embed this onto the pdf beamer file? I have sagetex running and working well, works for much of the math on my beamer lectures.
var('x,t,y,t,theta');
@interact
def _(degrees=(1..720)):
r=4;
x=r*(t-sin(t));
y=r*(1-cos(t));
P= point((x.substitute(t=degrees*pi/180), y.substitute(t=degrees*pi/180)), size=80, rgbcolor=(1,0,0));
C = circle((degrees*pi/180*4,4), 4, hue=.7);
A = P+C+parametric_plot((x,y), (t,0,degrees*pi/180), rgbcolor=(1,0,0), xmin=-.5, xmax=80, ymin=-1, ymax=10);
show(A, xmin=-5.5, xmax=80, ymin=-1, ymax=10)
see link
Can you explain exactly what isn't working? Plots typically should work just as in the SageTeX documentation. If SageTeX is otherwise working then a plot should work - note you need to use the
\sageplot{}
command for plots.The code has the
@interact
decorator, not sure if pdf supports input components. If you want to display an animation, perhaps just generating the frames and using theanimate
package will do the job. (You would be stuck to using a specific pdf viewer in such a case, though.)