間違えた

do{
x = r - 2 *r * Math.random();
y = r - 2 * r * Math.random();
}while(x * x + y * y > r * r);