2
$\begingroup$

How can I make Mathematica calculate a volume given a set of inequalities over three dimensional space?

I know how to plot the 3D region of the volume that I need to calculate, like this:

RegionPlot3D[
  x^2 + y^2 + z^2 <= 1 && y >= Abs[x]/Sqrt[3] && y <= 1/2, 
  {x, -1, 1}, {y, -1, 1}, {z, -1, 1}]

It yields as output the figure:

Output 1

But how can I calculate its volume? Do I have to set up an integral? Is that the only way?

$\endgroup$

1 Answer 1

6
$\begingroup$

This can be done in one line of that Mathematica code

 Volume[ImplicitRegion[x^2 + y^2 + z^2 <= 1&&y>= RealAbs[x]/Sqrt[3] && y<= 1/2, {x, y, z}]]

$\frac{17 \pi }{72}$

$\endgroup$
3
  • $\begingroup$ Love it. There is no reference of it in the documentation of Volume[] though. Thanks a lot. $\endgroup$
    – zurg
    Commented Feb 22, 2021 at 17:14
  • 1
    $\begingroup$ @zurg: See that reference for Volume in 3D. $\endgroup$
    – user64494
    Commented Feb 22, 2021 at 17:22
  • 1
    $\begingroup$ BTW, In arbitrary dimension, you can use RegionMeasure to achieve the same end result $\endgroup$ Commented Feb 22, 2021 at 19:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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