Prev: Storing the symbolic result of a calculation as a line of code..?
Next: Selecting a background frame for a moving object differentiation
From: john on 23 Jan 2010 17:51 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
From: John D'Errico on 23 Jan 2010 18:43 "john " <jpb_NOTTHISPART_singh(a)yahoo.com> wrote in message <hjfugm$b1v$1(a)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
From: John D'Errico on 23 Jan 2010 18:47 "John D'Errico" <woodchips(a)rochester.rr.com> wrote in message <hjg1i7$mn5$1(a)fred.mathworks.com>... > "john " <jpb_NOTTHISPART_singh(a)yahoo.com> wrote in message <hjfugm$b1v$1(a)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
From: john on 23 Jan 2010 19:16 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
From: John D'Errico on 23 Jan 2010 19:42
"john " <jpb_NOTTHISPART_singh(a)yahoo.com> wrote in message <hjg3g3$onb$1(a)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 |