Sie sind auf Seite 1von 5

Pregunta 1)

a)

>> circunferencia(5)

b) function [ ] = circunferencia( r )
t=linspace(0,2*pi);
x=2*(r*cos(t));
y=3*(r*sin(t));
plot(x,y)
end

>> circunferencia(r)
c) function [ ] = circunferencia( r )
t=linspace(0,2*pi);
x=3*(r*cos(t));
y=2*(r*sin(t));
plot(x,y)
end

>> circunferencia( r )

d) function [ ] = circunferencia( r )
t=linspace(-2,2);
x=2*r*cosh(t);
y=3*r*sinh(t);
plot(x,y);
hold on;
plot(-x,y);
grid on;
hold off

>> circunferencia( r )
e) function [ ] = circunferencia( r )
t=linspace(-2,2);
x=3*r*cosh(t);
y=2*r*sinh(t);
plot(x,y);
hold on;
plot(-x,y);
grid on;
hold off

>> circunferencia( r )

f) function [ ] = circunferencia( r )
t=linspace(-2,2);
x=2+3*r*cosh(t);
y=-1+2*r*sinh(t);
plot(x,y);
hold on;
plot(-x,y);
grid on;
hold off

>> circunferencia( r )
Pregunta 2)

a) function [ ] = circunferencia( r )
t=linspace(0,2*pi);
w=linspace(0,pi);
[T,W]=meshgrid(t,w);
X=r.*sin(W).*cos(T);
Y=r.*sin(W).*sin(T);
Z=r.*cos(W);
surf(X,Y,Z);
end

>> circunferencia( r )

b) function [ ] = circunferencia( r )
t=linspace(0,2*pi);
w=linspace(0,pi);
[T,W]=meshgrid(t,w);
X=2*r.*sin(W).*cos(T);
Y=3*r.*sin(W).*sin(T);
Z=sqrt(3)*r.*cos(W);
surf(X,Y,Z);
end

>> circunferencia( r )
c)

Das könnte Ihnen auch gefallen