Circle Plotting; Plotting A Circle - Epson FX Series User Manual

Fx series printer
Hide thumbs Also See for FX Series:
Table of Contents

Advertisement

Circle Plotting

You can have your program examine the cells of an array in any
order; the following program scans them row by row, using two
loops:
20 FOR R=l TO N: FOR C=l TO N
At each cell, line 30 calculates the cell's distance from a center point by
using the distance formula:
30
D=SQR((R-11)^2+(C-11>^2)
Next the program compares this distance with a number
specifies the radius of a circle. Notice that this formula commonly
results in a number that includes a decimal fraction, e.g.,
If the distance for the current cell A(R,C) is close to 10, you set its
contents equal to one: otherwise, you leave it alone.
40
IF INT(D+.0)=l0 THEN A(R,C)=l
Line
sets any cell whose distance is between
40
to one.
Figure

Plotting a circle

13-5.
(10)
8.94.
and 10.5 equal
9.5
that
177

Hide quick links:

Advertisement

Chapters

Table of Contents
loading

This manual is also suitable for:

Fx-100Fx-80Fx-185 - impact printer

Table of Contents