Let's learn how to draw a circle and arcs-
First of all, don't forget to type " Screen 9" because normally Q basic is in default screen 1 in which figures cannot be drawn.
The syntax for drawing a circle or an arc-
CIRCLE ( X, Y ) , R , C , SA , EA
where,
( X , Y ) = the coordinate of the center of the circle.
R = the radius of the circle
C = the colour code which is optional
SA = the starting angle if you want to draw an arc
EA = the ending angle of the arc
Examples-
1. Drawing a circle-
CLS
SCREEN 9
CIRCLE ( 60 , 60 ), 20 , 9
END
This draws a circle with radius 20 pixels at the pixel pointed (60,60) in blue.
Don't just draw circles, try concentric circles, intersecting circles and complex figures and pictures using circle and line commands.
First of all, don't forget to type " Screen 9" because normally Q basic is in default screen 1 in which figures cannot be drawn.
The syntax for drawing a circle or an arc-
CIRCLE ( X, Y ) , R , C , SA , EA
where,
( X , Y ) = the coordinate of the center of the circle.
R = the radius of the circle
C = the colour code which is optional
SA = the starting angle if you want to draw an arc
EA = the ending angle of the arc
Examples-
1. Drawing a circle-
CLS
SCREEN 9
CIRCLE ( 60 , 60 ), 20 , 9
END
This draws a circle with radius 20 pixels at the pixel pointed (60,60) in blue.
Don't just draw circles, try concentric circles, intersecting circles and complex figures and pictures using circle and line commands.
Thanks
ReplyDeleteCLS
ReplyDeleteSCREEN 9
CIRCLE ( 60 , 60 ), 20 , 9
END
Very helpful
ReplyDelete