3. The typhoon center moves northeast at a speed of 20 kilometers per hour, and the area within 30 kilometers of the typhoon center is the danger zone. City $B$ is 40 kilometers due east of city $A$. The time that city $B$ is in the danger zone is ( ).
(A) 0.5 hours
(B) 1 hour
(C) 1.5 hours
(D) 2 hours
3. (A).

As shown in the figure, let the line through which the center of the typhoon passes intersect the circle with center $B$ and radius 30 kilometers at points $C$ and $D$. Clearly, finding the length of $C D$ will allow us to calculate the required time.
Draw $B E \perp C D$ at $E$, then $B E=A B \sin 45^{\circ}=20 \sqrt{2}$.
Therefore, $C D=2 D E=\sqrt{30^{2}-(20 \sqrt{2})^{2}}=10$ kilometers. Thus, the time during which city $B$ is in the danger zone is 0.5 hours.