embed interactive cycloid plot in beamer+sagetex

asked 2015-12-08 19:26:00 +0200

userX gravatar image

updated 2015-12-08 19:28:01 +0200

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

edit retag flag offensive close merge delete

Comments

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.

kcrisman gravatar imagekcrisman ( 2015-12-08 20:51:40 +0200 )edit

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 the animate package will do the job. (You would be stuck to using a specific pdf viewer in such a case, though.)

fidbc gravatar imagefidbc ( 2015-12-09 00:08:49 +0200 )edit