Should I use th = acos(r) or th = acos(sqrt(r)) where r is a random number between 0 and 1. 'th' is the angle of the ray from the normal to the surface.
I have deleted my previous post because the answer I gave was wrong.
If your purpose is to obtain a photon propagation distributed uniformly in all directions of the half plane, then neither of your proposed procedures would work correctly.
Could you give more details about how you would like the photons be distributed ?
Surface emission should satisfy Lambert's cosine law.
http://en.wikipedia.org/wiki/Lambert's_cosine_law
So, when emitting photons in 3D, you would have to choose two angles : one in the xy plane( azimuthal angle) and the angle between z axis and the ray : polar angle.
The azimuthal angle can be uniformly distributed. A book on this subject suggests that the polar angle must be generated using th = acos( sqrt(r)) to satisfy lambert;s law ( attaching proof ) .
I wrote a code to calculate view factor between 2 inclined plates . My numerical solution does not get validated when I use th = acos(sqrt(r)) but rather works when I use th = acos(r) to a high degree of accuracy. What mistake am I making ?