<< contour 3d_plot eval3dp >>

Scilab Help >> Graphiques > 3d_plot > cylinder

cylinder

Computes cylinder coordinates

Syntax

[x, y, z] = cylinder(r, n)

Arguments

r

Radius. Default value is 1.

n

Number of points around circumference. Default value is 20.

x, y, z

Computed Cartesian coordinates.

Description

cylinder returns the Cartesian coordinates of a cylinder (with height equal to 1) without drawing it. The returned coordinates can be then plotted using surf.

If r is a scalar, then each coordinate is a 2 x (n+1) matrix. If r is a vector, then each coordinate is a size(r, "*") x (n+1) matrix.

Examples

Cylinder with radius equal to 1:

scf();
[x, y, z] = cylinder();
surf(x, y, z);
gcf().color_map = jet(64);

Cylinder with radius equal to 3, more points over circumference, and height equal to 20:

scf();
[x, y, z] = cylinder(3, 40);
surf(x, y, 20 * z);
gcf().color_map = jet(64);

Cylinder with decreasing radius (Cone):

scf();
[x, y, z] = cylinder(10:-0.2:0, 40);
surf(x, y, z, "LineStyle", "none");
gcf().color_map = jet(64);

See also

History

VersionDescription
2025.1.0 Function cylinder introduced.

Report an issue
<< contour 3d_plot eval3dp >>