Are the sun rays incident on earth's surface parallel to good approximation? If so how can an image of the sun be formed using a pinhole camera (for e.g. sun diameter estimate), the rays incident on the pinhole can't all be parallel and at least for this case the approximation si not valid, right ?
 A: There are two different senses in which the rays from the Sun are "not exactly" parallel, and one of these is a better approximation than the other.


*

*The rays traveling from different points on the Sun's surface to the same point on Earth's surface are not precisely parallel.  In fact, the angle between them is simply the angular size of the Sun, or about 0.5°.  (This number can be found by taking the ratio of the Sun's diameter to the Earth-Sun distance.)  This is what makes it possible for a lens or a pinhole to form an image.

*The rays traveling from the same point on the Sun to different points on the Earth are not precisely parallel either.  However, the angle between them is much, much smaller.  For example, the rays hitting the opposite sides of a lens with diameter 10 cm differ in angle by
$$
\theta \approx \frac{\text{diameter of lens}}{\text{Earth-Sun distance}} = \frac{ 10 \text{ cm}}{150 \text{ million km}} = 6.7 \times 10^{-13} \text{ radians} = 4 \times 10^{-11} \text{ degrees}.
$$
When solving geometric optics problems, the rays from an "object at infinity" are usually assumed to be parallel in the second sense, which as you can see is a pretty good approximation.
