Image analysis camera A camera has the following data:
CCD-chip


*

*Horizontal solution 5120 pixels

*Vertical solution 3840 pixels

*Pixels size $6.4 \mu$m $\cdot$ $6.4 \mu$m

*Pixels placement $6.4 \mu$m (center to center)


Working distance is 400 mm from horizontal table. A ball with diameter 90 mm is placed on top of the table right below the camera so that the camera and the centrum of the ball line up. The focal length is 40 mm. What will the diameter of the ball be in the image measured in pixels. 
(sorry for bad english - this is a translation) 
I really hope someone can help. I have no idea how solve this. 
 A: Hint:  Look up the appropriate formulas in your text.  From the focal length and distance to the object, calculate the distance from the lens to the image.  From the two distances, calculate the diameter of the image.  Divide by the pixel size to get the number of pixels.
Added:  $\theta$ is the half angle of the ball seen from the lens.  I would disagree with subtracting the $45$ in the denominator.  $r$ is the radius of the image, calculated with similar triangles.  He is taking the image to be at $40$ mm from the lens, which is not too far off as the working distance is pretty large compared to the focal length.  
The calculation I suggested goes as follows:  in the thin lens approximation, $$\frac 1f=\frac 1{d_i}+\frac 1{d_o}\\f=\text {focal length, } d_o=\text {object distance, }d_i=\text {image distance}\\\frac 1{40}=\frac 1{d_i}+\frac 1{400}\\d_i=\frac {400}9 \approx 44.444 mm\\ \frac {s_i}{d_i}=\frac {s_o}{d_o}\\ s_i= \text{size of image, } s_o= \text{size of object}\\s_i=90\cdot \frac {400}{9 \cdot 400}=10mm=\frac {10}{0.0064}=1562.5 \text {pixels}$$  
