Skip to content

__sombrero__

plot · scripts/plot/draw/__sombrero__.m

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

Generate or draw the "Mexican hat" surface sin (r) ./ r.

The surface is sampled on an n-by-n grid (default 41) covering [-8, 8] in both directions, where r = sqrt (x.^2 + y.^2) and the value at the origin is 1. With no output argument the surface is drawn as a mesh; with one output the height matrix z is returned and with three outputs the grid coordinates and heights.