📑  SageMath Online Mini Campus. Code Set 22

🌀   Homepage     🌀   GitHub Pages     🌀   Previous     🌀   Next     🌀   Instagram Posts     🌀   Pinterest Posts

The set of interactive pages with the following structure:

Example of Computations $\mathbb{\implies}$ Your Experiments $\mathbb{\implies}$ Python Modules $\mathbb{\implies}$ Other Languages

Example of Computations

Click the $\mathbb{activate}$ button below to display an interactive example.


sx='$x=-%.1f*cos(%.1f*t)-%.1f*cos(%.1f*t)+%.1f*sin(%.1f*t)$'
sy='$y=-%.1f*cos(%.1f*t)+%.1f*sin(%.1f*t)-%.1f*sin(%.1f*t)$'
sz='$z=%.1f*cos(%.1f*t)$'
def L(i): return (-a*cos(d*i)-b*cos(e*i)+c*sin(f*i),
                  -c*cos(f*i)+a*sin(d*i)-b*sin(e*i),
                  a*cos(g*i))
@interact
def _(a=[10,15,20],b=[2,4,6],c=[15,10,5]):
    d=.1; e=.4; f=.2; g=.3; var('t')
    pretty_print(html(sx%(a,d,b,e,c,f)))
    pretty_print(html(sy%(c,f,a,d,b,e)))
    pretty_print(html(sz%(a,g)))
    def L(i): return (-a*cos(d*i)-b*cos(e*i)+c*sin(f*i),
                      -c*cos(f*i)+a*sin(d*i)-b*sin(e*i),
                      a*cos(g*i))
    p=sum([line3d([L(i),L(i+1)],radius=.5,
                  color=colormaps.winter(4*i)[:3]) 
           for i in [0..64]])
    p.show(frame=False)


Your Experiments

Type your own SageMath code lines below and click the $\mathbb{evaluate}$ button.


This code cell was evaluated automatically.


Python Modules

Other Languages (R, HTML, ...)

Click $\mathbb{evaluate}$ and then explore onclick events in the output