Sharedsupport / 2016-03-28-3d.sagewsOpen in CoCalc
Examples for support purposes...

Sage Worksheets are useful for 3d plotting. See the Sage reference manual: http://doc.sagemath.org/html/en/reference/plot3d/index.html

See:


%var u, v
fx = (3*(1+sin(v)) + 2*(1-cos(v)/2)*cos(u))*cos(v)
fy = (4+2*(1-cos(v)/2)*cos(u))*sin(v)
fz = -2*(1-cos(v)/2) * sin(u)
parametric_plot3d([fx, fy, fz], (u, 0, 2*pi), (v, 0, 2*pi), color="green", opacity=.7, mesh=1)
3D rendering not yet implemented

show(tetrahedron(color='lime', opacity=.5, mesh=3))
3D rendering not yet implemented

%var x y z
g = golden_ratio; r = 4.77
p = 2 - (cos(x + g*y) + cos(x - g*y) + cos(y + g*z) +
         cos(y - g*z) + cos(z - g*x) + cos(z + g*x))
show(implicit_plot3d(p==0.5, (x, -r, r), (y, -r, r), (z, -r, r),
                plot_points=30, color='orange', mesh=1, opacity=.9))
3D rendering not yet implemented