Construct a three-dimensional surface for the solid obtained by rotating
the graph of a function f(x) around the line y = a on a
finite interval, and compute its volume and surface areas.
solid_of_revolution_y(
f,
xlim,
a,
nx = 120L,
nt = 120L,
deriv = NULL,
h = NULL,
include_end_caps = FALSE,
plot = TRUE,
colors = list(surface = "steelblue", axis = "black", curve = "firebrick"),
opacity = 0.9,
show_axis = TRUE,
show_profile_curve = TRUE,
curve_thetas = 0,
curve_width = 4,
curve_opacity = 1,
scene = list(aspectmode = "data", xaxis = list(title = "x"), yaxis = list(title = "y"),
zaxis = list(title = "z"))
)A list with components:
volume: numeric value of the volume.
surface_area_lateral: numeric value of the lateral area.
surface_area_total: numeric value of the total area.
figure: plotly object with the three-dimensional plot
if plot = TRUE and plotly is available; otherwise NULL.
Function of one numeric argument x that returns a numeric value.
Numeric vector of length two with the limits of the x interval
c(xmin, xmax), with xmax > xmin.
Numeric scalar that gives the horizontal axis of rotation.
Integer number of grid points along the x direction (for plotting).
Integer number of grid points along the angular direction (for plotting).
Optional function that returns the derivative of f. If NULL
a numeric derivative is used.
Optional numeric step for the numeric derivative.
Logical value. If TRUE the area of the circular
cross sections at the ends of the interval is added to the total area.
Logical; if TRUE and plotly is available, the solid is drawn.
List with optional entries surface, axis and curve that
control the colours used in the plot.
Numeric value between 0 and 1 that controls the surface opacity in the plot.
Logical value indicating whether the axis of rotation is drawn.
Logical value indicating whether the generating curve is drawn on the surface.
Numeric vector of angles (in radians) where profile curves are drawn.
Numeric line width for the profile curves.
Numeric value between 0 and 1 for the profile curves.
List of plotly scene options used in plotly::layout().
f <- function(x) sqrt(x)
solid_of_revolution_y(f, xlim = c(0, 4), a = 0, plot = FALSE)
Run the code above in your browser using DataLab