COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Integration on volume of intersection between two spheres

• Follow

```Hi,

I need to integrate a function over the volume obtained after the intersection of two spheres in three dimensions.
I can try to divide the volume into tetrahedrons but that is cumbersome.

Will appreciate if anyone can point to some general quadrature rules on spherical caps (is that the right word?).

-John
```
 0

```"john " <jpb_NOTTHISPART_singh@yahoo.com> wrote in message <hjfugm\$b1v\$1@fred.mathworks.com>...
> Hi,
>
> I need to integrate a function over the volume obtained after the intersection of two spheres in three dimensions.
> I can try to divide the volume into tetrahedrons but that is cumbersome.
>
> Will appreciate if anyone can point to some general quadrature rules on spherical caps (is that the right word?).
>
> -John

I would break the domain into two pieces.

The intersection of two spheres will be one of
several possibilities.

1. If the center of one sphere lies inside the other.

2. No intersection at all.

3. The two spheres intersect, but the centers are
far enough apart that the intersection can be defined
as a pair of spherical caps, that share a planar face.
The plane must be perpendicular to the line segment
between the two centers.

In case 3, you need to be able to integrate the
function over a pair of spherical caps, and sum.

In case 1, you need to integrate the function over
a single spherical cap, again a cap with a planar
face that cuts through the spheres.

An integration over a spherical cap seems best done
by a transformation to spherical coordinates.

John
```
 0

```"John D'Errico" <woodchips@rochester.rr.com> wrote in message <hjg1i7\$mn5\$1@fred.mathworks.com>...
> "john " <jpb_NOTTHISPART_singh@yahoo.com> wrote in message <hjfugm\$b1v\$1@fred.mathworks.com>...
> > Hi,
> >
> > I need to integrate a function over the volume obtained after the intersection of two spheres in three dimensions.
> > I can try to divide the volume into tetrahedrons but that is cumbersome.
> >
> > Will appreciate if anyone can point to some general quadrature rules on spherical caps (is that the right word?).
> >
> > -John
>
> I would break the domain into two pieces.
>
> The intersection of two spheres will be one of
> several possibilities.
>
> 1. If the center of one sphere lies inside the other.
>
> 2. No intersection at all.
>
> 3. The two spheres intersect, but the centers are
> far enough apart that the intersection can be defined
> as a pair of spherical caps, that share a planar face.
> The plane must be perpendicular to the line segment
> between the two centers.
>
> In case 3, you need to be able to integrate the
> function over a pair of spherical caps, and sum.
>
> In case 1, you need to integrate the function over
> a single spherical cap, again a cap with a planar
> face that cuts through the spheres.
>
> An integration over a spherical cap seems best done
> by a transformation to spherical coordinates.
>
> John

Sorry, I missed a piece. The first case is also a sum of
two integrals, both over spherical caps.

Regardless, this is basic calc. Don't forget to use the
proper differential term for spherical coordinates.

John
```
 0

```
Thanks so much for the quick response.
In my case I have all the above three cases. I am not sure about how to go about handling the integration on spherical caps. Can you please elaborate on these basic calculations. Sorry to be a bother...

-John
```
 0

```"john " <jpb_NOTTHISPART_singh@yahoo.com> wrote in message <hjg3g3\$onb\$1@fred.mathworks.com>...
>
>
> Thanks so much for the quick response.
> In my case I have all the above three cases. I am not sure about how to go about handling the integration on spherical caps. Can you please elaborate on these basic calculations. Sorry to be a bother...
>
> -John

I can only suggest the careful reading of a
reference like this:

http://en.wikipedia.org/wiki/Multiple_integral

The volume differential element in spherical
coordinates is

r^2 dr dphi dtheta.

The first trick/task is to determine the plane of
intersection of the spherical surfaces. Here are
the equations of the two planes.

(x - x1)^2 + (y - y1)^2 + (z - z1)^2= r1^2
(x - x2)^2 + (y - y2)^2 + (z - z2)^2= r2^2

Expand, and subtract. Note that the quadratic
unknowns disappear. It gives you the equation
of a plane, if there is a non-null intersection.

Once you have that plane, then rotate/transform
the problem to a simple, standard form. Integrate
over two spherical caps, and sum.

John
```
 0

```Thanks again for your link. I am already aware of how to do multiple integrals.

I am looking for an efficient quadrature rules for spherical caps. I am aware of quad rules over tetrahedral, cube, sphere, etc. I was wondering if there are some standard techniques for spherical caps too.
On searching for published papers on google scholar I get links to papers which are too mathematical for me to interpret.

Any pointers on that will be really helpful- or I would welcome any other suggestions which will give me some elegant solution to the problem. Thanks.
```
 0

```I see this is an older post, but I found this for an arbitray dimension
http://en.wikipedia.org/wiki/Spherical_cap

Which gives teh answer in terms of a hypergeoemtric ffunction, whihc I was suprised was not included in matlab.   I am sure some one has written it though given its importance in mathematics.
```
 0

```On 10-08-31 03:05 PM, Joel wrote:
> I see this is an older post, but I found this for an arbitray dimension
> http://en.wikipedia.org/wiki/Spherical_cap
>
> Which gives teh answer in terms of a hypergeoemtric ffunction, whihc I
> was suprised was not included in matlab. I am sure some one has written
> it though given its importance in mathematics.

The hypergeometric function is part of the symbolic toolkit.

I do not know of any particular reason why a hypergeometric function with
numeric-only arguments could not be implemented for Matlab, but considering
the infinite summation of pochhammer functions that underlie the
hypergeometric function definition, I'm not sure if the generalized numeric
result could be fast. Some things are done more easily symbolically.
```
 0

```maybe montecarlo integration would suit your need? It is not fast but easy to do. You may need to multiply the integrand by an on/off function with the value 1 if you are inside the intersection or 0 if you are outside.

Sébastien

"john " <jpb_NOTTHISPART_singh@yahoo.com> wrote in message <hjfugm\$b1v\$1@fred.mathworks.com>...
> Hi,
>
> I need to integrate a function over the volume obtained after the intersection of two spheres in three dimensions.
> I can try to divide the volume into tetrahedrons but that is cumbersome.
>
> Will appreciate if anyone can point to some general quadrature rules on spherical caps (is that the right word?).
>
> -John
```
 0

8 Replies
899 Views

Similiar Articles:

7/22/2012 10:35:30 PM