Skip to content

sphere

plot · scripts/plot/draw/sphere.m

: sphere ()
: sphere (n)
: sphere (ax, …)
: [x, y, z] = sphere (…)

Generate the coordinates of the unit sphere as three (n+1)-by-(n+1) matrices (default n = 20).

Rows run from the south pole to the north pole, columns around the axis starting at an azimuth of -\pi. The pole rows are exactly zero in x and y. Without output arguments the sphere is drawn as a surface with equal axis scaling; with one output only x is returned.