Please can anyone tell me how to compute a PDF for a (Multidimensional) Uniform distribution on a square as shown below?...

Attachment 24001 for a given theta (p,q) and a =2? Attachment 24002

I understand how to sample from a one dimensional uniform distribution, how can I extend it to the case in higher dimensions?

Thanks