1% Lobes around the equator, plus a pear-shaped offset along z.
2% `nlobe` should be a whole number, or the surface does not close at the
3% phi = 0 seam.
5function [gx, gy, gz] = shape(theta, phi, amp, nlobe, pear)
6 st = sin(theta);
7 r = 1 + amp * ((st .^ 4) .* cos(nlobe * phi)) + pear * cos(theta);
8 gx = r .* (st .* cos(phi));
9 gy = r .* (st .* sin(phi));
10 gz = r .* cos(theta);
11end