Draw a sphere: Difference between revisions

Line 285:
DO: LOOP WHILE INKEY$ = ""
END</lang>
 
==={{header|Run BASIC}}===
<lang runbasic>'Run BASIC White Sphere, Black background
'runbasic.com
graphic #win, 300, 300
#win size(1)
R=100
R2=R*R
X0=300/2
Y0=300/2
for Y = -150 to 150
for X = -150 to 150
D2 = X*X + Y*Y
C = 0
if D2 <= R2 then Z = sqr(R2-D2) : C = int(Z-(X+Y)/2+130)
#win color(C,C,C)
#win set(X+X0, Y+Y0)
next X
next Y
render #win</lang>
 
<lang Runbasic>'This is a simple Circle
graphic #g, 300, 300 'create a graphic object
#g place(100,100) 'place the drawing pen at 100,100
#g circle(75) 'make a circle with radius 75
render #g 'show it</lang>
 
==={{header|FreeBASIC}}===
Anonymous user