Buffon's Needle. Probability to intersect the line. 
Problem: A table is ruled by equidistant parallel lines, 1 inch apart. A needle
  of length 1 inch is tossed at random on the table. What is the
  probability that it intersects a line?

Let's describe the distance from the needle-center to the nearest line by $D$ and the smallest angle between the needle and and that line by $A$ Drawing a figure leads to the conclusion that the needle intersects a line iff $D/\sin{A}\le 1/2.$
The "at random part" is a hint that the random variables $D\sim\text{unif}[0,1/2]$ and $A\sim\text{unif}[0,\pi/2]$ are independent.
Now my book states a corollary:

$$P((X,Y)\in B)=\int_{-\infty}^{\infty}P((x,Y)\in B)f_X(x) \ \text{d}x. \tag{1}$$

I wan't to compute $P\left(D/\sin{A}\le 1/2\right)$ using (1). But the problem is that I don't understand the corollary. What is $B$ in my case? And what is $P((x,Y)\in B)$?
I do understand that they fix $X=x$, and I can do the same by $A=a$ and write the following
$$P\left(\frac{D}{\sin{A}}\le \frac{1}{2}\right)=\int_{-\infty}^\infty P\left(\frac{D}{\sin{a}}\le \frac{1}{2}\right)f_A(a)\ \text{d}a.$$
With the knowledge that $f_A(a)=1/(\pi/2)=2/\pi$, $f_D(d)=2$ and
$$P\left(\frac{D}{\sin{a}}\le \frac{1}{2}\right)=P\left(D\le\frac{\sin{a}}{2}\right)=\int_0^{\sin{a}/2}2\ \text{d}d=\sin{a},$$
I finally obtain
$$P\left(\frac{D}{\sin{A}}\le \frac{1}{2}\right)=\frac{2}{\pi}\int_{0}^{\pi/2}\sin{a}\ \text{d}a=\frac{2}{\pi.}$$
Correct answer but I still don't really know what I'm doing here with the corrollary. My questions are in bold above.

The fun part of this is apparently that there are different interpretations which can be put on "random" although the one suggested seems reasonable to me.  Needless to say, these give different answers.
