[u, v] = meshgrid(linspace(0, 6 * pi, 100), linspace(0, 2 * pi, 100));
x = 2 * (1 - exp(u / (6 * pi))) .* cos(u) .* (cos(0.5 * v))^2;
y = 2 * (-1 + exp(u / (6 * pi))) .* sin(u) .* (cos(0.5 * v))^2;
z = 1 - exp(u / (3 * pi)) - sin(v) + exp(u / (6 * pi)) .* sin(v);
figure, surf(x, y, z), xlabel('x'), ylabel('y'), zlabel('z'), title('Seashell')
c = 1;
[u, v] = meshgrid(linspace(-pi, pi, 100));
x = cos(u) .* (c + sin(v) .* cos(u) - sin(2 * v) .* (sin(u) / 2));
y = sin(u) .* (c + sin(v) .* cos(u) - sin(2 * v) .* (sin(u) / 2));
z = sin(u) .* sin(v) + cos(u) .* (sin(2 * v) / 2);
figure, surf(x, y, z), xlabel('x'), ylabel('y'), zlabel('z'), title('Eight torus')
r1 = 0.25;
r2 = 0.25;
T = 2;
n = 6;
[u, v] = meshgrid(linspace(0, 2 * n * pi, 100), linspace(0, 2 * pi, 100));
x = (1 - r1 * cos(v)) .* cos(u);
y = (1 - r1 * cos(v)) .* sin(u);
z = r2 * (sin(v) + T * u / pi);
figure, surf(x, y, z), xlabel('x'), ylabel('y'), zlabel('z'), title('Helical spring')
a = 0.3;
b = 0.5;
[u, v] = meshgrid(linspace(0, 2 * pi, 100), linspace(-3, 3, 100));
x = exp(b * v) .* cos(v) + exp(a * v) .* cos(u) .* cos(v);
y = exp(b * v) .* sin(v) + exp(a * v) .* cos(u) .* sin(v);
z = exp(a * v) .* sin(u);
figure, surf(x, y, z), xlabel('x'), ylabel('y'), zlabel('z'), title('Cornucopia')
Best Answer