Superellipse: Difference between revisions

Added XPL0 example.
m (→‎{{header|Phix}}: syntax coloured, added online link)
(Added XPL0 example.)
Line 1,694:
}
}</lang>
 
=={{header|XPL0}}==
<lang XPL0>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;
]</lang>
 
{{out}}
<pre>
http://www.xpl0.org/rcell.gif
</pre>
 
=={{header|Yabasic}}==
772

edits