Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168730
Image: ubuntu2004

Identifying and Drawing a Conic Section

var("x y") implicit_plot(5*x^2 + 4*x*y + 2*y^2 - 24*x - 12*y + 18,(x,1-sqrt(5),2+sqrt(5)),(y,-3,5))

Introducing a Parametrized Curve

var('t') parametric_plot( (t^3-3*t, t^2), (t, -2, 2))

Finding an equation for a Cycloid and Drawing Its Graph

var('t') parametric_plot( (2*(t-sin(t)), 2*(1-cos(t))), (t, 0, 3*pi),aspect_ratio = 1)

More Examples with Animations

var('s') #L=parametric_plot((2*cos(t)+cos(2*t+pi), 2*sin(t)+sin(2*t+pi)), (t, 0, 2*pi),aspect_ratio=1) # resulting picture #Now, with an animation! L=circle((0,0),1,color="black") # inner circle v=[L+parametric_plot((2*cos(s)+cos(2*s+pi), 2*sin(s)+sin(2*s+pi)), (s, -0.1,t),aspect_ratio=1) +circle((2*cos(t),2*sin(t)),1,color="pink")+point((2*cos(t)+cos(2*t+pi),2*sin(t)+sin(2*t+pi)), color='blue',pointsize=30,faceted=True) for t in srange(0,2*pi,pi/20)] a=animate(v,xmin=-3,ymin=-3,xmax=3,ymax=3,figsize=[6,6]) a.show()
#t = var('t') #parametric_plot( (1.5*cos(t)+.5*cos(3*t+pi), 1.5*sin(t)+.5*sin(3*t+pi)), (t, 0, 2*pi)) s = var('s') L=circle((0,0),1,color="black",aspect_ratio=1) # inner circle v=[L+parametric_plot((1.5*cos(s)+.5*cos(3*s+pi), 1.5*sin(s)+.5*sin(3*s+pi)),(s,-.1,t))+circle((1.5*cos(t),1.5*sin(t)),.5,color="pink")+point((1.5*cos(t)+.5*cos(3*t+pi),1.5*sin(t)+.5*sin(3*t+pi)), color='blue',pointsize=30) for t in srange(0,2*pi,pi/20)] a=animate(v,xmin=-2,ymin=-2,xmax=2,ymax=2,figsize=[4,4]) a.show()

3D Graphing

var('x,y,z') sp1=implicit_plot3d(x^2 + y^2 + z^2, (x, -2, 2), (y, -2, 2), (z, -2, 2), contour=1, opacity=0.8, color='yellow',viewer='tachyon') sp2=implicit_plot3d(x^2 + y^2 + z^2, (x, -2, 2), (y, -2, 2), (z, -2, 2), contour=4, opacity=0.4, color='blue', region=lambda x,y,z: x<=.9 or y>=-.9 or z<=.9,plot_points=250)#,frame=False) sp1+sp2

Interactive 3D

(Try to grab the image after the Java applet initialized and rotate it!)

var('x,y,z') a=3 pl1=implicit_plot3d(x-y+z+2,(x,-a,a),(y,-a,a),(z,-a,a),opacity=0.7,color='blue') sp2=implicit_plot3d(x^2 + y^2 + z^2, (x, -2, 2), (y, -2, 2), (z, -2, 2), contour=4, opacity=0.7, color='yellow') pl1+sp2