On Jan 18, 2008 10:29 AM, Hector Villafuerte <[EMAIL PROTECTED]> wrote:
>
> Nice plots, thanks David!
> About the cardiod, I gave it a try and started with this:
>
> var('t')
> a = 1
> fx = a*cos(t)*(1-cos(t))
> fy = a*sin(t)*(1-cos(t))*exp(-0.5*t)
> f1 = (fx, fy)
> parametric_plot(f1, 0, pi)
>
> which then extended to this:
>
> var('t v')
> a = 1
> fx = a*cos(t)*(1-cos(t))
> fy = a*sin(t)*(1-cos(t))*exp(-0.5*t)*cos(v)
> fz = a*sin(t)*(1-cos(t))*exp(-0.5*t)*sin(v)
> f = (fx, fy, fz)
> parametric_plot3d(f, (t,0,pi), (v,0,2*pi), rgbcolor='red')
>
> Will your wife settle for an apple instead? :)Thanks, looks nice. Very strangely, after running the commands that Jaap posted in a separate email (smaller mayavi package), jmol now works on my trusty/crusty/rusty old 64bit feisty fawn machine!! > -- > Hector > > > > On Jan 18, 2008 9:06 AM, William Stein <[EMAIL PROTECTED]> wrote: > > On Jan 18, 2008 6:24 AM, David Joyner <[EMAIL PROTECTED]> wrote: > > > > > > Hi: > > > > > > Here are a few examples which I think are interesting. > > > > > > If anyone can figure out a way to plot a cardioid, > > > http://mathworld.wolfram.com/HeartSurface.html, > > > in SAGE, I'd be very interested. > > > > > > - David Joyner > > > > > > #M\"obius strip: > > > sage: u,v = var("u,v") > > > sage: p = parametric_plot3d([cos(u)*(1+v*cos(u/2)), > > > sin(u)*(1+v*cos(u/2)), 0.2*v*sin(u/2)], (u,0, 4*pi), (v,0, > > > 0.3),plot_points=[50,50]) > > > > > > #twisted ribbon > > > sage: p = parametric_plot3d([3*sin(u)*cos(v), 3*sin(u)*sin(v), > > > cos(v)], (u,0, 2*pi), (v, 0, pi),plot_points=[50,50]) > > > > > > #ellipsoid (automatically rescaled axes make it look spherical) > > > sage: p = parametric_plot3d([3*sin(u)*cos(v), 2*sin(u)*sin(v), > > > cos(u)], (u,0, 2*pi), (v, 0, 2*pi),plot_points=[50,50]) > > > > Use the aspect_ratio option: > > > > sage: var('u,v') > > sage: parametric_plot3d([3*sin(u)*cos(v), 2*sin(u)*sin(v), cos(u)], > > (u,0, 2*pi), (v, 0, 2*pi),plot_points=[50,50], aspect_ratio=[1,1,1]) > > > > I've attached a Sage worksheet that has all the plots in this email > > rendered, > > but with a few tweeks to make some of them work right or actually work. > > > > Thanks! > > > > I'll be adding this to the examples section of parametric_plot3d. > > > > -- William > > > > > > > > #cone > > > sage: p = parametric_plot3d([u*cos(v), u*sin(v), u], (u, -1, 1), (v, > > > 0, 2*pi), plot_points=[50,50]) > > > > > > #paraboloid > > > sage: p = parametric_plot3d([u*cos(v), u*sin(v), u^2], (u, 0, 1), (v, > > > 0, 2*pi), plot_points=[50,50]) > > > > > > #hyperboloid > > > sage: p = plot3d(u^2-v^2, (u, -1, 1), (v, -1, 1), plot_points=[50,50]) > > > > > > #weird looking surface - like a M\"obius band but also an O > > > sage: p = parametric_plot3d([sin(u)*cos(u)*log(u^2)*sin(v), > > > (u^2)^(1/6)*(cos(u)^2)^(1/4)*cos(v), sin(v)], (u, -1, 1), (v, -pi, > > > pi), plot_points=[50,50]) > > > > > > > > > #a heart, but not a cardioid (for my wife) > > > sage: p1 = parametric_plot3d([sin(u)*cos(u)*log(u^2)*v*(1-v)/2, > > > ((u^6)^(1/20)*(cos(u)^2)^(1/4)-1/2)*v*(1-v), v^(0.5)], (u, 0.001, 1), > > > (v, 0, 1), plot_points=[90,90]) > > > sage: p2 = parametric_plot3d([-sin(u)*cos(u)*log(u^2)*v*(1-v)/2, > > > ((u^6)^(1/20)*(cos(u)^2)^(1/4)-1/2)*v*(1-v), v^(0.5)], (u, 0.001, 1), > > > (v, 0, 1), plot_points=[90,90]) > > > sage: show(p1+p2, frame=False) > > > > > > > > > > > > > > > > > > -- > > William Stein > > Associate Professor of Mathematics > > University of Washington > > http://wstein.org > > > > > > > > > > > > > --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-forum URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
