Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 99
x, y = var('x, y') plot3d(y^2-x^2, (x,-1,1), (y,-1,1)) print('\n') print('You can click and rotate the image to view it from different angles')
3D rendering not yet implemented
You can click and rotate the image to view it from different angles
x, y = var('x, y') contour_plot(y^2-x^2, (x,-1,1), (y,-1,1), colorbar=True, axes_labels=['$x$', '$y$'])
x, y, z = var('x, y, z') implicit_plot3d( cos(x*y)==x^2 - x*z - y + sin(z), (x,-3,3), (y,-2,2), (z,-3,3) )
3D rendering not yet implemented
t = var('t') parametric_plot( ( t*cos(t), t*sin(t), t ), (t,-pi/2,pi) , thickness=3 )
3D rendering not yet implemented
s, t = var('s t') parametric_plot( ( s*cos(t), s*sin(t), t ), (s,-pi,pi), (t,-pi/2,pi) )
3D rendering not yet implemented
x, y = var('x, y') y = (sin(x)) revolution_plot3d(y, (x,0,pi)) revolution_plot3d(y, (x,pi,2*pi)) revolution_plot3d(y, (x,-pi,pi))
3D rendering not yet implemented
3D rendering not yet implemented
3D rendering not yet implemented
# First, the same function as the one above t = var('t') curve = (t, sin(t)) revolution_plot3d(curve, (t,0,pi)) # Next, the new example curve = (t+sin(2*t), t+cos(t)) revolution_plot3d(curve, (t,0,2*pi), show_curve=true)
3D rendering not yet implemented
3D rendering not yet implemented
t = var('t') curve = (t+sin(2*t), t+cos(t)) revolution_plot3d(curve, (t,-pi,4*pi), show_curve=true)
3D rendering not yet implemented
t = var('t') curve = (t+sin(2*t), t+cos(t)) revolution_plot3d(curve, (t,-pi,4*pi), parallel_axis='x', color='green', opacity=0.5)
3D rendering not yet implemented
x, y = var('x y') p = revolution_plot3d(x, (x,0,1), parallel_axis='x', rgbcolor=(1,0.5,0), opacity=0.7) q = revolution_plot3d(x^0.5, (x,0,1), parallel_axis='x', rgbcolor=(0,1,0), opacity=0.2) show(p+q)
3D rendering not yet implemented
# And here is a very interesting example I found from sagemath.sfasu.edu/home/pub/43/ # It defines a piecewise curve, rotates it about the x-axis, and then computes # the volume of the resulting shape by integration. x = var('x') f1 = -(1/pi*(x-pi))^2+3 f2 = 0.125*sin(x) + 2.875 f3 = 1.875/(6*pi-22)*(x-22) + 1 f4 = 1 f = piecewise( [ ((0,3*pi/2),f1), ((3*pi/2,6*pi),f2), ((6*pi,22),f3), ((22,23),f4) ] ) plot(f, (x,0,23), aspect_ratio=1) a = revolution_plot3d(f1, (x,0,3*pi/2), parallel_axis='x', aspect_ratio=1, color='chartreuse') b = revolution_plot3d(f2, (x,3*pi/2,6*pi), parallel_axis='x', color='violet') c = revolution_plot3d(f3, (x,6*pi,22), parallel_axis='x', color='aqua') d = revolution_plot3d(f4, (x,22,23), parallel_axis='x', color='brown') show(a+b+c+d, frame=False) # Compute the volume (exclude cap): vol = integral(pi*(f1)^2, x,0,3*pi/2) + integral(pi*(f2)^2, x,3*pi/2,6*pi) + integral(pi*(f3)^2, x, 6*pi, 22) print "\n Volume = %f" % vol
3D rendering not yet implemented
Volume = 518.314223
xl = [-4.8, -3.1, -2.2, -0.7, 0.2, 2.5, 4.0, 5.6] yl = [3.7, 2.9, 2.4, 2.2, 3.5, 5.8, 9.6, 6.3] zl = [0, 1, 2, 3, 4, 5, 6, 7] datapoints = zip(xl, yl, zl) # The "zip" command creates matched pairs from separate lists. line(datapoints) point(datapoints) list_plot3d([datapoints])
3D rendering not yet implemented
3D rendering not yet implemented
3D rendering not yet implemented
# Plot of 2 planes and their line of intersection. # The strategy is to figure out the equation of the line in parametric form. # E.g.: Let x=t; set f(x,y) == g(x,y) and find y=h(t); # plugin (t, h(t)) for (x, y) in any one of f(x,y) or g(x,y). x, y = var('x, y') p = plot3d(3*x-2*y+0.5, (x,-5,5), (y,-5,5), opacity=0.3) q = plot3d(-x+3*y-1.5, (x,-5,5), (y,-5,5), color='green', opacity=0.3) t = var('t') r = parametric_plot( ( t, (4*t+2.0)/5.0, 3*t-0.4*(4*t+2.0)+0.5 ), (t,-5.5,5.5), color='black', thickness=3 ) show(p+q+r)
3D rendering not yet implemented