How many satellites do we need The question is how many satellites do we need for the GPS to work, knowing that we need at least 4 satellites visible at any time, assuming uniformity and perfect line of sight.
Someone answered the question saying:
"Let $r$ be Earth's radius and R be the orbital radius of the satellites, the area of the orbital sphere visible at any place on Earth's surface is
$A=\int R^2 \sin\theta\,\mathrm d\theta\,\mathrm d\phi = -2\pi R^2\int_1^{r/R} \mathrm d\cos\theta = 2\pi R^2(1-r/R)$
The fraction of solid angle visible is
$x = 2\pi R^2(1-r/R)/(4\pi R^2) = (1-r/R)/2$
Substituting R=26,600 km and r=6,370 km (values from Wikipedia), we get x= 38.0%. With 24 satellites, we should be able to see about 9 of them most of the time."
Could someone explain how the first two lines work.
Thank you very much for your answers.
Cyril
 A: So there's two spheres sharing the same center. In a point of the Earth (the small sphere), the tangent plane cuts the big sphere. The first step is to compute the area of the part of the big sphere which is cut by the tangent plane.
In spherical coordinates, you need to integrate the infinitesimal surface on the big sphere delimited by the plane tangent to the small sphere. The infinitesimal surface is given by $dS=R^2\sin(\theta)d\theta d\phi$, as explained in the provided link and visible in this figure:
. 
There are 4 integration bounds; by spherical symmetry around $\phi$ (or the axis passing through the center of the Earth and you), you have to integrate $\phi$ between $-\pi$ and $\pi$. For $\theta$ it is a bit more tricky; if you draw a figure, you'll see that $\theta$ needs to vary from $\arccos(r/R)$ to $\pi/2$.
$$ S=\int_{-\pi}^\pi \int_{\arcsin(r/R)}^{\pi/2} R \sin(\theta)R\, d\theta\,d\phi = 2\pi R^2 \int_{\arcsin(r/R)}^{\pi/2}\sin(\theta)\, d\theta= 2\pi R^2\left[ \cos(\theta)\right]_{\arcsin(r/R)}^{\pi/2}.$$
But $\cos(\pi/2)=0$ and $\cos(\arcsin(x))=\sqrt{1-x^2}$ for $|x|<1$ and $|r/R|<1$
so in the end:
$$S=2\pi R^2 \sqrt{1-\frac{r^2}{R^2}}. $$
So this gives the area of the big sphere which is visible from the Earth.
Then, the number of visible satellites in the ratio between this area and the total area of the big sphere, i.e.:
$$  \dfrac{2\pi R^2 \sqrt{1-\frac{r^2}{R^2}}}{4\pi R^2}=\frac{1}{2}\sqrt{1-\frac{r^2}{R^2}}.$$
Note that the answer you provided is not exactly the same; mine yields 48% instead of 38%. Note that this assumes that a satellite locate at the horizon can be used, which is not the case in pratice.
