Three-dimensional Geometric Shapes - GNU Octave
Description: GNU Octave

Previous: Three-dimensional Function Plotting, Up: Three-Dimensional Plots

##### 15.2.2.3 Three-dimensional Geometric Shapes

— Function File: cylinder
— Function File: cylinder (r)
— Function File: cylinder (r, n)
— Function File: [x, y, z] = cylinder (...)
— Function File: cylinder (ax, ...)

> Generate three matrices in `meshgrid` format, such that `surf (`x`,` y`,` z`)` generates a unit cylinder. The matrices are of size n`+1`-by-n`+1`. r is a vector containing the radius along the z-axis. If n or r are omitted then default values of 20 or [1 1] are assumed.

> Called with no return arguments, `cylinder` calls directly `surf (`x`,` y`,` z`)`. If an axes handle ax is passed as the first argument, the surface is plotted to this set of axes.

> Examples:

>               [x, y, z] = cylinder (10:-1:0,50);
>               surf (x, y, z);
>               title ("a cone")

> See also: sphere.

— Function File: [x, y, z] = sphere (n)
— Function File: sphere (h, ...)

> Generate three matrices in `meshgrid` format, such that `surf (`x`,` y`,` z`)` generates a unit sphere. The matrices of n`+1`-by-n`+1`. If n is omitted then a default value of 20 is assumed.

> Called with no return arguments, `sphere` call directly `surf (`x`,` y`,` z`)`. If an axes handle is passed as the first argument, the surface is plotted to this set of axes.

> See also: peaks.

— Function File: [x, y, z] = ellipsoid (xc, yc, zc, xr, yr, zr, n)
— Function File: ellipsoid (h, ...)

> Generate three matrices in `meshgrid` format that define an ellipsoid. Called with no return arguments, `ellipsoid` calls directly `surf (`x`,` y`,` z`)`. If an axes handle is passed as the first argument, the surface is plotted to this set of axes.

> See also: sphere.