Geometry of point blocked by a sphere Suppose there is a point located at $O = (0, 0, 0)$, and a sphere of radius $r$ at a distance $R$ from the point $O$. The sphere is located in the $x-y$ plane and orbits in $x-y$ plane in a circular radius $R$ about the point $O$. For an observer located at $(D, 0, 0)$, where $D\gg R, r$, I am interested in what fraction of the orbit is the point $O$ blocked by the sphere. In this case, it would just be $r/(2R)$.
Now, suppose the radius of sphere is not a constant, but changes over the orbit, such that $r = r(\phi)$, a function of phase $\phi$. Here, $\phi=0$ when the sphere is at position $(R, 0, 0)$ and $\phi =\pi$ when it is at the position $(-R, 0, 0)$, and $\phi\in [0, 2\pi)$. As an example, suppose $r= r_0(1+\cos(\phi))$. In this case, what would be the fraction of orbit that the point $O$ would be blocked by the  sphere to the observer?
 A: This is in fact a 2D issue that can be followed on the following figure:

The ordinate of the center of the sphere is $R \sin(\varphi)$.
The ordinates of the projections of the endpoints of diameter of the sphere onto the $y$ axis are :
$$R \sin(\varphi)+r(\varphi) \ \ \ \text{and} \ \ \ R \sin(\varphi)-r(\varphi)$$
Occultation of the origin will take place iff these ordinates have opposite signs ; said otherwise, iff their product is negative.
Therefore, the fractional time of occultation is the integral of characteristic function (with value $1$ when true, $0$ otherwise) of :
$$R^2 \sin(\varphi)^2-r(\varphi)^2$$
divided by the total length $2 \pi R$, which can be given the following closed form:
$$\dfrac{1}{2 \pi R}\int_{-\pi/2}^{\pi/2} H(r(\varphi)^2-R^2 \sin(\varphi)^2)d \varphi$$
where $H$ is Heaviside function.
Remark: in the case where $r(\varphi)=r$ (a constant), one has the limit case
$$\sin(\varphi)=\tfrac{r}{R} \ \ \iff \ \  \varphi=\operatorname{asin}(\tfrac{r}{R})$$ giving the following formula for the fractional time of occupation :
$$\dfrac{1}{2\pi}2\operatorname{asin}(\tfrac{r}{R})=\dfrac{1}{\pi}\operatorname{asin}(\tfrac{r}{R})$$
