# Spheres

Similar to cylinders, a sphere is an extension of polar co-ordinates, except this time it is a polar extension as opposed to a cartesian extension. This means that spherical co-ordinates have another angle $\varphi$.

$s\left(r,\theta ,\varphi \right)$

The translation from spherical to cartesian co-ordinates is as follows:

$x=r\mathrm{cos}\left(\theta \right)\mathrm{sin}\left(\varphi \right)$

$y=r\mathrm{cos}\left(\theta \right)\mathrm{sin}\left(\varphi \right)$

$z=r\mathrm{cos}\left(\varphi \right)$

And from cartesian to cylindrical we have:

$r=\sqrt{{x}^{2}+{y}^{2}+{z}^{2}}$

$\theta ={\mathrm{tan}}^{-1}\left(\frac{y}{x}\right)$

$\varphi ={\mathrm{tan}}^{-1}\left(\frac{y}{z}\right)$

For instance, a sphere with radius 2 is defined as:

$s\left(r,\theta ,z\right)=\left(2,\theta ,1\right)$

If we want to find the volume of a sphere, we must again use a triple integral as the input space has three parameters.

${\int }_{0}^{\pi }{\int }_{0}^{2\pi }{\int }_{0}^{2}-r\mathrm{sin}\left(\varphi \right)\phantom{\rule{thinmathspace}{0ex}}dr\phantom{\rule{thinmathspace}{0ex}}d\theta \phantom{\rule{thinmathspace}{0ex}}d\varphi$

Note also that we need to apply a density correction which is the determinant of the Jacobian matrix for each component. In the case of a cylinder, that is $-r\mathrm{sin}\left(\theta \right)$.

Finding the surface area of a cylinder requires us to find a parameterization in terms of two parameters. Because this sphere has a constant radius, we can use a parameterization that keeps $r$ constant.

$s\left(u,v\right)=\left(2\mathrm{cos}\left(2\pi u\right)\mathrm{sin}\left(\pi \varphi \right),2\mathrm{sin}\left(2\pi u\right)\mathrm{sin}\left(\pi \varphi \right),2\mathrm{cos}\left(\varphi \right)\right)$

From there we can use the same approach to find the length of the normal vector at every point.

So from those points, we can find the surface area.