Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc-example-files
Path: blob/master/sage/interact/Calculus/quadricSurface.sagews
Views: 1225
var('x,y,z') quadrics = {'Ellipsoid':x^2+y^2+z^2-1,'Elliptic paraboloid':x^2+y^2-z,'Hyperbolic paraboloid':x^2-y^2-z, '1-Sheeted Hyperboloid':x^2+y^2-z^2-1,'2-Sheeted Hyperboloid':x^2-y^2-z^2-1, 'Cone':x^2+y^2-z^2} @interact def quads(q = selector(quadrics.keys()), a = slider(0,5,1/2,default = 1)): f = quadrics[q].subs({x:x*a^(1/2)}) if a==0 or q=='Cone': html('<center>$'+latex(f)+' \ $'+ '(degenerate)</center>') else: html('<center>$'+latex(f)+'$ </center>') p = implicit_plot3d(f,(x,-2,2),(y,-2,2),(z,-2,2), plot_points = 75) show(p)
(x, y, z)
Interact: please open in CoCalc