Volume of intersection of two partial spheres in spherical coordinates

38 Views Asked by At

Assume I have one partial sphere $s_1$ defined by center $c_1: (x_1, y_1, z_1)$, radius: $\rho_1$, polar angle: $\phi_{1, min} \leq \phi_1 \leq \phi_{1, max}$, and azimuthal angle: $\theta_{1, min} \leq \theta_1 \leq \theta_{1, max}$. I have another partial sphere $s_2$ defined by center $c_2: (x_2, y_2, z_2)$, radius: $\rho_2$, $\phi_{2, min} \leq \phi_2 \leq \phi_{2, max}$, $\theta_{2, min} \leq \rho_2 \leq \theta_{2, max}$.

Assume I also know the $4 \times 4$ transformation matrix $T$ that maps any point in the coordinate frame of $s_1$ to the coordinate frame of $s_2$.

I would like to find the volume of intersection of these two spheres. Using this answer and this answer and this answer, I'm confused as to whether to convert to cylindrical coordinates and then try to integrate over $z$, $r$, and $\theta$ or go to cartesian coordinates and try to integrate over $x$, $y$ and $z$, or just stick to spherical coordinates and integrate over $\rho, \theta, \phi$.

Additionally, to clarify per the comments, in order to set the bounds of the integration correctly, I think I need to use $T$ as applied to the min/max azimuthal and polar angles? The angles are measured with respect to the z-axis of each sphere's respective coordinate frame as in this picture from the wikipedia entry on spherical coordinate conventions.

Thanks!