/ concept-collection / numbl-surfacefun-intro
Sign in
concept-collection / numbl-surfacefun-intro
numbl-surfacefun-intro / fun_contour.m
18 lines · 500 BCodeBlameHistory
12d8453Intro to surfacefun: interactive numbl example projectJeremy Magland 1% fun_contour.m — Contour plot of a surfacefun.
2%
3% contour draws level sets of a scalar field on the surface. Contouring
4% is more expensive than a plain plot, so this script uses a coarse mesh
5% to stay quick; raise p / nref for smoother curves.
7mip load --install flatironinstitute/flatironinstitute/surfacefun
9p = 8;
10nref = 0;
11dom = surfacemesh.sphere(p + 1, nref);
13f = surfacefun(@(x, y, z) cos(6*x) .* y + exp(z), dom);
15figure(1);
16contour(f, linewidth=2)
17axis off
18title('Contours of f');
moveopenescclose