April 28th, 2007, 8:46 pm
One common approach for this type of problem is rejection sampling -- generate your x and y, test the condition, if its true then use the numbers, if its false then generate another pair of x and y, repeat. You'll throw out about 21% of your pairs, which is not too bad. EDIT: skyhawk beat me to it. But I do see jawabean's point. The result will be uniform on the unit quarter circle, but NOT uniform in X and Y anymore.
Last edited by
Traden4Alpha on April 27th, 2007, 10:00 pm, edited 1 time in total.