Integrating a discrete 3D surface, in spherical coordinates I have an matrix which contains height information for a sheet suspended in air. Like a checkerboard, each value in the matrix represents a sampled height. Here's the hard parts: the data in the matrix is recorded in spherical coordinates (azimuth and elevation) at a distance R.
Here is an example of a simple matrix:

Two questions:


*

*How can I compute the volume under this 3D surface? 

*How can I compute the surface area? 

 A: Let $\theta$ be the azimuth and $\psi$ the elevation.
If we were to integrate using a complete function between azimuthal angles $a,b$ and elevations $c,d$ (in radians), the formula would be
$$
V = \int_c^d \int_a^b \int_0^{r(\theta,\psi)} r^2 \cos \psi\,dr\,d\theta\,d\psi
= \frac 13 \int_c^d \int_a^b [r(\theta,\psi)]^3\cos \psi \,d\theta\,d\psi
$$
We can approximate this integral by
$$
V \approx \frac 13 \sum_{i=1}^m \sum_{j=1}^n [r(\theta_i,\psi_j)]^3\cos \psi_j \Delta\theta_i\,\Delta \psi_j
$$
For your graph, we can set
$\theta_i = (i-1)^\circ = \frac{\pi}{180}(i-1)$ for $i$ from $1$ to $9$ and
$\psi_j = (j-1)^\circ = \frac{\pi}{180}(j-1)$ for $j$ from $1$ to $9$.
We would have $\Delta \theta_i = \Delta \psi_j = 1^\circ = \frac{\pi}{180}$ for each $i,j$.
So, our approximation for the integral would be
$$
V \approx \frac 13 \sum_{i=1}^9 \sum_{j=1}^9 [r((i-1)^\circ,(j-1)^\circ)]^3
\cos (j-1)^\circ \left(\frac{\pi}{180}\right)\left(\frac{\pi}{180}\right)\\
= \left(\frac{\pi^2}{3\cdot 180^2}\right) \sum_{i=1}^9 \sum_{j=1}^9 [r((i-1)^\circ,(j-1)^\circ)]^3
\cos (j-1)^\circ
$$
