Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168703
Image: ubuntu2004
# Execute this first to serve notice that we need a lot of variables! var('x,y,z,t')
(x, y, z, t)
# Graphing a function R^2 -> R f(x,y) = x^2+y^2-3*y+x*y plot3d(f, (x,-5,5), (y,-5,5))
# The "egg carton surface": plot3d(sin(x)+cos(y), (x,-10,10), (y,-10,10))
# The curtate cycloid of Problem 1.2.38 a = 3 b = 2 parametric_plot( (a*t-b*sin(t),a-b*cos(t)), (t,0,4*pi))
# The twisted cubic in R^3 parametric_plot3d( (t,t^2,t^3), (t,-2,2))
# A surface and some contour curves f(x,y) = x^2+y^2-3*y+x*y P = plot3d(f(x,y), (x,-2,2), (y,-2,2)) A = plot3d(0, (x,-2,2), (y,-2,2), color='beige') B = plot3d(5, (x,-2,2), (y,-2,2), color='beige') C = plot3d(10, (x,-2,2), (y,-2,2), color='beige') D = plot3d(15, (x,-2,2), (y,-2,2), color='beige') P+A+B+C+D
# Level curves implicit_plot(f(x,y)==0, (x,-2,2), (y,-2,2)) + implicit_plot(f(x,y)==3, (x,-2,2), (y,-2,2)) + implicit_plot(f(x,y)==6, (x,-2,2), (y,-2,2)) + implicit_plot(f(x,y)==9, (x,-2,2), (y,-2,2)) + implicit_plot(f(x,y)==12, (x,-2,2), (y,-2,2)) + implicit_plot(f(x,y)==15, (x,-2,2), (y,-2,2))
contour_plot(f(x,y), (x,-2,2), (y,-2,2))
# Level surfaces of a function R^3 -> R r = 2 G(x,y,z) = x^2+4*y^2-z^2 implicit_plot3d(G(x,y,z)==0, (x,-r,r), (y,-r,r), (z,-r,r)) + implicit_plot3d(G(x,y,z)==-1, (x,-r,r), (y,-r,r), (z,-r,r),color='red')
# A vector field in R^2 plot_vector_field( (-y,x), (x,-3,3), (y,-3,3))
# A vector field in R^3 plot_vector_field3d( (y,z,x), (x,-8,8), (y,-8,8), (z,-8,8), plot_points=7 )
plot_vector_field3d( (x,y,z), (x,-3,3), (y,-3,3), (z,-3,3) )
plot_vector_field3d( (x,y,z), (x,-3,3), (y,-3,3), (z,-3,3) )