A superellipse is a geometric figure defined as the set of all points (x, y) with



 





|


x
a


|


n



+


|


y
b


|


n



=
1
,


{\displaystyle \left|{\frac {x}{a}}\right|^{n}\!+\left|{\frac {y}{b}}\right|^{n}\!=1,}




where n, a, and b are positive numbers.



Task
Draw a superellipse with n = 2.5, and a = b = 200




def  X0=640/2, Y0=480/2, Scale=25.0, N=2.5;
real X, Y;  int IX, IY;
 
proc OctPoint; [
Point(X0+IX, Y0-IY, $F);
Point(X0-IX, Y0-IY, $F);
Point(X0+IX, Y0+IY, $F);
Point(X0-IX, Y0+IY, $F);
Point(X0+IY, Y0-IX, $F);
Point(X0-IY, Y0-IX, $F);
Point(X0+IY, Y0+IX, $F);
Point(X0-IY, Y0+IX, $F);
];
 
[SetVid($101);  \VESA graphics 640x480x8
IX:= 0;
repeat  X:= float(IX)/Scale;
        Y:= Pow(200.0 - Pow(X,N), 1.0/N);
        IY:= fix(Y*Scale);
        OctPoint;
        IX:= IX+1;
until   IX >= IY;
]