| vc_revolution | R Documentation |
Compute a volume of revolution from a planar strip region
vc_revolution(
f,
interval,
g = NULL,
variable = c("x", "y"),
axis = c("horizontal", "vertical"),
axis_at = 0,
breaks = NULL,
quadrature = c("adaptive", "trapezoid", "simpson"),
n = 32L,
abs_tol = 1e-08,
rel_tol = 1e-08,
subdivisions = 100L
)
f |
Deterministic function accepting a real scalar and returning one finite real scalar. Vectorization is not required. |
interval |
Two finite real bounds, allowing reversed or equal bounds. |
g |
Second scalar boundary function; NULL means zero. |
variable |
Independent coordinate of f and g: x means y=f(x), y=g(x); y means x=f(y), x=g(y). |
axis |
Physical rotation axis: horizontal means y=axis_at; vertical means x=axis_at. |
axis_at |
Finite scalar position of the axis. |
breaks |
Optional finite strictly increasing interior integration split points, for example known intersections. These are not found automatically. |
quadrature |
Integration rule: adaptive, trapezoid or simpson. |
n |
Initial number of equal cells for fixed rules; positive integer, even and at least two for Simpson. Ignored by the adaptive rule. |
abs_tol, rel_tol |
Nonnegative finite absolute and relative diagnostic tolerances; at least one must be positive. Adaptive integration also applies the tolerance restrictions of stats::integrate(). |
subdivisions |
Positive integer maximum adaptive subinterval count; ignored by fixed rules. |
The region consists of segments between f and g at each independent
coordinate, with g=0 by default. Washers apply for x/horizontal or
y/vertical; shells apply for x/vertical or y/horizontal. Washer radii
account for a region crossing its axis: the inner radius is zero and the
outer radius is the larger distance. Otherwise use the two endpoint
distances. No subtraction of squared signed heights is used.
Shells integrate 2*pi*abs(t-axis_at)*abs(f(t)-g(t)); the interval must be
entirely on one side of the axis, including an endpoint on it. Crossing
the axis is rejected because shells from opposite sides can overlap;
simply splitting and summing does not generally fix double counting.
Sorted/equal bounds follow geometric-volume conventions. Quadrature may
miss features; neither integration nor plots certify the region hypotheses.
To recover rotation of the region between f and a shifted horizontal
axis, explicitly supply g=function(t)axis_at (default g is zero).
Plain list with type, sorted interval, breaks, variable, axis, axis_at, method (washers or shells), quadrature (rule name), estimate (nonnegative volume), integral (full segmented quadrature diagnostics), and note. Disks are washers with zero inner radius.
identity |> vc_revolution(c(0,1)) # cone: pi/3
(function(x)sqrt(1-x^2)) |> vc_revolution(c(-1,1)) # sphere: 4*pi/3
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.