MATLAB Answers

How to uniformly sample the surface of a sphere?

48 views (last 30 days)
Davide Mori
Davide Mori on 30 Sep 2020
Edited: Bruno Luong on 7 Mar 2021
Hi,
could someone help me to find a way of generating uniformly distributed samples over the surface of a sphere? I need something like 1400 sample over it. Moreover, I would like to obtain the spherical coordinates of each sample.
Thank you :)
  1 Comment
Adam Danz
Adam Danz on 30 Sep 2020
Moving my answer here because it doesn't address the uniform requirement
These suggestions produce points on the surface of a sphere along a set number of angles but they are not uniformly spaced across the entire sphere.
Check out sphere(). See demo.
Alternatively, compute the sphere coordinates using sin() and cos(). See demo.

Sign in to comment.

Accepted Answer

Bruno Luong
Bruno Luong on 30 Sep 2020
Edited: Bruno Luong on 30 Sep 2020
There are few methods avialable on File exchange such as this one.
  4 Comments
Bruno Luong
Bruno Luong on 30 Sep 2020
I can't suggest anything relevant without knowing what you intend to do with the points.

Sign in to comment.

More Answers (1)

Gary Cofer
Gary Cofer on 5 Mar 2021
Edited: Bruno Luong on 7 Mar 2021
For a realtime acqusition of data that can be cut short, a 3D Halton series works very well.

Community Treasure Hunt

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

Start Hunting!