Ask Your Question

How to plot solids of revolution

asked 2011-02-27 01:54:58 -0500

trk gravatar image


Is it possible to plot the solid generated by revolving a curve about a line?

For example, I want to see what kind of solid is generated from this question:

Use shells to find the solid generated from the region in the 1st quadrant bounded by $y=x$ and $y=x^2$, revolved about $x=-1$.

The volume of the solid is $\frac{\pi}{2}$. How can I view this solid? I checked the sage calculus tutorial for clues but couldn't find any.

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2011-02-27 03:25:10 -0500

DSM gravatar image

updated 2011-02-27 03:53:53 -0500

It might take a bit of tweaking to get what you want, but one option is to take a look at the semi-secret function revolution_plot3d. The documentation (help(revolution_plot3d) or revolution_plot3d?) has an example which is similar to yours but still different:

        sage: line=u
        sage: parabola=u^2
        sage: sur1=revolution_plot3d(line,(u,0,1),opacity=0.5,rgbcolor=(1,0.5,0),show_curve=True,parallel_axis='x')
        sage: sur2=revolution_plot3d(parabola,(u,0,1),opacity=0.5,rgbcolor=(0,1,0),show_curve=True,parallel_axis='x')
        sage: (sur1+sur2).show()

image description

which produces the above picture. You could also do it with parametric_plot3d/implicit_plot3d, but you'd have to do the revolution manually (i.e. multiply x, y, and z by the appropriate trigonometric functions).

edit flag offensive delete link more

answered 2011-02-27 02:21:36 -0500

niles gravatar image

updated 2011-02-27 09:56:13 -0500

I think cylindrical_plot3d might be what you're looking for. Convert your equations to give x as a function of y, and then use this to compute the radius for each value of y. Of course you also need to compute where your equations intersect to get the appropriate bounds for y. I've omitted this step for now . . .

sage: var('y,theta')
(y, theta)
sage: s1 = cylindrical_plot3d(y+1,(theta,0,3*pi/2),(y,0,1), opacity=1, aspect_ratio=1)
sage: s2 = cylindrical_plot3d(sqrt(y)+1,(theta,0,3*pi/2),(y,0,1), opacity=.5, color='red')
sage: s1+s2

image description

(Note, in this version I just let theta run from 0 to 3*pi/2 so you could see just part of the revolved surfaces. Go all the way to 2*pi to see the entire object.)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-02-27 01:54:58 -0500

Seen: 1,060 times

Last updated: Feb 27 '11