Sample from a random distribution of points inside the unit disk
Updated 12 Dec 2015

View License

% randDisk(nSamples,radius,center)
% Compute a random distribution of points inside a unit disk.
% nSamples = number of random samples to return
% radius = optional radius parameter. Default = 1.
% radius = R --> circle with radius R
% radius = [a;b;th] --> ellipse
% a = major-axis radius
% b = minor-axis radius
% th = angle between major-axis and x-axis
% center = [cx, cy] optional center of the circle command
% samples = [x;y] a uniform distribution within the desired region

Cite As

Matthew Kelly (2024). randDisk (https://www.mathworks.com/matlabcentral/fileexchange/54460-randdisk), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Find more on Creating and Concatenating Matrices in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Added photo. Removed arguments of function in file name.