@Einstein44 :
We'll position the bottle so its rotation axis is the x-axis.
The points you have on the bottles surface (inside or outside - depending on which volume you want) will be a series of (x,r) pairs with monotonically increasing x values, such as this:
(0,1.8), (0.5,2), (3,2), (3.5,1), (4,0.5), (5,0.5)
I then choose the
Monotone cubic Hermite interpolation for my interpolations.
This requires that the slope of the curve be known at each sample point.
So I set up my spread sheet as follows:
Rows 1 and 3: Left blank.
Row 2: field labels in bold starting in column B: X, R, m, T3, T2, T1, T0, Width, V/(Pi W), V
Rows 4-9, my sample points and calculations:
-- Column B - The "X"s: 0, 0.5, 3, 3.5, 4, 5
-- Column C - The "r"s: 1.8, 2, 2, 1, 0.5, 0.5
-- Column D - The "m"s (slopes):
-- -- Use =IF(OR(C3="",C5=""),0,(C5-C3)/(B5-B3)) for D4, then copy that to D5-9.
-- -- My results are 0, 0.067, -0.333, -1.5, -0.333, 0
-- -- Note 1: that the method I am using forces the endpoint slopes to zero.
-- -- Note 2: This is not the same "Interpolant Selection" specified in the wiki article.
-- Column E to H (parameters to the cubic function of t):
-- -- In each case, I am specifying the equation that appears in Row 4.
-- -- That value must then be copied to rows 5 to 8 (row 9 is left blank).
-- -- E (factor for ##t^3## term): =2*C4+D4-2*C5+D5
-- -- F (factor for ##t^2## term): =-3*C4-2*D4+3*C5-D5
-- -- G (factor for ##t^1## term): =D4
-- -- H (factor for ##t^0## term): =C4
-- -- Note: These formula are based on the "expanded" column of the equations for
the Cubic spline Representations table.
-- Column I (Width):
-- -- Use =B5-B4 for I4, then copy that to I5-9.
-- -- Note: These are the "widths" of the spline segments. These values needs to be multiplied into the final volume calculation for each segment.
-- Column J (Volume/##\pi## Width):
-- -- I have set you up for the integration. Each segment is the integration of t=0 to 1 of the cubic polynomial with terms T3, T2, T1, and T0. I removed the "pi" factor from the integration - saving it for the last step.
-- -- I'm expecting you to do this step !
-- Column K (Volume):
-- -- Some simple multiplies and then add up the segments.
-- -- I'm expecting you to do this step !
My result was 43.66:
My | Example | | | | | | | | | |
| X | R | m | T3 | T2 | T1 | T0 | Width | V/(Pi W) | V |
| | | | | | | | | | |
| 0.0000 | 1.8000 | 0.0000 | -0.3333 | 0.5333 | 0.0000 | 1.8000 | 0.5000 | *.**** | *.**** |
| 0.5000 | 2.0000 | 0.0667 | -0.2667 | 0.2000 | 0.0667 | 2.0000 | 2.5000 | *.**** | *.**** |
| 3.0000 | 2.0000 | -0.3333 | 0.1667 | -0.8333 | -0.3333 | 2.0000 | 0.5000 | *.**** | *.**** |
| 3.5000 | 1.0000 | -1.5000 | -0.8333 | 1.8333 | -1.5000 | 1.0000 | 0.5000 | *.**** | *.**** |
| 4.0000 | 0.5000 | -0.3333 | -0.3333 | 0.6667 | -0.3333 | 0.5000 | 1.0000 | *.**** | *.**** |
| 5.0000 | 0.5000 | 0.0000 | | | | | | | |
| | | | | | | | | | 43.6614 |
As a check, I did this without interpolation and got 45.1447.
The Example Bottle: