CP/M User
January 11th, 2004, 11:22 PM
10 CLS:SCREEN 2:FOR A=1 TO 360
20 X=50*COS(A):Y=50*SIN(A)
30 LINE(125,115)-(150+X,140+Y)
40 NEXT A
Some Notes:Line 10: Clear Screen
Set Video Mode (2 : 640x200 mono)
Begin FOR loop
Line 20: Calculate X
(50 = Circumference of Circle * COS of 1 to 360)
Calculate Y
(50 = Circumference of Circle * SIN of 1 to 360)
Line 30: Draw Line
Syntax:- Line(x1,y1)-(x2,y2)
- divided 50 / 2, since 150 is where our circle
starts the centre is around 125 for X1, same
with Y1 to get 115.
- Added 150 to draw complete Circle on Screen
for X2
- Added 140 to draw complete Circle on Screen
for Y2.
Line 40: Go back & add one to FOR loop
BTW, in case you're wonderning, this program has any l
ittle point, except it does some calculations in order to
produce a circle. Well I'd thought it'd be nice to get some
more arrays! :-)
Cheers,
CP/M User.
20 X=50*COS(A):Y=50*SIN(A)
30 LINE(125,115)-(150+X,140+Y)
40 NEXT A
Some Notes:Line 10: Clear Screen
Set Video Mode (2 : 640x200 mono)
Begin FOR loop
Line 20: Calculate X
(50 = Circumference of Circle * COS of 1 to 360)
Calculate Y
(50 = Circumference of Circle * SIN of 1 to 360)
Line 30: Draw Line
Syntax:- Line(x1,y1)-(x2,y2)
- divided 50 / 2, since 150 is where our circle
starts the centre is around 125 for X1, same
with Y1 to get 115.
- Added 150 to draw complete Circle on Screen
for X2
- Added 140 to draw complete Circle on Screen
for Y2.
Line 40: Go back & add one to FOR loop
BTW, in case you're wonderning, this program has any l
ittle point, except it does some calculations in order to
produce a circle. Well I'd thought it'd be nice to get some
more arrays! :-)
Cheers,
CP/M User.