You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
% get random position in circle |
|
function [res_x, res_y] = unifrnd_circle(r) |
|
|
|
while true |
|
res_x = unifrnd(-r, r, 1, 1); |
|
res_y = unifrnd(-r, r, 1, 1); |
|
ans_r = sqrt(res_x^2 + res_y^2); |
|
if ans_r < r |
|
break |
|
end |
|
end |
|
|
|
end |
|
|
|
|