parametric_plot3d for surface of revolution

97 views
Skip to first unread message

Jacob Hicks

unread,
Feb 12, 2008, 9:22:14 PM2/12/08
to sage-...@googlegroups.com
I am using parametric_plot3d to create surfaces of revolution for use
in demonstrations for my Calculus class. It is working very well
except that it doesn't seem to plot the upper end point of the
specified intervals.

For example, to rotate e^x from x=0 to x=1 around the x-axis
{{{
var('u,v')
f = lambda x : e^x
a = 0
b = 1
parametric_plot3d([u,sin(v)*f(u),cos(v)*f(u)],(u,a,b),(v,0,2*pi))
}}}
The graph is what I want except that it has a gap. Apparently v
doesn't go all the way to 2*pi. For now, I have added a fudge factor
to the upper limits and that is fixing the problem. When I try to
plot additional surfaces to add end-caps to the solid, the fudge
factors cause the it to stick out of the caps.

Is there a more elegant solution (such as telling it to include the
upper end point) or at least a way to tell the exact fudge factor
required to get it to plot the last little piece as closely as
possible?

Thanks,

--
Jacob Hicks
Mathematics Teacher
Trinity Collegiate School

William Stein

unread,
Feb 12, 2008, 10:21:07 PM2/12/08
to sage-...@googlegroups.com

Hi Jacob,

The above was a bug that was fixed in a recent version
of Sage. Just install sage-2.10.1 and it should work
perfectly for you (and it should _not_ work with certain
older versions). I've attached a screenshot to illustrate
this.

William

Picture 8.png

Jacob Hicks

unread,
Feb 13, 2008, 7:57:45 AM2/13/08
to sage-...@googlegroups.com
Thanks, I was actually building 2.10.1 while I was working on creating
the surfaces. They now look really good, I'll see if they help my
students visualize what is going on.

Next up on my calculus demo list is slope fields.

Jacob

David Joyner

unread,
Feb 13, 2008, 9:03:20 AM2/13/08
to sage-...@googlegroups.com
On Feb 13, 2008 7:57 AM, Jacob Hicks <jacob....@gmail.com> wrote:
>
> Thanks, I was actually building 2.10.1 while I was working on creating
> the surfaces. They now look really good, I'll see if they help my
> students visualize what is going on.
>
> Next up on my calculus demo list is slope fields.

You might want to look into examples/calculus/field_plot2d.sage
or Maxima's plotdf package (which uses gnuplot)
http://maxima.sourceforge.net/docs/manual/en/maxima_67.html

Reply all
Reply to author
Forward
0 new messages