(*********************************************************************** Mathematica-Compatible Notebook This notebook can be used on any computer system with Mathematica 3.0, MathReader 3.0, or any compatible application. The data for the notebook starts with the line of stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. ***********************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 24321, 802]*) (*NotebookOutlinePosition[ 25186, 830]*) (* CellTagsIndexPosition[ 25142, 826]*) (*WindowFrame->Normal*) Notebook[{ Cell["\<\ We want to find the volume and the surface area of a cone cut by a plane in \ the particular case when the plane doesn't intersect the base of the cone. \ First we will find explicit formulas and then write a program calculating \ volume and area of convex polyhedrons in order to check our results.\ \>", "Text"], Cell["\<\ We will consider a cone with circle as its base and such that the projection \ of the cone's apex onto the base is the center of the circle. The shape of \ the cut will be an ellipse. We can assume that the base is oriented \ horizontally. Then, if the section plane is not horizontal, the ellipse will have one highest and one lowest point. If we cut this truncated cone again by \ the horizontal plane containing the lowest point, the lower part will be a \ frustum (a truncated cone with circles as bases). The formulas for it are \ well-known and so we only need to deal with the upper part of the body. In \ other words, we can assume that the section plane has one common point with \ the base of the original cone. \ \>", "Text"], Cell[TextData[{ "Let's choose the coordinate system so that the cone's base lies on the ", Cell[BoxData[ \(TraditionalForm\`xy\)]], " plane and its apex lies on positive ", Cell[BoxData[ \(TraditionalForm\`z\)]], " semiaxis. Then for any point ", Cell[BoxData[ \(TraditionalForm\`\((x, y, z)\)\)]], " of the lateral surface of the cone ", Cell[BoxData[ \(TraditionalForm\`z = H - \(H\/R\) \@\(x\^2 + y\^2\)\)]], ", ", Cell[BoxData[ \(TraditionalForm\`x\^2 + y\^2 \[LessEqual] R\^2\)]], " (where ", Cell[BoxData[ \(TraditionalForm\`R\)]], " is the radius of the base and ", Cell[BoxData[ \(TraditionalForm\`H\)]], " is the height). Also, the coordinate system can be rotated so that the \ point common to the base and the section plane will lie on the positive ", Cell[BoxData[ \(TraditionalForm\`x\)]], " semiaxis. Then the section plane will contain the tangent to the base at \ this point, which is parallel to ", Cell[BoxData[ \(TraditionalForm\`y\)]], " axis, and thus the plane will be parallel to ", Cell[BoxData[ \(TraditionalForm\`y\)]], " axis too. The equation of the plane will be ", Cell[BoxData[ \(TraditionalForm\`x + z\ \(ctg(\[Alpha])\) = R\)]], ", where ", Cell[BoxData[ \(TraditionalForm\`\[Alpha]\)]], " is the smaller angle it forms with the ", Cell[BoxData[ \(TraditionalForm\`xy\)]], " plane." }], "Text"], Cell[TextData[{ "Again, it will be more convenient for us to consider the upper part of the \ truncated cone (one can get the lower part as the complement to full cone). \ Let ", Cell[BoxData[ \(TraditionalForm\`F\)]], " be the lateral surface of the resulting truncated cone and ellipse ", Cell[BoxData[ \(TraditionalForm\`D\)]], " the base. The equation for ", Cell[BoxData[ \(TraditionalForm\`F\)]], " will obviously remain the same equation of the cone, only the domain ", Cell[BoxData[ \(TraditionalForm\`D'\)]], " over which ", Cell[BoxData[ \(TraditionalForm\`x\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y\)]], " change will be different. ", Cell[BoxData[ \(TraditionalForm\`D'\)]], " is the vertical projection of ", Cell[BoxData[ \(TraditionalForm\`D\)]], " onto the horizontal plane. It is an ellipse too (lying inside the circle \ of radius ", Cell[BoxData[ \(TraditionalForm\`R\)]], "), and if ", Cell[BoxData[ \(TraditionalForm\`\((x, y)\) \[Element] D'\)]], ", ", Cell[BoxData[ \(TraditionalForm\`\((x, y, z)\)\)]], " belongs to ", Cell[BoxData[ \(TraditionalForm\`F\)]], " (that's why we chose the upper part)." }], "Text"], Cell[TextData[{ "To define ", Cell[BoxData[ \(TraditionalForm\`D\)]], " it is enough to find only the coordinates of the ends of its axes. Their \ projections will give us the axes of ", Cell[BoxData[ \(TraditionalForm\`D'\)]], ". We can find the large axis noticing that by simmetry it lies on the \ plane ", Cell[BoxData[ \(TraditionalForm\`y = 0\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Solve[\n \t{\(\((H - z)\)\^2\) R\^2 == \(H\^2\) \((x\^2 + y\^2)\), \n\t\t x + Cot[\[Alpha]]\ z == R, \n\t\ty == 0}, \n\t{x, y, z}]\)], "Input"], Cell[BoxData[ \({{x \[Rule] R, y \[Rule] 0, z \[Rule] 0}, { x \[Rule] R - \(2\ H\ R\ Cos[\[Alpha]]\)\/\(H\ Cos[\[Alpha]] + R\ Sin[\[Alpha]]\), y \[Rule] 0, z \[Rule] \(2\ H\ R\ Sin[\[Alpha]]\)\/\(H\ Cos[\[Alpha]] + R\ Sin[\[Alpha]]\)}}\)], "Output"] }, Open ]], Cell[BoxData[ \(\({pt1, pt2} = {x, y, z} /. %; \)\)], "Input"], Cell["This is the large axis", "Text"], Cell[BoxData[ \(\(a0 = \(\(1\/2\) \@\(#.#\)&\)[pt1 - pt2]; \)\)], "Input"], Cell[TextData[{ "And the center of ", Cell[BoxData[ \(TraditionalForm\`D\)]] }], "Text"], Cell[BoxData[ \(\(cent = \(pt1 + pt2\)\/2; \)\)], "Input"], Cell[TextData[{ "We get the small axis using the fact that it is perpendicular to the ", Cell[BoxData[ \(TraditionalForm\`y\)]], " plane and therefore horizontal (and obviously contains the center)." }], "Text"], Cell[BoxData[ \(\(Solve[\n \t{\(\((H - z)\)\^2\) R\^2 == \(H\^2\) \((x\^2 + y\^2)\), \n\t\t x + Cot[\[Alpha]]\ z == R, \n\t\tz == cent[\([3]\)]}, \n\t{x, y, z}]; \)\)], "Input"], Cell[BoxData[ \(\({pt1, pt2} = {x, y, z} /. %; \)\)], "Input"], Cell[BoxData[ \(\(b0 = \(\(1\/2\) \@\(#.#\)&\)[pt1 - pt2]; \)\)], "Input"], Cell[TextData[{ "And it is easy to find the axes of ", Cell[BoxData[ \(TraditionalForm\`D'\)]] }], "Text"], Cell[BoxData[ \(a = a0\ Cos[\[Alpha]]; \nb = b0; \)], "Input"], Cell[TextData[{ "Now we will use the formula for the area of a surface in space: if ", Cell[BoxData[ \(TraditionalForm\`z = z(x, y)\)]], ", ", Cell[BoxData[ \(TraditionalForm\`\((x, y)\) \[Element] D'\)]], " then\n\n \ ", Cell[BoxData[{ FormBox[ RowBox[{ \(S = \[Integral]\(\[Integral]\(\@\(1 + \((\[PartialD]z\/\[PartialD]x)\)\^2 + \((\[PartialD]z\/\[PartialD]y)\)\^2\)\) \[DifferentialD]x \[DifferentialD]y\)\)}], TraditionalForm], FormBox[ RowBox[{ FormBox[\(\ \ \ \ \ \ \ \ \ \ D'\), "TraditionalForm"], "\n"}], TraditionalForm]}]], "\nTo parametrize the figure ", Cell[BoxData[ \(TraditionalForm\`D'\)]], " we change to generalized polar coordinates ", Cell[BoxData[ \(TraditionalForm\`x = a\ \[Rho]\ \(cos(\[Phi])\) + x\_0, y = b\ \[Rho]\ \(sin(\[Phi])\) + y\_0\)]], ". The jacobian ", Cell[BoxData[ \(TraditionalForm \`J = \(\[PartialD]\((x, y)\)\/\[PartialD]\((\[Rho], \[Phi])\) = a\ b\ \[Rho]\)\)]], ", and finally our problem is reduced to finding the value of the multiple \ integral \n\n\ ", Cell[BoxData[ \(TraditionalForm \`S = \[Integral]\+0\%\(2 \[Pi]\)\ \ \(\[Integral]\+0\%1\ \ \(\@\(1 + \((\[PartialD]z\/\[PartialD]x)\)\^2 + \((\[PartialD]z\/\[PartialD]y)\)\^2\)\) \(abs(J)\) \[DifferentialD]\[Rho] \[DifferentialD]\[Phi]\)\)]] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Block[\n\t{z = H - \(H\/R\) \@\(x\^2 + y\^2\)}, \n \@\(1 + \((\[PartialD]\_x z)\)\^2 + \((\[PartialD]\_y z)\)\^2\) // Simplify]\)], "Input"], Cell[BoxData[ \(\@\(1 + H\^2\/R\^2\)\)], "Output"] }, Open ]], Cell[TextData[{ "We see that the function is constant and since the jacobian depends only \ on ", Cell[BoxData[ \(TraditionalForm\`a\)]], " and ", Cell[BoxData[ \(TraditionalForm\`b\)]], " we don't need to find ", Cell[BoxData[ \(TraditionalForm\`x\_0\)]], " and ", Cell[BoxData[ \(TraditionalForm\`y\_0\)]], " (in our case ", Cell[BoxData[ \(TraditionalForm\`x\_0 \[NotEqual] 0\)]], ", ", Cell[BoxData[ \(TraditionalForm\`y\_0 = 0\)]], ")." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(S = \[Integral]\+0 \%\(2 \[Pi]\)\(\[Integral]\+0\%1 %\ a\ b\ \[Rho] \[DifferentialD]\[Rho] \[DifferentialD]\[Phi]\) // Simplify\)], "Input"], Cell[BoxData[ \(\[Pi]\ \@\(1 + H\^2\/R\^2\)\ Cos[\[Alpha]]\ \@\(\(H\^2\ R\^2\)\/\((H\ Cos[\[Alpha]] + R\ Sin[\[Alpha]])\)\^2\)\ \@\(\(R\^2\ \((H\ Cos[\[Alpha]] - R\ Sin[\[Alpha]]) \)\)\/\(H\ Cos[\[Alpha]] + R\ Sin[\[Alpha]]\)\)\)], "Output"] }, Open ]], Cell[TextData[{ "The formulas can be simplified considerably if we choose as the parameter \ not the angle ", Cell[BoxData[ \(TraditionalForm\`\[Alpha]\)]], " but the minimal height ", Cell[BoxData[ \(TraditionalForm\`h\)]], " of ", Cell[BoxData[ \(TraditionalForm\`F\)]], " (i.e. height of the full cone minus height of the highest point of ", Cell[BoxData[ \(TraditionalForm\`D\)]], "). We found above that the bottom point of ", Cell[BoxData[ \(TraditionalForm\`D\)]], " is ", Cell[BoxData[ \(TraditionalForm\`{R, 0, 0}\)]], " (that's how the coordinate system was chosen) and the top point has \ coordinates ", Cell[BoxData[ \(TraditionalForm\`{x\_top, 0, z\_top}\)]], ". Then ", Cell[BoxData[ \(TraditionalForm \`h = \(H - z\_top = H - \(2 R\ H\)\/\(R + H\ \(ctg(\[Alpha])\)\)\)\)]], " (see above)." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(Together//@ \((S /. \[Alpha] -> ArcCot[\(R \((H + h)\)\)\/\(H \((H - h)\)\)])\)\)], "Input"], Cell[BoxData[ \(\(\[Pi]\ \@\(\(h\ R\^2\)\/H\)\ \@\(\(H\^2 + R\^2\)\/R\^2\)\ \@\(\(h\^2\ H\^2 - 2\ h\ H\^3 + H\^4 + h\^2\ R\^2 + 2\ h\ H\ R\^2 + H\^2\ R\^2\)\/H\^2\)\)\/\(2\ \@\(\(h\^2\ H\^2 - 2\ h\ H\^3 + H\^4 + h\^2\ R\^2 + 2\ h\ H\ R\^2 + H\^2\ R\^2\)\/\(\((h + H)\)\^2\ R\^2\)\)\)\)], "Output"] }, Open ]], Cell[TextData[{ "The expressions ", Cell[BoxData[ \(TraditionalForm\`R, H, H + h\)]], " are non-negative and we can use ", Cell[BoxData[ \(TraditionalForm\`PowerExpand\)]] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(S = PowerExpand[%]\)], "Input"], Cell[BoxData[ \(\(\@h\ \((h + H)\)\ \[Pi]\ R\ \@\(H\^2 + R\^2\)\)\/\(2\ H\^\(3/2\)\)\)], "Output"] }, Open ]], Cell[TextData[{ "To find the volume, we cut ", Cell[BoxData[ \(TraditionalForm\`F\)]], " by planes parallel to ", Cell[BoxData[ \(TraditionalForm\`D\)]], ". We choose the parameter ", Cell[BoxData[ \(TraditionalForm\`\[Xi]\)]], " as the distance from ", Cell[BoxData[ \(TraditionalForm\`D\)]], " to the plane. ", Cell[BoxData[ \(TraditionalForm\`\[Xi]\)]], " changes from ", Cell[BoxData[ \(TraditionalForm\`0\)]], ", where the plane contains ", Cell[BoxData[ \(TraditionalForm\`D\)]], ", to ", Cell[BoxData[ \(TraditionalForm\`H\ \(cos(\[Alpha])\) - R\ \(sin(\[Alpha])\)\)]], ", where it contains the apex of the cone. The shape of each cut is an \ ellipse and again we need to find axes. One way to do it is to write equation \ for each plane (which will be ", Cell[BoxData[ \(TraditionalForm \`x + z\ \(ctg(\[Alpha])\) = R + \[Xi]\ \(csc(\[Alpha])\)\)]], ") in order to find the axes of ellipse for each ", Cell[BoxData[ \(TraditionalForm\`\[Xi]\)]], " in the same way as above. But it can be easily shown geometrically (from \ the similarity of triangles) that the lengths of the axes depend on ", Cell[BoxData[ \(TraditionalForm\`\[Xi]\)]], " linearly." }], "Text"], Cell[TextData[{ "Note that we just keep the same symbols ", Cell[BoxData[ \(TraditionalForm\`a\)]], ", ", Cell[BoxData[ \(TraditionalForm\`b\)]], " for axes but now they don't refer to ", Cell[BoxData[ \(TraditionalForm\`D'\)]], "." }], "Text"], Cell[BoxData[ \(\[Xi]0 = H\ Cos[\[Alpha]] - R\ Sin[\[Alpha]]; \n{a, b} = \(\(\[Xi]0 - \[Xi]\)\/\[Xi]0\) {a0, b0}; \)], "Input"], Cell[TextData[{ "Finally, the area of each ellipse is ", Cell[BoxData[ \(TraditionalForm\`S(\[Xi]) = \[Pi]\ \(a(\[Xi])\) \(b(\[Xi])\)\)]], ", an if we know the areas ", Cell[BoxData[ \(TraditionalForm\`S(\[Xi])\)]], " of cross-sections of a figure by planes normal to the axis ", Cell[BoxData[ \(TraditionalForm\`\[Xi]\)]], " we can find the volume of the figure as ", Cell[BoxData[ \(TraditionalForm \`V = \[Integral]\_\[Xi]\_1\%\[Xi]\_2\( S(\[Xi])\) \[DifferentialD]\[Xi]\)]], "." }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(V = \[Integral]\+0\%\[Xi]0 \[Pi]\ a\ b \[DifferentialD]\[Xi] // Simplify\)], "Input"], Cell[BoxData[ \(1\/3\ \[Pi]\ \((H\ Cos[\[Alpha]] - R\ Sin[\[Alpha]])\)\ \@\(\(H\^2\ R\^2\)\/\((H\ Cos[\[Alpha]] + R\ Sin[\[Alpha]])\)\^2\)\ \@\(\(R\^2\ \((H\ Cos[\[Alpha]] - R\ Sin[\[Alpha]]) \)\)\/\(H\ Cos[\[Alpha]] + R\ Sin[\[Alpha]]\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(Together//@ \((V /. \[Alpha] -> ArcCot[\(R \((H + h)\)\)\/\(H \((H - h)\)\)])\)\)], "Input"], Cell[BoxData[ \(\(h\ H\ \[Pi]\ \@\(\(h\ R\^2\)\/H\)\ \@\(\(h\^2\ H\^2 - 2\ h\ H\^3 + H\^4 + h\^2\ R\^2 + 2\ h\ H\ R\^2 + H\^2\ R\^2\)\/H\^2\)\)\/\(3\ \((h + H)\)\ \@\(\(h\^2\ H\^2 - 2\ h\ H\^3 + H\^4 + h\^2\ R\^2 + 2\ h\ H\ R\^2 + H\^2\ R\^2\)\/\(\((h + H)\)\^2\ R\^2\)\)\)\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(V = PowerExpand[%]\)], "Input"], Cell[BoxData[ \(\(h\^\(3/2\)\ \[Pi]\ R\^2\)\/\(3\ \@H\)\)], "Output"] }, Open ]], Cell[TextData[{ "And now we have the volume of the truncated cone too. We can easily check \ that the results are correct for boundary values of ", Cell[BoxData[ \(TraditionalForm\`h\)]] }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({S, V} /. {{h -> 0}, {h -> H}}\)], "Input"], Cell[BoxData[ \({{0, 0}, {\[Pi]\ R\ \@\(H\^2 + R\^2\), 1\/3\ H\ \[Pi]\ R\^2}}\)], "Output"] }, Open ]], Cell[TextData[{ "Alternative ways to calculate the volume would be to take sections by \ horizontal planes and calculate the areas of the resulting circular segments, \ or to use the formula ", Cell[BoxData[{ \(TraditionalForm \`V = \[Integral]\(\[Integral]\((\(z\_1\)(x, y) - \(z\_2\)(x, y))\) \[DifferentialD]x \[DifferentialD]y\)\), \(TraditionalForm\`\ \ \ \ \ \ \ \ D'\)}]], ", where ", Cell[BoxData[ \(TraditionalForm\`z\_1\)]], " corresponds to the cone and ", Cell[BoxData[ \(TraditionalForm\`z\_2\)]], " to the section plane. But in those cases the expressions to integrate \ would be more complicated." }], "Text"], Cell[TextData[{ "Our formulas can be rewritten like this\n \ ", Cell[BoxData[ FormBox[ StyleBox[ \(S = \(S\_0\) \(1\/2\) \(\((h\/H)\)\^\(1/2\)\) \((1 + h\/H)\)\), FontWeight->"Bold"], TraditionalForm]]], "\n \ \n \ ", StyleBox[" ", FontWeight->"Bold"], Cell[BoxData[ \(TraditionalForm\`V = \(\(V\_0\)(h\/H)\)\^\(3/2\)\)], FontWeight->"Bold"], "\nwhere ", Cell[BoxData[ \(TraditionalForm\`S\_0, V\_0\)]], " correspond to the full cone." }], "Text", CellFrame->True], Cell["\<\ Now we want to check our results numerically. We'll need program for creating \ the sections (the module is in the development stage right now). \ \>", "Text"], Cell[TextData[{ "Type the correct path to ", Cell[BoxData[ FormBox[ RowBox[{"section", ".", StyleBox["m", FontSlant->"Plain"]}], TraditionalForm]]], " here" }], "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(<< \\math\\section.m\)], "Input"], Cell[BoxData[ \({feq, fsign, inter, cut}\)], "Output"] }, Open ]], Cell[TextData[{ "Let's create a cone with base radius ", Cell[BoxData[ \(TraditionalForm\`3\)]], " and height ", Cell[BoxData[ \(TraditionalForm\`4\)]] }], "Text"], Cell[BoxData[ \(<< graphics`shapes`\)], "Input"], Cell[BoxData[ \(\(gr = Level[Cone[3, 2, 200], {2}]; \)\)], "Input"], Cell["Add the base polygon", "Text"], Cell[BoxData[ \(\(base = Union[Cases[gr, {_, _, \(-2.\)}, {2}]\ ] // \n\t\t Sort[#, ArcTan\ @@\ Take[#1, 2] < ArcTan\ @@\ Take[#2, 2]&]&; \)\)], "Input"], Cell[BoxData[ \(\(AppendTo[gr, base]; \)\)], "Input"], Cell[TextData[{ "And cut it by the plane ", Cell[BoxData[ \(TraditionalForm\`4 x + 5 z - 2 = 0\)]], ". We get ", Cell[BoxData[ \(TraditionalForm \`h = \(H - \(2 R\ H\)\/\(R + H\ \(ctg(\[Alpha])\)\) = 1\)\)]] }], "Text"], Cell[BoxData[ \(\(gr2 = cut[gr, \(-4\) #1 - 5 #3 + 2&]; \)\)], "Input"], Cell["This is what the figure looks like", "Text"], Cell[BoxData[ \(Show[Graphics3D[Polygon\ /@\ gr2], \n\t ViewPoint -> {\(-2.4\), \(-2.4\), 1.0}]\)], "Input"], Cell[TextData[{ "Now we define the function for calculating surface area and volume of \ closed convex polyhedral bodies. The main idea is to take a point inside the \ body as a center and then break the body into pyramids with this point as the \ apex and each face of the figure as base. Next, each pyramid is rotated so \ that its base becomes oriented horizontally. Then we use the formula for the \ (oriented) area of a polygon on a plane\n \ ", Cell[BoxData[ \(TraditionalForm \`S = \(1\/2\) \(\[Sum]\+\(k = 1\)\%n\(( \(x\_k\) y\_\(k + 1\) - \(x\_\(K + 1\)\) y\_k)\)\)\)]], ",\n where ", Cell[BoxData[ \(TraditionalForm\`\((\(x\_\(i, \)\) y\_i)\)\)]], ", ", Cell[BoxData[ \(TraditionalForm\`i = \(1, n\)\&_\)]], " are polygon's vertices and ", Cell[BoxData[ \(TraditionalForm \`\((x\_\(n + 1\), y\_\(n + 1\))\) = \((x\_1, y\_1)\)\)]], "." }], "Text"], Cell[BoxData[ \(area[poly_] := \n\t Abs[Plus\ @@\n\t\t\t MapThread[Dot, \n \t\t\t\t{poly, \n\t\t\t\t\t \({#[\([2]\)], \(-#[\([1]\)]\)}&\)\ /@\n\t\t\t\t\t\t RotateLeft[poly]}\ ]\ ]/2\)], "Input"], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`\(rotm[{x, y, z}\)\)]], " gives matrix ", Cell[BoxData[ \(TraditionalForm\`A\)]], " such that ", Cell[BoxData[ \(TraditionalForm\`det(A) = 1\)]], " and ", Cell[BoxData[ FormBox[ RowBox[{ RowBox[{"A", " ", RowBox[{"(", GridBox[{ {"x"}, {"y"}, {"z"} }], ")"}]}], "=", RowBox[{"(", GridBox[{ {"0"}, {"0"}, {\(z'\)} }], ")"}]}], TraditionalForm]]] }], "Text"], Cell[BoxData[ RowBox[{\(rotm[{x_, y_, z_}]\), ":=", RowBox[{"Module", "[", "\n", "\t\t", RowBox[{\({\[Alpha], \[Beta]}\), ",", "\n", "\t\t", RowBox[{ \({\[Alpha], \[Beta]} = If[y === z === 0, \n\t\t\t\t{0, ArcTan[0, x]}, \n \t\t\t\t{ArcTan[z, y], ArcTan[\@\(y\^2 + z\^2\), x]}\ ]\), ";", "\n", "\t\t", RowBox[{ RowBox[{"(", GridBox[{ {\(Cos[\[Beta]]\), "0", \(-Sin[\[Beta]]\)}, {"0", "1", "0"}, {\(Sin[\[Beta]]\), "0", \(Cos[\[Beta]]\)} }], ")"}], ".", RowBox[{"(", GridBox[{ {"1", "0", "0"}, {"0", \(Cos[\[Alpha]]\), \(-Sin[\[Alpha]]\)}, {"0", \(Sin[\[Alpha]]\), \(Cos[\[Alpha]]\)} }], ")"}]}]}]}], "]"}]}]], "Input"], Cell[TextData[{ Cell[BoxData[ \(TraditionalForm\`sqvol\)]], " returns surface area and volume" }], "Text"], Cell[BoxData[ \(sqvol[polys_] := Module[\n\t\t{pyrsv, cent}, \n\t\t\n\t\t pyrsv[poly_, pt_] := Module[\n\t\t\t\t{base, apex, norm, matr, sq, ht}, \n \t\t\t\t{base, apex} = {poly, pt}; \n\t\t\t\t norm = Cross[base[\([3]\)] - base[\([1]\)], \n\t\t\t\t\t\t base[\([2]\)] - base[\([1]\)]\ ]; \n\t\t\t\t matr = rotm[norm]; \n\t\t\t\tbase = \(matr.#&\)\ /@\ base; \n \t\t\t\tapex = matr.apex; \n\t\t\t\t ht = Abs[base[\([1, 3]\)] - apex[\([3]\)]\ ]; \n\t\t\t\t base = \(Take[#, 2]&\)\ /@\ base; \n\t\t\t\tsq = area[base]; \n \t\t\t\t{sq, sq*ht/3}\ ]; \n\t\t\n\t\t cent = \(\((Plus\ @@\ #)\)/Length[#]&\)[\n\t\t\t\tUnion\ @@\ polys]; \n\t\tPlus\ @@\ \((\(pyrsv[#, cent]&\)\ /@\ polys)\)\ ]\)], "Input"], Cell[CellGroupData[{ Cell[BoxData[ \(sqvol[gr2]\)], "Input"], Cell[BoxData[ \({26.0347362526014958`, 4.71096007516441783`}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(Vappr = %[\([2]\)]; \)\)], "Input"], Cell["\<\ To get the area of the lateral surface, we drop the base polygon (the volume \ value will be wrong) \ \>", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \(sqvol[Drop[gr2, \(-1\)]]\)], "Input"], Cell[BoxData[ \({14.7229127630271738`, 4.68752246285034335`}\)], "Output"] }, Open ]], Cell[BoxData[ \(\(Sappr = %[\([1]\)]; \)\)], "Input"], Cell["And now we can do a check", "Text"], Cell[CellGroupData[{ Cell[BoxData[ \({S, V} /. {R -> 3, H -> 4, h -> 1}\)], "Input"], Cell[BoxData[ \({\(75\ \[Pi]\)\/16, \(3\ \[Pi]\)\/2}\)], "Output"] }, Open ]], Cell[CellGroupData[{ Cell[BoxData[ \(% - {Sappr, Vappr}\)], "Input"], Cell[BoxData[ \({0.00330280067498200935`, 0.00142890522027183664`}\)], "Output"] }, Open ]], Cell["Copyright \[Copyright] 1999, Maxim Rytin", "Text", CellFrame->True, TextAlignment->Center, TextJustification->0, FontWeight->"Bold"] }, FrontEndVersion->"Macintosh 3.0", ScreenRectangle->{{0, 800}, {0, 580}}, WindowToolbars->"EditBar", WindowSize->{732, 553}, WindowMargins->{{4, Automatic}, {Automatic, 1}}, MacintoshSystemPageSetup->"\<\ 00<0001804P000000]P2:?oQon82n@960dL5:0?l0080001804P000000]P2:001 0000I00000400`<300000BL?00400@0000000000000006P801T1T00000000000 00000000000000000000000000000000\>" ] (*********************************************************************** Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. ***********************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[1709, 49, 324, 6, 78, "Text"], Cell[2036, 57, 748, 13, 126, "Text"], Cell[2787, 72, 1459, 43, 103, "Text"], Cell[4249, 117, 1268, 41, 78, "Text"], Cell[5520, 160, 401, 13, 46, "Text"], Cell[CellGroupData[{ Cell[5946, 177, 177, 3, 105, "Input"], Cell[6126, 182, 324, 7, 45, "Output"] }, Open ]], Cell[6465, 192, 66, 1, 27, "Input"], Cell[6534, 195, 38, 0, 30, "Text"], Cell[6575, 197, 78, 1, 43, "Input"], Cell[6656, 200, 98, 4, 30, "Text"], Cell[6757, 206, 62, 1, 43, "Input"], Cell[6822, 209, 223, 5, 30, "Text"], Cell[7048, 216, 200, 4, 105, "Input"], Cell[7251, 222, 66, 1, 27, "Input"], Cell[7320, 225, 78, 1, 43, "Input"], Cell[7401, 228, 116, 4, 30, "Text"], Cell[7520, 234, 66, 1, 43, "Input"], Cell[7589, 237, 1765, 43, 244, "Text"], Cell[CellGroupData[{ Cell[9379, 284, 175, 3, 92, "Input"], Cell[9557, 289, 54, 1, 50, "Output"] }, Open ]], Cell[9626, 293, 515, 21, 46, "Text"], Cell[CellGroupData[{ Cell[10166, 318, 198, 5, 75, "Input"], Cell[10367, 325, 273, 4, 62, "Output"] }, Open ]], Cell[10655, 332, 916, 30, 69, "Text"], Cell[CellGroupData[{ Cell[11596, 366, 121, 3, 45, "Input"], Cell[11720, 371, 353, 5, 93, "Output"] }, Open ]], Cell[12088, 379, 203, 7, 30, "Text"], Cell[CellGroupData[{ Cell[12316, 390, 51, 1, 27, "Input"], Cell[12370, 393, 105, 2, 52, "Output"] }, Open ]], Cell[12490, 398, 1288, 39, 94, "Text"], Cell[13781, 439, 276, 11, 30, "Text"], Cell[14060, 452, 136, 2, 63, "Input"], Cell[14199, 456, 555, 16, 50, "Text"], Cell[CellGroupData[{ Cell[14779, 476, 115, 3, 62, "Input"], Cell[14897, 481, 285, 4, 62, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15219, 490, 121, 3, 45, "Input"], Cell[15343, 495, 343, 5, 93, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[15723, 505, 51, 1, 27, "Input"], Cell[15777, 508, 73, 1, 50, "Output"] }, Open ]], Cell[15865, 512, 208, 5, 30, "Text"], Cell[CellGroupData[{ Cell[16098, 521, 63, 1, 27, "Input"], Cell[16164, 524, 98, 2, 43, "Output"] }, Open ]], Cell[16277, 529, 684, 17, 76, "Text"], Cell[16964, 548, 814, 21, 122, "Text"], Cell[17781, 571, 170, 5, 62, "Text"], Cell[17954, 578, 212, 8, 30, "Text"], Cell[CellGroupData[{ Cell[18191, 590, 53, 1, 27, "Input"], Cell[18247, 593, 58, 1, 26, "Output"] }, Open ]], Cell[18320, 597, 183, 7, 30, "Text"], Cell[18506, 606, 52, 1, 27, "Input"], Cell[18561, 609, 71, 1, 27, "Input"], Cell[18635, 612, 36, 0, 30, "Text"], Cell[18674, 614, 175, 4, 43, "Input"], Cell[18852, 620, 57, 1, 27, "Input"], Cell[18912, 623, 248, 8, 37, "Text"], Cell[19163, 633, 76, 1, 27, "Input"], Cell[19242, 636, 50, 0, 30, "Text"], Cell[19295, 638, 118, 2, 43, "Input"], Cell[19416, 642, 1010, 24, 101, "Text"], Cell[20429, 668, 264, 6, 107, "Input"], Cell[20696, 676, 620, 24, 64, "Text"], Cell[21319, 702, 905, 19, 160, "Input"], Cell[22227, 723, 116, 4, 30, "Text"], Cell[22346, 729, 842, 14, 315, "Input"], Cell[CellGroupData[{ Cell[23213, 747, 43, 1, 27, "Input"], Cell[23259, 750, 78, 1, 26, "Output"] }, Open ]], Cell[23352, 754, 57, 1, 27, "Input"], Cell[23412, 757, 125, 5, 62, "Text"], Cell[CellGroupData[{ Cell[23562, 766, 57, 1, 27, "Input"], Cell[23622, 769, 78, 1, 26, "Output"] }, Open ]], Cell[23715, 773, 57, 1, 27, "Input"], Cell[23775, 776, 41, 0, 30, "Text"], Cell[CellGroupData[{ Cell[23841, 780, 67, 1, 27, "Input"], Cell[23911, 783, 70, 1, 43, "Output"] }, Open ]], Cell[CellGroupData[{ Cell[24018, 789, 51, 1, 27, "Input"], Cell[24072, 792, 84, 1, 26, "Output"] }, Open ]], Cell[24171, 796, 146, 4, 48, "Text"] } ] *) (*********************************************************************** End of Mathematica Notebook file. ***********************************************************************)