All pastes #413403 Raw Edit

labormathe

public text v1 · immutable
#413403 ·published 2007-03-28 12:04 UTC
rendered paste body
x =3D [a,-a,-a,a,a];
y =3D [b,b,-b,-b,b];
r_e =3D sqrt(x.^2 + y.^2);
phi_e =3D atan2(y,x);
x_k =3D [-pi,0,nan,-pi/2,pi/2];
y_k =3D [r_0,r_0,nan,r_0,r_0];

phi_h =3D [atan2(b,a),atan2(-b,-a),nan,atan2(-b,a),atan2(b,-a)];
r_h =3D [r_0,r_0,nan,r_0,r_0];

%elipese

[phi,r] =3D kegelpol('e',n_points,a,b,r_0)

figure
polar(x_k,y_k,'r');
hold on;
polar(phi_e,r_e,'r');
hold on;
polar(phi,r);
hold off;

ueberschrift =3D ['Ellipse: a=3D',num2str(a),' ','b=3D',num2str(b)];
title(ueberschrift);


%hyperbell

[phi,r] =3D kegelpol('h',n_points,a,b,r_0)

figure
polar(x_k,y_k,'r');
hold on;
polar(phi_e,r_e,'r');
hold on;
polar(phi_h,r_h,'g');
hold on;
polar(phi,r);
hold on;
polar(pi-phi,r); %polarplot links
hold off;

ueberschrift =3D ['Hyperbel: a=3D',num2str(a),' ','b=3D',num2str(b)];
title(ueberschrift);
%

%parrabell

[phi,r] =3D kegelpol('p',n_points,a,b,r_0)

figure
polar(x_k,y_k,'r');
hold on;
polar(phi,r);
hold off;

ueberschrift =3D ['Parabel: a=3D',num2str(a)];
title(ueberschrift);