CoCalc Shared Filescicloide animada.sagewsOpen in CoCalc with one click!
Author: Leon Denis
Views : 8
%var t r=1 npi=5*pi cicloide_plot_fixo=parametric_plot((r*(t-sin(t)), r*(1-cos(t))), (t,0.001, npi), linestyle='--', title='Cicloide animada com Sage by Leon') def cicloide(theta): cicloide_plot_fixo=parametric_plot((r*(t-sin(t)), r*(1-cos(t))), (t,0.001, npi), linestyle='--', title='Cicloide animada com Sage by Leon') cicloide_plot=parametric_plot((r*(t-sin(t)), r*(1-cos(t))), (t,0.001, theta)) circulo_plot=parametric_plot((theta+cos(t), 1+sin(t)), (t,0,2*pi), color='red', fill=True, fillcolor='#ccc') ponto=point((theta-sin(theta),1-cos(theta)), color='black', size=20) centro=point((theta,1), color='black', size=20) linha=line([(theta-sin(theta),1-cos(theta)), (theta, 1)], color='black') return cicloide_plot + circulo_plot+ ponto + centro+ linha + cicloide_plot_fixo a = animate([cicloide(i) for i in srange(.1,npi-.1,npi/60)],xmax = 15, ymin = 0, ymax = 2.3, figsize = [10,2.3], axes = False) a.show() a.save('cicloid.gif')