Navigation

Operators and Keywords

Function List:

C++ API

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

Plot a 3-D unit sphere.

The optional input n determines the number of faces around the circumference of the sphere. The default value is 20.

If the first argument hax is an axes handle, then plot into this axis, rather than the current axes returned by gca.

If outputs are requested sphere returns three matrices in meshgrid format such that surf (x, y, z) generates a unit sphere.

Example:

[x, y, z] = sphere (40);
surf (3*x, 3*y, 3*z);
axis equal;
title ("sphere of radius 3");

See also: cylinder, ellipsoid, rectangle.

Package: octave