I have a set of points, defining some 2D object (a cross-section). Here is an example:
points={{0, 0}, {14, 0}, {14.5, 1}, {15, 2}, {0, 16}}
To visualize the object:
ListLinePlot[points,Frame->True,FrameLabel->{"Radius","y-axis"}]
I would like to revolve the cross-section around the y-axis to obtain the volume of the 3D body. I would finally like to calculate fractional volumes of the 3D body by integrating over slices of the entire 3D object such as the slice radius 14 to 15.
My approach thus far was as follows (including a description of why I think it failed): The points have not always incrementing x values, therefore I cannot use Interpolation to generate an interpolating function and do the revolution as follows:
interpol=Interpolation[2Dpoints]
partialVolumes=NIntegrate[interpol[x]^2,{x,0,radius}]*Pi/@Table[radius,{radius,0,16}]
There are tons of examples of revolving functions, but non starting from discrete points describing an object.
path = First@FindCurvePath@Standardize@points; curve = Interpolation[MapIndexed[{#2[[1]], #1} &, points[[path]]], InterpolationOrder -> 1];
. Check:ParametricPlot[curve[t], {t, 1, Length@path}]
. Then, I believe you should be able to compute the integral by summing:Pi*NIntegrate[ curve[t][[1]]^2*curve'[t][[2]], {t, 1, Length@path}] // Abs
however, it seems to be wrong. I'm not sure why, but I believe it's still a possible start with a mistake to correct. $\endgroup$