Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

Jupyter notebook ChristmasTree.ipynb

Views: 230
Kernel: SageMath 9.7

Christmas tree with lights

var('t k') from sage.plot.plot3d.shapes import * num_wraps=4 num_lights=30 c=rainbow(num_lights) f(t) = ( (1-t)*cos(2*pi*t*num_wraps), (1-t)*sin(2*pi*t*num_wraps),t) lights=add([point(f(1/(num_lights)*(k+1)),color=c[k],size=50) for k in range(0,num_lights)]) S = Cone(1, 1, color='green') S += parametric_plot3d(f(t),(t,0,1),thickness=3 ) S += lights S.show()
S.show(frame=False)
S.save('Tree.png',frame=False)