How to distribute random points outwards from a center location?
2 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, I am trying to find a way to distribute random points outwards from a center location, where the points become more dense as distance from the center increases? Basically the opposite of Gaussian where the points are more dense at the center and less dense at the edges.
0 Commenti
Risposta accettata
Walter Roberson
il 30 Set 2022
cx = 3; cy = 5; %as appropriate
R = 20;
N = 1000;
theta = rand(1, N) * (2 * pi);
rbase = rand(1,N) * R;
[X, Y] = pol2cart(theta, rbase.^(1/2));
X = X + cx;
Y = Y + cy;
scatter(X, Y); title('even distribute in circle')
[X, Y] = pol2cart(theta, rbase.^(1/3));
X = X + cx;
Y = Y + cy;
scatter(X, Y); title('distribute 1/3')
You can see that the second plot is distributed more densely as it gets further away from the center.
0 Commenti
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Smoothing in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!