The usual forms of the
CIRCLE
command are:
Command
Effect
CIRCLE
on. centre column. centre row, radius
CIRCLE
on, ocol, c-row, width, height
CIRCLE
on, c-col, c-row, wid, ht, Start, finish
CIRCLE
on, c-col, c-row, width, height...angle
CIRCLE on, c-col, c-row, wid, ht,,.,point angle
circle
oval
arc
rotated oval
Polygon
to take the pace of the angle, even though you don't want the box
rotated. This Is so your computer reads the comma as the DEFAULT
value, which means that it interprets your lack of response as an
instruction. If you don't include the comma, the 1 at the end of the line
Is read as the angle for the box to be rotated.
Some typical forms of
the BOX
command are: '
Command
Effect
BOX
on. column 1, row 1, column 2. row 2
Outline
BOX
on, col 1, row 1, col 2, row 2. angle
Rotated
BOX
on. col 1, row 1. col 2, row 2. , fill
Solid box
BOX
oft, col 1. row 1, col 2, row 2, angle,
Erase area
of screen
Column 1, row 1, etc. are screen positions of endpoints that you
specify. Column 1, row 1 is the upper left corner of the box. while row
and column 2 is the bottom right corner
Here Is
a
program that illustrates the
BOX
command (line 60)
10 COLOR 0,1
20 COLOR 1,2
30 GRAPHIC 2,1
40 A us AND(1)* 20+ 10
SO FOR L-0 TO
359
STEP A
60 BOX 1, 100, 30, 220, 130, L
70 NEXT L
80 FOR Loot TO 2000: NEXT L
90 GRAPHIC 0,1
Drawing Circles
Your Commodore 16 also nas commands for drawing circles. Like the
BOX command, you can vary the shape of the circle (to form an oval or
an ellipse), and you can rotate the oval. You can also just draw a
section of the shape (called an arc).
This commano draws a circle in the centre of the screen: CIRCLE
1,160,100,50. This tells your computer to draw a circle with its centre at
column 160 and row 100. with a radius of 50. This may actually
produce an oval, since the dots on some TV's and monitors (American
ones, for example) are taller than they are wide. To change this to a
real circle you must add a separate number to tell that the height is
different from the width, like this:
CIRCLE 1,160,100,50,42.
Drawing Polygons
Your Commodore 16 can also draw a square, triangle or other polygon
using the
CIRCLE
command. Just tell the computer how many
degrees to go between points on the circle, like this: CIRCLE
1,160,100,50,42,,,,120. This command draws a triangle, since each
side is 120 degrees. (Remember that omitting number values while
including commas in a graphic command causes your computer to read
standard default values for the missing number.) A simple formula to
get the angle for a polygon with N sides is 360/N.
Here's a quick program for drawing polygons:
10 GRAPHIC 2,1
20 INPUT"HOW MANY SIDES";A
30 IF A<2 OR A> 100 THEN PRINT "DONT BE RIDICULOUS":
GOTO 20
40 CIRCLE 1,160,80,40,33„„360/A
50 GOTO 20
You can choose to draw only an arc Instead of
a
whole circle. The
CIRCLE
command accepts the starting
and
ending angles in degrees,
78
79
Need help?
Do you have a question about the Commodore 16 and is the answer not in the manual?
Questions and answers