0

I'm trying to solve this problems:

Build the surf plot of the ellipsoid when a=1, b=1.5, c=2 with:

z = c*(1-(x^2)/(a^2)-(y^2)/(b^2))^0.5;

Use the coordinate transformation when (0a and b and 22 values of t.

x=a*cos(t);
y=b*sin(t);
tashuhka
  • 5,028
  • 4
  • 45
  • 64
  • possible duplicate of [draw ellipse and ellipsoid in MATLAB](http://stackoverflow.com/questions/2153768/draw-ellipse-and-ellipsoid-in-matlab) – tashuhka Apr 18 '14 at 10:14

1 Answers1

0
a = 1;
b = 0.5;
c = 2;
t = linspace(0,2*pi,22);
p = linspace(0,pi,22);
[T,P] = meshgrid(t,p);
x = a*cos(T).*cos(P);
y = b*cos(T).*sin(P);
z = c*sin(T);
figure,surf(x,y,z)

This solution uses the parameterization for the ellipsoid. 0<=t<=2*pi and 0<=p<=pi

x = acos(t)cos(p)
y = bcos(t)sin(p)
z = cos(t)
RDizzl3
  • 846
  • 8
  • 18