Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
2025.1.0 - Português


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

  • pol2cart — Convert polar/cylindrical coordinates to cartesian
  • sphere — Computes sphere coordinates
  • surf — Esboço de superfície 3d

History

VersãoDescrição
2025.1.0 Function cylinder introduced.
Report an issue
<< contour 3d_plot eval3dp >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 22 12:56:18 CEST 2025