Collection of Surfaces

This page contains a collection of some surfaces with code to render them in a numerical computational package like Scilab or Matlab. The code has been tested on Scilab 4.0.

---

Moebius Strip

Scilab rendering of a Moebius Strip

//Moebius Strip

clear;
stacksize (10000000);
num_points = 20;
R = 20;
s = linspace (-0.4, 0.4, num_points);
t= linspace (0, 2*(%pi), num_points);
[S, T] = meshgrid (s, t);
x = [R + (S.*cos(T/2))].*cos(T);
y = [R + (S.*cos(T/2))].*sin(T);
z = S.*sin(T/2);
surf(x, y, z,’edgecol’,'gre’);

---

Plücker’s Conoid

Scilab rendering of Plücker's Conoid

//Plücker’s Conoid where N=number of folds
stacksize (10000000);
num_points = 50;
u = linspace (0, 2*(%pi), num_points);
v= linspace (0, (1/2)*(%pi), num_points);
[U, V] = meshgrid (u, v);
x = V.*cos(U);
y = V.*sin(U);
z = sin(N.*U);
mesh (x, y , z);
surf(x, y, z,’edgecol’,'blu’);

---

Cross Cap I

Scilab rendering of a Cross-cap

//Cross Cap I
stacksize (10000000);
num_points = 50;
u = linspace (0, 2*(%pi), num_points);
v= linspace (0, (1/2)*(%pi), num_points);
[U, V] = meshgrid (u, v);
x=(1/2).*sin(U).*sin(2*V);
y=sin(2*U).*sin(V).*sin(V);
z=cos(2*U).*sin(V).*sin(V);
mesh (x, y , z);
surf(x, y, z,’edgecol’,'gre’);

---

Cross Cap II

Scilab rendering of a Cross-cap

//Cross Cap II
stacksize (10000000);
num_points = 50;
u = linspace (0, 2*(%pi), num_points);
v= linspace (0, (1/2)*(%pi), num_points);
[U, V] = meshgrid (u, v);
x = (cos(U).*sin(2*V))./2;
y = (sin(U).*sin(2*V))./2;
z = ( ( cos(V) .* cos(V) )-( (cos(U).*cos(U)).*(sin(V).*sin(V) ) ) )./2;
mesh (x, y , z);
surf(x, y, z,’edgecol’,'gre’);

---

Pseudo Cross Cap

Scilab rendering of a Cross-cap

//Pseudo Cross Cap
stacksize (10000000);
num_points = 50;
u = linspace (0, 2*(%pi), num_points);
v= linspace (0, (1/2)*(%pi), num_points);
[U, V] = meshgrid (u, v);
x = (1.- (U.*U)).*sin(V);
y = (1.- (U.*U)).*sin(2*V);
z = U;
mesh (x, y , z);
surf(x, y, z,’edgecol’,'red’);

---

Roman Surface

Scilab rendering of a Roman surface

//Roman Surface

clear;
stacksize (10000000);
num_points = 50;
r = 20;
u = linspace (0, 2*(%pi), num_points);
v= linspace (-%pi/2, %pi/2, num_points);
[U, V] = meshgrid (u, v);
x=(1/2).*sin(2*U).*sin(V).*sin(V);
y=(1/2).*sin(U).*cos(2*V);
z=(1/2).*cos(U).*sin(2*V);
surf(x, y, z,’edgecol’,'gre’);

---

Boy Surface

Scilab rendering of a Boy surface

//Boy Surface

clear;
stacksize (10000000);
num_points = 50;
u = linspace (-%pi/2, %pi/2, num_points);
v= linspace (0, %pi, num_points);
[U, V] = meshgrid (u, v);
x = (sqrt(2)*(cos(V).^2).*cos(2*U) + cos(U).*sin(2*V))./(2 – sqrt(2) * sin(3*U).*sin(2* V));
y = (sqrt(2)*(cos(V).^2).*sin(2*U) + cos(U).*sin(2*V))./(2 – sqrt(2) * sin(3*U).*sin(2* V));
z = 3 * (cos(V).^2)./(2 – sqrt(2).*sin(3*U).*sin(2*V));
surf(x, y, z,’edgecol’,'gre’);

---

Homotopy between Roman Surface and Boy Surface

Homotopy with alpha = 0, resulting in a Roman Surface

Homotopy with alpha = 0.5, resulting in a cross between Roman and Boy surfaces

Homotopy with alpha = 1, resulting in a Boy Surface

//A homotopy between the Roman surface and the Boy surface

clear;
stacksize (10000000);
num_points = 50;
u = linspace (-%pi/2, %pi/2, num_points);
v= linspace (0, %pi, num_points);
[U, V] = meshgrid (u, v);
//alpha = 0: Roman surface; alpha = 1: Boy surface;
alpha = 0;
x = ((sqrt(2).*cos(2*U).*cos(V).*cos(V))+cos(U).*sin(2*V))./(2-alpha.*sqrt(2).*sin(3*U).*sin(2*V));
y = ((sqrt(2).*sin(2*U).*cos(V).*cos(V))-sin(U).*sin(2*V))./(2-alpha.*sqrt(2).*sin(3*U).*sin(2*V));
z = (3*cos(V).*cos(V))./(2-alpha*sqrt(2).*sin(3*U)*sin(2*V));
surf(x, y, z,’edgecol’,'gre’);

---

Klein Bottle I

Scilab rendering of a Klein Bottle

//Klein Bottle I

clear;
stacksize (10000000);
num_points = 50;
u = linspace (0, 2*(%pi), num_points);
v= linspace (0, 2*(%pi), num_points);
[U, V] = meshgrid (u, v);
x = cos(U) .* ((cos (U/2)) .* (sqrt(2) + cos (V)) + ( sin (U/2) .* sin (V) .* cos (V) ));
y = sin(U) .* ((cos (U/2)) .* (sqrt(2) + cos (V)) + ( sin (U/2) .* sin (V) .* cos (V) ));
z = – ((sin (U/2)) .* ((cos (U/2)) .* (sqrt(2) + cos (V)))) + ( cos (U/2) .* sin (V) * cos (V) );
surf(x, y, z,’edgecol’,'gre’);

---

Klein Bottle II

Scilab rendering of a Klein Bottle

//Klein Bottle II

clear;
stacksize (10000000);
num_points = 50;
u = linspace (0, 2*(%pi), num_points);
v= linspace (0, 2*(%pi), num_points);
[U, V] = meshgrid (u, v);
x = cos(U).*(cos(U./2).*(sqrt(2)+cos(V))+(sin(U./2).*sin(V).*cos(V)));
y = sin(U).*(cos(U./2).*(sqrt(2)+cos(V))+(sin(U./2).*sin(V).*cos(V)));
z = -1.*sin(U./2).*(sqrt(2)+cos(V))+cos(U./2).*sin(V).*cos(V);
surf(x, y, z,’edgecol’,'gre’);

-