mySphere(N)

MATLAB function for generating equidistant points on the surface of a unit sphere.

You are now following this Submission

Input: the target number of points or nodes on the surface of a unit sphere (N).
Output: position column vectors X, Y, and Z of length equal to or close to N.
Points are distributed by choosing circles of constant latitudes separated by d_theta, and on these circles placing points separated by d_phi, such that d_theta ~ d_phi. The area per point (d_theta)*(d_phi) therefore remains constant across the sphere surface.

Cite As

Brian Z Bentz (2026). mySphere(N) (https://www.mathworks.com/matlabcentral/fileexchange/57877-mysphere-n), MATLAB Central File Exchange. Retrieved .

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0

6/20/2016: added an example script to plot the unit sphere and demonstrate scaling the radius and displacement.