Calculate Atmospheric Extinction Using Source Altitude Angle I am trying to code up the following article http://dl.acm.org/citation.cfm?id=2349512 (alternative free access version) to calculate the light reflected from the moon to a given point on earth at a given time. However I occasionally get a gross error when calculating the distance of the light path through the atmosphere (Figure 2. of the article.)



The approximation given is to take the inverse sine of right ascension in radians, however whenever RA approaches pi, the number blows out to 8e15. Can you suggest a better method?
You seem to be referring to the computation of $m$ in equation (15) for the extinction as the light from the source passes through the atmosphere. The author intends to say that $m\approx \frac{1}{\sin(\alpha_s)}$, where $\alpha_s$ is the altitude of the source (in radian), so restricted to the range $0$ to $ \pi/2$. (Note this is not the inverse of the sine function as the author says but the reciprocal of the sine function)  The altitude is the angle measured from the horizon to the source, which is $=\pi/2-\theta$ where $\theta$ is as in figure 2. Note this blows up when $\alpha_s=0$ ($\theta=\pi/2$) because in the simple approximation being used the path length through the atmosphere in infinite.

The approximation being used here is that of a flat Earth, and $m$ is the number of equivalent atmosphere heights that the light path travellels through