Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168745
Image: ubuntu2004
S = sphere(opacity=0.8, aspect_ratio=[1,1,1]) L = line3d([(0,0,0),(2,0,0)], thickness=10, color='red') M = S + S.translate((2,0,0)) + L M.show(viewer='tachyon')
sage: from sage.plot.plot3d.tachyon import Axis_aligned_box sage: aab = Axis_aligned_box((0,0,0),(1,1,1),'s') sage: aab.str() '\n box min 0.0 0.0 0.0 max 1.0 1.0 1.0 s\n '
'\n box min 0.0 0.0 0.0 max 1.0 1.0 1.0 s\n '
sage: t = Tachyon(xres=512,yres=512, camera_center=(3,0.3,0)) sage: t.light((4,3,2), 0.2, (1,1,1)) sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0)) sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0)) sage: t.texture('t2', ambient=0.2,diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0)) sage: k=0 sage: for i in srange(-1,1,0.05): ... k += 1 ... t.sphere((i,i^2-0.5,i^3), 0.1, 't%s'%(k%3)) ... sage: t.show()
sage: t = Tachyon(xres=512,yres=512, camera_center=(3,0.3,0), raydepth=8) sage: t.light((4,3,2), 0.2, (1,1,1)) sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1.0,0,0)) sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.3, opacity=1.0, color=(0,1.0,0)) sage: t.texture('t2', ambient=0.2,diffuse=0.7, specular=0.5, opacity=0.7, color=(0,0,1.0)) sage: t.texture('white', color=(1,1,1)) sage: t.plane((0,0,-1), (0,0,1), 'white') sage: t.plane((0,-20,0), (0,1,0), 'white') sage: t.plane((-20,0,0), (1,0,0), 'white') sage: k=0 sage: for i in srange(-1,1,0.05): ... k += 1 ... t.sphere((i,i^2 - 0.5,i^3), 0.1, 't%s'%(k%3)) ... t.cylinder((0,0,0), (0,0,1), 0.05,'t1') ... sage: t.show()
sage: t = Tachyon(camera_center=(5,2,2), look_at=(0,1,0)) sage: t.light((10,3,2), 0.2, (1,1,1)) sage: t.texture('t0', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(1,0,0)) sage: t.texture('t1', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(0,1,0)) sage: t.texture('t2', ambient=0.1, diffuse=0.9, specular=0.5, opacity=1.0, color=(0,0,1)) sage: E = EllipticCurve('37a') sage: P = E([0,0]) sage: Q = P sage: n = 100 sage: for i in range(n): # increase 20 for a better plot ... Q = Q + P ... t.sphere((Q[1], Q[0], ZZ(i)/n), 0.1, 't%s'%(i%3)) ... sage: t.show()
sage: t = Tachyon(camera_center=(2,5,4), look_at=(2,0,0), raydepth=6) sage: t.light((10,3,4), 1, (1,1,1)) sage: t.texture('mirror', ambient=0.05, diffuse=0.05, specular=.9, opacity=0.9, color=(.8,.8,.8)) sage: t.texture('grey', color=(.8,.8,.8), texfunc=3) sage: t.plane((0,0,0),(0,0,1),'grey') sage: t.sphere((4,-1,1), 1, 'mirror') sage: t.sphere((0,-1,1), 1, 'mirror') sage: t.sphere((2,-1,1), 0.5, 'mirror') sage: t.sphere((2,1,1), 0.5, 'mirror') sage: show(t)