Originally Posted by

**elbarto** Hi,

I am trying to create a hyperbolic paraboloid much like the one I have below, but instead of having a square region as shown, I would like to have an ellipse (to give an effect similar to the roof shape on the Calgary Olympic stadium).

My problem is that I have only used the "meshgrid" command in matlab to generate square/rectangular regions so I am unsure how to do this. I think I need to find an appropriate parametrization of an ellipse in order to produce the result I am after. I can see that if I wanted a circle I would use a parametrization of radius and the angle theta but for an ellipse where the radius is not constant I am pretty confused on how to achieve this.

Any help would be greatly appreciated,

Regards Elbarto

Code for images below

Code:

%Hyperbolic paraboloid
x = [-10:.5:10];
y=[-10:.5:10];
[X, Y] = meshgrid(x,y);
Z = X.^2-Y.^2;
surf(X,Y,Z)
xlabel x
ylabel y
zlabel z

I'm not sitting at a machine with Matlab at the moment so I don't know if M. works this way but:

Code:

dr=0.2;
r=dr/2:dr:10;
dtheta=2*pi/20;
theta=0:dtheta:dtheta*20;
x=kron(r,cos(theta));
y=kron(r,sin(theta));
[X, Y] = meshgrid(x,y);
Z = X.^2-Y.^2;
surf(X,Y,Z)

.