/ concept-collection / turing-surface
Sign in
concept-collection / turing-surface
19 lines · 821 BCodeBlameHistory
0af3386Reaction-diffusion on spherical-harmonic surfacesJeremy Magland 1% Lobes around the equator, plus a gentle pear-shaped offset along z.
2%
3% The radial deformation sin(theta)^4 * cos(nlobe*phi) is the shape of a
4% sectoral harmonic of order nlobe, concentrated at the equator and vanishing
5% at both poles; the cos(theta) term breaks the north-south symmetry so the two
6% ends differ.
7%
8% `nlobe` should be a whole number. A fraction makes cos(nlobe*phi) disagree
9% with itself across the phi = 0 seam, which is not a closed surface; the
10% analysis into coefficients will band-limit whatever results, but what comes
11% back is not what this file says.
13function [gx, gy, gz] = shape(theta, phi, amp, nlobe, pear)
14 st = sin(theta);
15 r = 1 + amp * ((st .^ 4) .* cos(nlobe * phi)) + pear * cos(theta);
16 gx = r .* (st .* cos(phi));
17 gy = r .* (st .* sin(phi));
18 gz = r .* cos(theta);
19end
moveopenescclose