3
$\begingroup$
p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
Graphics[Line[p]]

These are the x,y coordinates I got to work with in order to make a line and then make the whole thing rotate to form a 3D image.

I've tried to use RevolutionPlot3D but I only get a cone. None of the points gets used.

How do i do to get an image like this and calculate the volume of the body? Example image

//Update I was forbidden to use Interpolation ("Too advanced command for this"-Teacher) So I have to solve it without that command and am forced to make functions for every point in the line... yay...

$\endgroup$
2
  • 4
    $\begingroup$ does intF = Interpolation[p, InterpolationOrder -> 1]; RevolutionPlot3D[intF[t], {t, p[[1, 1]], p[[-1, 1]]}, RevolutionAxis -> "X"] give what you need? $\endgroup$ – kglr May 10 at 11:11
  • $\begingroup$ Yes! It does! =) Now I can get onto trying to figure out how to calculate the volyme of the thing. Thanks! $\endgroup$ – Johan Grankvist May 10 at 12:36
7
$\begingroup$

For a fixed point {x, r} ∈ Line[p], we can get a disk y^2 + z^2 <= r^2,this is the intuitive that we use to construct the rotation solid.

p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
reg = ParametricRegion[{{x, y, z}, {x, r} ∈ Line[p] && 
     y^2 + z^2 <= r^2}, {r, x, y, z}];
Volume[reg]
Region[reg]

977 π

enter image description here

p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
parametrics = (1 - t)*#1 + t*#2 & @@@ Partition[p, 2, 1];
RevolutionPlot3D[parametrics // Evaluate, {t, 0, 1}, 
 RevolutionAxis -> "X", Mesh -> None]

enter image description here

p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};
parametrics = (1 - t)*#1 + t*#2 & @@@ Partition[p, 2, 1];
regs = ParametricRegion[{#1, #2*r*Cos[θ], #2*r*
       Sin[θ]}, {{r, 0, 1}, {t, 0, 1}, {θ, 0, 
       2 π}}] & @@@ parametrics;
regs // Volume
% // Total

{4 π, 124 π, 244 π, 169 π, 193 π, 243 π}

977 π

$\endgroup$
3
  • $\begingroup$ Mathematica went into an endless loop for some reason when I tried to run the code $\endgroup$ – Johan Grankvist May 10 at 15:03
  • $\begingroup$ That is a brilliant answer @JohanGrankvist Just a quick comment; I managed to fully execute the answer given here. My version is "12.0.0 for Linux x86 (64-bit) (April 7, 2019)". Can I suggest that you quit the kernel and try again? $\endgroup$ – DiSp0sablE_H3r0 May 10 at 15:12
  • $\begingroup$ Sorry but I run the reg=ParametricRegion... fine but when it comes to Volume[reg] it freezes. $\endgroup$ – Johan Grankvist May 10 at 15:19
3
$\begingroup$
p = {{0, 0}, {3, 2}, {6, 10}, {9, 8}, {12, 7}, {15, 9}, {18, 9}};

{xmin, xmax} = MinMax[p[[All, 1]]];

As kglr suggested

intF = Interpolation[p, InterpolationOrder -> 1];

Show[
 RevolutionPlot3D[intF[x],
  {x, xmin, xmax},
  RevolutionAxis -> "X",
  ViewPoint -> Front,
  PlotPoints -> 50,
  MaxRecursion -> 5],
 Graphics3D[{Red, AbsolutePointSize[6],
   Point[{#[[1]], 0, #[[2]]} & /@ p]}]]

enter image description here

sectionVol = 
 Entity["Surface", "ConicalFrustum"][EntityProperty["Surface", "Volume"]]

enter image description here

vol = Total[
  sectionVol @@@ ({#[[1, 2]], #[[2, 2]], #[[2, 1]] - #[[1, 1]]} & /@ 
     Partition[p, 2, 1])]

(* 977 π *)

vol // N

(* 3069.34 *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.