concept-collection / numbl-surfacefun-intro
numbl-surfacefun-intro / vec_normals.m
18 lines · 445 BBlameHistoryRaw
1% vec_normals.m — The surface normal field (surfacefunv).
2%
3% A surfacefunv is a three-component vector field on a surface. normal(dom)
4% returns the unit outward normal. quiver(v, scale, n) draws n vectors per
5% patch, scaled by `scale`.
7mip load --install flatironinstitute/flatironinstitute/surfacefun
9rng(0)
10p = 16;
11nref = 2;
12dom = surfacemesh.blob(p + 1, nref);
14v = normal(dom);
16figure(1);
17quiver(v, 0.2, 6)
18title('Surface normals');