AUTHORS:
Return a plot of a revolved curve.
There are three ways to call this function:
INPUT:
curve - A curve to be revolved, specified as a function, a 2-tuple or a 3-tuple.
trange - A 3-tuple where t is the independent variable of the curve.
phirange - A 2-tuple of the form , (default
) that specifies the angle in which the curve is to be revolved.
parallel_axis - A string (Either ‘x’, ‘y’, or ‘z’) that specifies the coordinate axis parallel to the revolution axis.
axis - A 2-tuple that specifies the position of the revolution axis. If parallel is:
- ‘z’ - then axis is the point in which the revolution axis intersects the
plane.
- ‘x’ - then axis is the point in which the revolution axis intersects the
plane.
- ‘y’ - then axis is the point in which the revolution axis intersects the
plane.
print_vector - If True, the parametrization of the surface of revolution will be printed.
show_curve - If True, the curve will be displayed.
EXAMPLES:
Let’s revolve a simple function around different axes:
sage: u = var('u')
sage: f=u^2
sage: revolution_plot3d(f,(u,0,2),show_curve=True,opacity=0.7).show(aspect_ratio=(1,1,1))
If we move slightly the axis, we get a goblet-like surface:
sage: revolution_plot3d(f,(u,0,2),axis=(1,0.2),show_curve=True,opacity=0.5).show(aspect_ratio=(1,1,1))
A common problem in calculus books, find the volume within the following revolution solid:
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()
Now let’s revolve a parametrically defined circle. We can play with the topology of the surface by changing the axis, an axis in (as the previous one) will produce a sphere-like surface:
sage: u = var('u')
sage: circle=(cos(u),sin(u))
sage: revolution_plot3d(circle,(u,0,2*pi),axis=(0,0),show_curve=True,opacity=0.5).show(aspect_ratio=(1,1,1))
An axis on will produce a cylinder-like surface:
sage: revolution_plot3d(circle,(u,0,2*pi),axis=(0,2),show_curve=True,opacity=0.5).show(aspect_ratio=(1,1,1))
And any other axis will produce a torus-like surface:
sage: revolution_plot3d(circle,(u,0,2*pi),axis=(2,0),show_curve=True,opacity=0.5).show(aspect_ratio=(1,1,1))
Now, we can get another goblet-like surface by revolving a curve in 3d:
sage: u = var('u')
sage: curve=(u,cos(4*u),u^2)
sage: revolution_plot3d(curve,(u,0,2),show_curve=True,parallel_axis='z',axis=(1,.2),opacity=0.5).show(aspect_ratio=(1,1,1))
A curvy curve with only a quarter turn:
sage: u = var('u')
sage: curve=(sin(3*u),.8*cos(4*u),cos(u))
sage: revolution_plot3d(curve,(u,0,pi),(0,pi/2),show_curve=True,parallel_axis='z',opacity=0.5).show(aspect_ratio=(1,1,1),frame=False)