These formulae are obtained by using random numbers in the inverse of the equations which describe the distribution of luminous intensity. The symbol R represents a function which gives a different random number on the interval [0,1] each time it is called.
This gives a scaled random distribution of the angles q and f in general coordinates (algorithm 5.11)
This gives a scaled random distribution of the angles q 'and f' in the local coordinates of the surface.