Superellipse: Difference between revisions

no edit summary
m (Ada: No use of SDL.Video.Surfaces)
No edit summary
Line 626:
}
}</lang>
 
=={{header|Liberty BASIC}}==
Reworked the Julia version to work and added a loop with a spread on n values.
<lang lb>
[start]
nomainwin
UpperLeftX=1:UpperLeftY=1
WindowWidth=800:WindowHeight=600
open "Super Ellipse" for graphics_nf_nsb as #1
#1 "trapclose [q];down;fill black;flush;color green;size 1"
 
n=1.5
a=200
b=200
 
for n = 0.1 to 5 step .1
na=2/n
t=.01
for i = 0 to 314
xp=a*sign(cos(t))*abs((cos(t)))^na+350
yp=b*sign(sin(t))*abs((sin(t)))^na+275
t=t+.02
#1 "set ";xp;" ";yp
next i
next n
 
'plot only the super ellipse for the task
n=2.5
na=2/n
t=.01
#1 "color white;size 4"
for i = 0 to 314
xp=a*sign(cos(t))*abs((cos(t)))^na+350
yp=b*sign(sin(t))*abs((sin(t)))^na+275
t=t+.02
#1 "set ";xp;" ";yp
next i
wait
 
[q]
close #1
end
 
function sign(x)
if x<0 then sign=1
if x>0 then sign=-1
if x=0 then sign=0
end function
</lang>
 
=={{header|Maple}}==