/ concept-collection / turing-surface
Sign in
concept-collection / turing-surface
9 lines · 277 BBlameHistoryRaw
1% A dumbbell: radius 1 - waist*sin(theta)^2, stretched along z.
3function [gx, gy, gz] = shape(theta, phi, waist, stretch)
4 st = sin(theta);
5 r = 1 - waist * (st .^ 2);
6 gx = r .* (st .* cos(phi));
7 gy = r .* (st .* sin(phi));
8 gz = (1 + stretch) * (r .* cos(theta));
9end
moveopenescclose