1
$\begingroup$

The Mathematica documentation Integrate over Regions gives an example of how to simply integrate over a sphere (surface):

Integrate[1, {x, y, z} ∈ Sphere[]]

Although it seems there is an Hemisphere object in Mathematica, it does not seem possible to easily integrate over all the directions that it includes.

Is there an elegant way to similarly compute the integral of a function over all the directions in an hemisphere?

An example of an application of this would be solving rendering equations

$\endgroup$
  • 4
    $\begingroup$ Hemisphere objects in Mathematica are geographical, not geometric region objects. Nonetheless, you can construct more complex regions and use them on Integrate, for instance: Integrate[1, {x, y, z} ∈ RegionIntersection[Sphere[], ImplicitRegion[x > 0, {x, y, z}]]], which takes the parts of the sphere surface where x > 0. $\endgroup$ – kirma Sep 25 '15 at 4:00
  • 4
    $\begingroup$ ... and in v10.2, you can also use HalfSpace. $\endgroup$ – kirma Sep 25 '15 at 4:12
  • 2
    $\begingroup$ You referenced an article about hemispheres in MathWorld. Although MathWorld is a Wolfram site, it discussed mathematics, not Mathematica. In particular, the hemisphere it discusses is not a built-in Mathematica object. $\endgroup$ – m_goldberg Sep 25 '15 at 4:23
  • $\begingroup$ @m_goldberg Thank you, I updated the question. $\endgroup$ – wip Sep 25 '15 at 6:27
  • 2
    $\begingroup$ @wil My implied intent was that you can use HalfSpace instead of explicitly written ImplicitRegion to specify which hemisphere of Sphere to use. Maybe it even gets treated more efficiently as an abstraction on some future version of Mma! $\endgroup$ – kirma Sep 25 '15 at 11:13
1
$\begingroup$

These drawing and formula can be found in the Global Illumination Compendium (P.15):

Hemisphere parametrization

The integral can therefore be computed as:

Integrate[f[φ, θ] Sin[θ], {φ,0,2π}, {θ, 0, π/2}]
$\endgroup$
0
$\begingroup$

One can do it changing the integrand:

Integrate[1 Boole[x > 0], {x, y, z} ∈ Sphere[]]
$\endgroup$
  • $\begingroup$ Or one can specify the domain completely as a region, just as kirma indicates in the comments to the question. $\endgroup$ – Michael E2 Aug 5 '17 at 19:34

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.