How is the formula for the volume of a body in $\mathbb{R}^n$ derived? Here is a formula for the volume of a general body in $\mathbb{R}^n$ I came across, that uses spherical polar coordinates. I'm not sure how it came about:

Here, $K$ is a body with $0$ in its interior, and for each direction $\theta \in S^{n-1}$, let $r(\theta)$ be the radius of $K$ in that direction.
$$ \text{vol}(K) = nv_n \int_{S^{n-1}} \int_{0}^{r(\theta)} s^{n-1}ds d\sigma = v_n \int_{S^{n-1}} r(\theta)^n d\sigma(\theta)$$
$S^{n-1}$ is the sphere of radius $1$ in $n-1$ dimensions, and $v_n$ is the volume of the Euclidean ball of radius $1$ in $n$-dimensions.

I understand how the first integral goes to the second, but how did this formula come about in the first place?
I'm trying to start off with the regular Cartesian integral for volume which looks like $$\int \int ... \int dx_1 dx_2...dx_n$$ but I'm not able to proceed from here.
It has been a long while since I posted this. Could someone please add a detailed explanation? It would be really helpful.
 A: It is known from the Real Variables theory, see e.g. Theorem 2.49 in Folland's Real Analysis, that there exists a unique Borel measure $d\sigma$ on the unit sphere $\mathbb S^{d-1}=\{x\in\mathbb{R}^d:|x|=1\}$ such that
\begin{align}\tag{1}\label{eq:1}
\int_{\mathbb{R}^d} g(x) \,dx = \int_0^\infty \int_{\mathbb S^{d-1}} g(ry) \, d\sigma(y) \,  r^{d-1} dr.
\end{align}
Then the volume of the convex body $K$ can be computed as follows:
\begin{align*}
vol(K)&=\int_{\mathbb{R}^d} \chi_K(x) \,dx = \int_0^\infty \int_{\mathbb S^{d-1}} \chi_K (ry) \, d\sigma(y) \,  r^{d-1} dr
\\
=&\int_{\mathbb S^{d-1}}\int_0^\infty \chi_K (ry)\,  r^{d-1} dr \, d\sigma(y).
\end{align*}
Note that for a fixed unit vector $y$ we have $\chi_K (ry)=1$ iff $r\le r(y)$. Therefore, we can further write
\begin{align*}
=&\int_{\mathbb S^{d-1}}\int_0^{r(y)}  r^{d-1} dr \, d\sigma(y)=\frac{1}{d}\int_{\mathbb S^{d-1}} r(y)^{d} \, d\sigma(y),
\end{align*}
which gives the desired formula, up to normalization (in the above computation $\sigma$ is such that $\sigma(\mathbb S^{d-1})=\frac{2\pi^{d/2}}{\Gamma(d/2)}$).
