clc ; clear all ;
n=2;
a=1;
b=1;
x0=0; % x0,y0 ellipse centre coordinates
y0=0;
figure(1)
hold on
for t=0:0.01:2*pi;
if t < 0
x=x0+(abs(cos(t)).^(2/a)) * a*-1*(abs(cos(t)));
y=y0+(abs(sin(t)).^(2/b)) * b*-1*(abs(sin(t)));
end
if t == 0
x=x0+(abs(cos(t)).^(2/a)) * a*0*(abs(cos(t)));
y=y0+(abs(sin(t)).^(2/b)) * b*0*(abs(sin(t)));
end
if t > 0
x=x0+(abs(cos(t)).^(2/a)) * a*1*(abs(cos(t)));
y=y0+(abs(sin(t)).^(2/b)) * b*1*(abs(sin(t)));
end
plot(x,y,'.r')
grid on;
grid minor;
end