Skip to content

cone

plot · scripts/plot/draw/cone.m

: [x, y, z] = cone ()
: [x, y, z] = cone (r)
: [x, y, z] = cone (r, n)
: h = cone (…)
: cone (ax, …)

Generate the surface of a right circular cone about the z axis.

The base radius is the scalar r (default 1). The apex lies at z = 1 with radius 0 and the base at z = 0. The circumference is sampled with n segments (default 20), so the result matrices have 2 rows and n+1 columns, the last column repeating the first.

With three output arguments the coordinate matrices are returned; otherwise the surface is drawn and its handle is returned.